-
Notifications
You must be signed in to change notification settings - Fork 37
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(access): allow more flexible access checks #873
Conversation
…lipse-tractusx/portal-frontend into feat/657/allow-clientid-for-rolecheck
src/components/pages/AppDetail/components/AppDetailHeader/index.tsx
Outdated
Show resolved
Hide resolved
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.
Looks good in general but as the impact of this change could be quite huge if there was some inconsistency in which client was validated updated to now: did you check the following?:
"
The following resource needs to get checked when the user access the respective page:
URL | Ressource |
---|---|
/registration | Cl1-CX-Registration |
/registration/* | Cl1-CX-Registration |
/?overlay=consent_osp | Cl1-CX-Registration |
/semantichub | Cl3-CX-Semantic |
/admin-credential | Cl24-CX-SSI-Credential-Issuer |
/usecase-participation | Cl2-CX-Portal |
/certificate-credential | Cl2-CX-Portal |
all others | Cl2-CX-Portal |
"
….com:eclipse-tractusx/portal-frontend into feat/657/allow-clientid-for-rolecheck
The logic now intersects the resourceAccess attribute from the keycloak user token with a same object securing any resource. Access is granted if the intersection is not empty which means that at least one required client+role combination has been found in the user token. Tests for this logic are here:
Those URLs are from the registration app and the check must be implemented there.
Checked for combination of Registration client id and
Looks like this overlay is not implemented any more.
plus two more uses of
all other pages are using |
src/components/pages/AppDetail/components/AppDetailHeader/index.tsx
Outdated
Show resolved
Hide resolved
src/components/pages/AdminCredential/AdminCredentialElements.tsx
Outdated
Show resolved
Hide resolved
@oyo beside the comment added to the code; one more thing
|
added
it is implemented with the check |
This comment was marked as outdated.
This comment was marked as outdated.
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.
@oyo could you please resolve the conflicts? I'd approve it then.
….com:eclipse-tractusx/portal-frontend into feat/657/allow-clientid-for-rolecheck
Quality Gate passedIssues Measures |
Description
Enable access checks with arbitrary check functions.
Why
Currently the frontend role check is only based on role name assuming the roles names are unique across clients. This assumption can be incorrect so we implemented a more flexible access check which allows to check for client id and role name. To be future-proof the mechanism now allows arbitrary checks to be executed for decision whether access is granted or not.
In the process some redundant code has been identified and removed.
Issue
#657
Checklist