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

Add backwards compatibility setting for token claims #349

Merged

Conversation

jamshale
Copy link
Contributor

@jamshale jamshale commented Sep 22, 2023

Add the environment variable and then add the attributes a separate key/value pairs to the claim object outside of the vc_presented_attributes object.

Set the ver_config with optional include_v1_attributes field to default False. Then when getting the claims it decides to add the attributes individually based of this ver_config setting.

This is the claim object pulled from logs when running demo.

{
'pres_req_conf_id': 'verified-email',
'acr': 'vc_authn',
'nonce': 'Y-JG5tXSWN1nplex-k653A',
'sub': '[email protected]',
'vc_presented_attributes': '{"email": "[email protected]"}',
'email': '[email protected]'
}

Resolves #347

@jamshale jamshale self-assigned this Sep 22, 2023
Base automatically changed from feature/334-unit-test-critical-code-sections to 2.0-development September 25, 2023 17:10
@jamshale jamshale marked this pull request as ready for review September 25, 2023 17:34
@jamshale jamshale force-pushed the feat/347-add-backwards-compat-setting-for-token-claims branch from ae1749b to ee42694 Compare September 26, 2023 20:27
@jamshale jamshale force-pushed the feat/347-add-backwards-compat-setting-for-token-claims branch from cb80345 to e61ebac Compare September 26, 2023 20:36
@esune
Copy link
Member

esune commented Sep 26, 2023

@jamshale before merging, just confirming you tested having an "older" release with stored configs and upgrading and it works as expected?

@jamshale
Copy link
Contributor Author

@esune I haven't ran any testing where I started a v1.0 and upgraded to v2.0. I can do that.

@esune
Copy link
Member

esune commented Sep 27, 2023

@esune I haven't ran any testing where I started a v1.0 and upgraded to v2.0. I can do that.

Sorry for the confusion, as discussed in person what I meant was 2.0 before this change and after this change. No need to test the whole upgrade from 1.0.

@jamshale
Copy link
Contributor Author

@esune Ok I tested this now and it works as expected.
The ver_config after upgrade doesn't have the include_v1_attributes field because it is optional, and it works as before. But then you can PATCH the field either as true or false and get the expected values in the attribute payload.

@esune esune merged commit a88d33b into 2.0-development Sep 27, 2023
@esune esune deleted the feat/347-add-backwards-compat-setting-for-token-claims branch September 27, 2023 16:17
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