-
-
Notifications
You must be signed in to change notification settings - Fork 117
Listing credentials authorisation check #222
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
base: master
Are you sure you want to change the base?
Changes from 6 commits
709d1e5
9c98457
2e83c3c
1f176f4
a7f3d13
cc3ab75
c39dd2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -122,7 +122,20 @@ public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @N | |||||
| @NonNull List<DomainRequirement> domainRequirements) { | ||||||
| List<C> result = new ArrayList<>(); | ||||||
| Set<String> ids = new HashSet<>(); | ||||||
|
|
||||||
| // Check if Authentication is authorised to list the credentials | ||||||
| Boolean isAuthorised = false; | ||||||
| if (ACL.SYSTEM.equals(authentication)) { | ||||||
| isAuthorised = true; | ||||||
| } | ||||||
| if (itemGroup instanceof AbstractFolder) { | ||||||
|
ChampiYann marked this conversation as resolved.
Outdated
|
||||||
| final AbstractFolder<?> folder = AbstractFolder.class.cast(itemGroup); | ||||||
| if (folder.hasPermission(authentication, CredentialsProvider.USE_ITEM)) { | ||||||
| isAuthorised = true; | ||||||
| } | ||||||
| } | ||||||
| // Get credentials | ||||||
| if (Boolean.TRUE.equals(isAuthorised)) { | ||||||
|
ChampiYann marked this conversation as resolved.
Outdated
|
||||||
| while (itemGroup != null) { | ||||||
| if (itemGroup instanceof AbstractFolder) { | ||||||
| final AbstractFolder<?> folder = AbstractFolder.class.cast(itemGroup); | ||||||
|
|
@@ -178,7 +191,20 @@ public <C extends IdCredentials> ListBoxModel getCredentialIds(@NonNull Class<C> | |||||
| @NonNull CredentialsMatcher matcher) { | ||||||
| ListBoxModel result = new ListBoxModel(); | ||||||
| Set<String> ids = new HashSet<>(); | ||||||
|
|
||||||
| // Check if Authentication is authorised to list the credentials | ||||||
| Boolean isAuthorised = false; | ||||||
|
ChampiYann marked this conversation as resolved.
Outdated
|
||||||
| if (ACL.SYSTEM.equals(authentication)) { | ||||||
| isAuthorised = true; | ||||||
| } | ||||||
| if (itemGroup instanceof AbstractFolder) { | ||||||
|
ChampiYann marked this conversation as resolved.
Outdated
|
||||||
| final AbstractFolder<?> folder = AbstractFolder.class.cast(itemGroup); | ||||||
| if (folder.hasPermission(authentication, CredentialsProvider.USE_ITEM)) { | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should allow for listing credentials if the user can also configure the itemgroup (as they may be able to select a credential that the system (not they themselves) will use later (note the follow syntax has not been checked)
Suggested change
@daniel-beck I always have to double think this - but for listing the credential IDs it should be you have configure on the item, or the ability to use a credntials. (configure so you can select a credential that the job/system can use even if you can not use it, USE_ITEM incase you can not configure the job (e.g. for the pipeline snippet generator at the job level and the pipeline is "as-code")?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, I'm assuming we're waiting for @daniel-beck 's response on this. Is there any indication on when we can expect that? |
||||||
| isAuthorised = true; | ||||||
| } | ||||||
| } | ||||||
| // Get credentials | ||||||
| if (Boolean.TRUE.equals(isAuthorised)) { | ||||||
|
ChampiYann marked this conversation as resolved.
Outdated
|
||||||
| while (itemGroup != null) { | ||||||
| if (itemGroup instanceof AbstractFolder) { | ||||||
| final AbstractFolder<?> folder = AbstractFolder.class.cast(itemGroup); | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.