Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perform External Validation on Analysis #875

Open
joneubank opened this issue Oct 24, 2024 · 0 comments
Open

Perform External Validation on Analysis #875

joneubank opened this issue Oct 24, 2024 · 0 comments
Assignees
Labels

Comments

@joneubank
Copy link
Contributor

Summary of request

Building off of #871 and #872

Now that we have external validation rules stored for an analysis schema, we need to perform that external validation when an analysis is submitted or updated.

Details

  • when creating or updating an analysis, we will check for external validation rules that are attached to the analysis type
  • check for and apply external validations after the analysis passes the JSON schema validation and the file type validations (if present)
  • for each external validation rule on this analysis type:
    • check the value of the property in the analysis at the given path
    • if there is no value defined at that path, then no validation is required, this passes
    • if there is a value defined at that path, then we will check it with the configured external source
    • build a URL request to the URL included in the external validation rule

Request to the External Validation URL

Request definition:

  • GET Request
  • use the URL exactly as provided in analysis type config.
  • add query parameters:
    • studyId with the value of the study the analysis belongs to
    • value with the value as taken from the analysis property being validated

This URL will then look something like: ${url}?studyId=${study ID from analysis}&value=${property value from analysis}

Expected response

  • if the value is valid according to the external source, the response will have HTTP status 200 with no body
  • if value is invalid, the external source will return HTTP status 400. The external server may optionally return a JSON with the following form:
    {
       "error": "INVALID_VALUE",
       "message": "Any string message describing why the value is invalid"
    }
    The message from this response can be included in the response to the analysis submitter as an explanation for why the provided analysis is invalid.
  • the external service may return other HTTP status error codes, for instance if it does not recognize the request or believes it to be malformed. SONG must be prepared for these errors, and when returned we will treat them as a failed validation. When this occurs, a message should be returned to the analysis submitter explaining that an external validation on their analysis was unable to complete and the analysis could not be submitted/updated.

Additional context

This is meant to integration with Lyric. Corresponding details for the development of this songValidation endpoint on that service will be linked from here once available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants