-
Notifications
You must be signed in to change notification settings - Fork 110
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
Listing credentials authorisation check #222
base: master
Are you sure you want to change the base?
Listing credentials authorisation check #222
Conversation
Signed-off-by: Yann Rosema <[email protected]>
Signed-off-by: Yann Rosema <[email protected]>
Signed-off-by: Yann Rosema <[email protected]>
Signed-off-by: Yann Rosema <[email protected]>
Signed-off-by: Yann Rosema <[email protected]>
} | ||
if (itemGroup instanceof AbstractFolder) { | ||
final AbstractFolder<?> folder = AbstractFolder.class.cast(itemGroup); | ||
if (folder.hasPermission(authentication, CredentialsProvider.USE_ITEM)) { |
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.
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)
if (folder.hasPermission(authentication, CredentialsProvider.USE_ITEM)) { | |
if (folder.hasPermission(authentication, CredentialsProvider.USE_ITEM) || folder.hasPermission(authentication, Item.CONFIGURE)) { |
@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")?
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.
Hi, I'm assuming we're waiting for @daniel-beck 's response on this. Is there any indication on when we can expect that?
src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
Outdated
Show resolved
Hide resolved
Co-authored-by: James Nord <[email protected]>
There is a comment in this Github issue detailing the problem this pull requests tries to fix.
It comes down to adding a check to the getCredentials method to check if the user requesting the credentials is permitted to use the credentials of a provider.
Proposed changelog entries
CredentialsProvider.USE_ITEM
permission.Submitter checklist
* Use the
Internal:
prefix if the change has no user-visible impact (API, test frameworks, etc.)