-
Notifications
You must be signed in to change notification settings - Fork 7
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
Validating BNR permission for consent revocation #66
Conversation
AccountMetadataServiceImpl accountMetadataService = AccountMetadataServiceImpl.getInstance(); | ||
|
||
/* | ||
* For all the active accounts, if the user has AUTHORIZE or REVOKE permission for BNR, then the user can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User can revoke the consent only if he has authorize permission.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with e7670fa
ArrayList<String> userIDs = (ArrayList<String>) consentAdminData.getQueryParams() | ||
.get(CDSConsentExtensionConstants.USER_ID_KEY_NAME); | ||
// userIDs can be null or empty when the request comes from a CustomerCareOfficer | ||
if (userIDs != null && !userIDs.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when can there be a list of userIDs? because usually revoke is done by a single user right? If there is a scenario when a list of userIDs can come shall we add that as a comment as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is because consentAdminData.getQueryParams()
returns a Map, and and .get(<key>)
returns an array list. That doesn't mean that we can have multiple userIDs for revoke. Since ConsentAdminData
is a common class we cannot change that behaviour for revoke only.
For this scenario (revoking a consent from consent manager) we only have 1 user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was already a validateAndGetQueryParam
method to get the first element from query params. Modified with bc8b123
Validating BNR permission for consent revocation
Issue:
Applicable Labels: OB3 CDS Toolkit
Development Checklist
Testing Checklist
Automation Test Details
Conformance Tests Details
Resources
Knowledge Base: https://sites.google.com/wso2.com/open-banking/
Guides: https://sites.google.com/wso2.com/open-banking/developer-guides