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

Improved validation of record attributes #2071

Merged
merged 5 commits into from
Jan 13, 2023

Conversation

rmnre
Copy link
Contributor

@rmnre rmnre commented Jan 10, 2023

We ran into the issue that our generated client would throw an exception whenever a CredExRecord was deleted. The reason was the record's state parameter being set to "deleted" - a value which is not in the set of allowed values as per the swagger definition.

Changes:

  • STATE_DELETED attribute added to BaseRecord
  • added a function which lists the values of all attributes that start with a common prefix (e.g. "STATE_"), optionally including inherited attributes. The resulting list can be used for validation.

I took the occasion to clean up validation a bit (conn-, cred_ex- and pres_ex_records) and add it where it was missing (OobRecord).

@swcurran swcurran requested a review from ianco January 10, 2023 17:48
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@ianco ianco enabled auto-merge January 13, 2023 17:08
@ianco ianco merged commit aedcbd3 into openwallet-foundation:main Jan 13, 2023
@rmnre rmnre deleted the record-attribute-validation branch January 16, 2023 13:32
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