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

feat(technicalkey): unexpected response for post policy-content - Purpose #97

Conversation

AnuragNagpure
Copy link
Contributor

Description

Error message with http status code 400 that value is not allowed. Only backend stored purposes are allowed; any other should run on an error

Why

The implementation should include the following requirements:

When the tester provides an input value that is not supported for the specified purposes, the endpoint should generate an error.
The error message displayed to the user should ideally include a comprehensive list of all allowed values for the input.
Please ensure that the implementation adheres to these guidelines.

Issue

#68

Checklist

Please delete options that are not relevant.

  • I have followed the contributing guidelines
  • I have performed a self-review of my own code
  • I have successfully tested my changes locally
  • I have added tests that prove my changes work
  • I have checked that new and existing tests pass locally with my changes
  • I have commented my code, particularly in hard-to-understand areas
  • I have added copyright and license headers, footers (for .md files) or files (for images)

@AnuragNagpure AnuragNagpure changed the title bug(technicalkey): unexpected response for post policy-content - Purpose Bugs(technicalkey): unexpected response for post policy-content - Purpose Mar 28, 2024
@AnuragNagpure AnuragNagpure changed the title Bugs(technicalkey): unexpected response for post policy-content - Purpose feat(technicalkey): unexpected response for post policy-content - Purpose Mar 28, 2024
Copy link
Member

@Phil91 Phil91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current implementation only the left operand gets checked, the ticket mentions to check the value. at the moment there is no configuration for purposes to a given value set. I think we need to clarify with @jjeroch

@AnuragNagpure AnuragNagpure force-pushed the feature/68-unexpected-response-post-policy-hub-content branch from 21a4d95 to 517b82d Compare April 17, 2024 06:41
@AnuragNagpure AnuragNagpure force-pushed the feature/68-unexpected-response-post-policy-hub-content branch from 517b82d to 2376e3e Compare April 17, 2024 06:49
@AnuragNagpure
Copy link
Contributor Author

Below changes are added as per description.

PolicyAttributes

remove - ID Trace 3.1 from policy_attributes

map attribute_values:

purpose.trace.v1.traceBattery
purpose.trace.v1.aspects
purpose.trace.v1.qualityanalysis

to polcy_id = 01a0fba3-9b6e-435a-b045-e0e890c300c2

Policies

remove the following policies including the linked data

01a0fba3-9b6e-435a-b045-e0e890c300b7
01a0fba3-9b6e-435a-b045-e0e890c300b8
01a0fba3-9b6e-435a-b045-e0e890c300b9

add a check to the post endpoint to validate the value of the request to be existing in the attributes_value table for the given policy

/cc @jjeroch

@Phil91 Phil91 force-pushed the feature/68-unexpected-response-post-policy-hub-content branch from 63ff8ce to 4815d3f Compare April 17, 2024 21:09
@Phil91 Phil91 merged commit 2039af0 into eclipse-tractusx:dev Apr 17, 2024
9 checks passed
@Phil91 Phil91 deleted the feature/68-unexpected-response-post-policy-hub-content branch April 17, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants