Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-41004

Credentials Binding does not guarantee folder credential with a given ID will be returned over global credential with same ID

    Details

    • Similar Issues:

      Description

      So starting with credentials 1.28 and https://github.com/jenkinsci/credentials-plugin/commit/68dc8c9607ec66f474824ec0489a38c205bfdd18, the list of credentials returned by CredentialsProvider.lookupCredentials is now sorted alphabetically. That means that if you've got multiple providers supplying different credentials for the same ID, CredentialsProvider.findCredentialsById will return the first of those in alphabetical order. The result of this is that you don't necessarily get, say, the folder credential instead of the global credential, if the names are different. This...seems wrong to me.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          pom.xml
          src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
          src/test/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProviderTest.java
          http://jenkins-ci.org/commit/cloudbees-folder-plugin/ff0c53014c346dac3d891b150b0234c9c4c29c53
          Log:
          Merge pull request #83 from stephenc/jenkins-41004

          JENKINS-41004 Do not report credentials with IDs masked by nearer folders

          Compare: https://github.com/jenkinsci/cloudbees-folder-plugin/compare/0776cd4b2960...ff0c53014c34

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: pom.xml src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java src/test/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProviderTest.java http://jenkins-ci.org/commit/cloudbees-folder-plugin/ff0c53014c346dac3d891b150b0234c9c4c29c53 Log: Merge pull request #83 from stephenc/jenkins-41004 JENKINS-41004 Do not report credentials with IDs masked by nearer folders Compare: https://github.com/jenkinsci/cloudbees-folder-plugin/compare/0776cd4b2960...ff0c53014c34
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
          http://jenkins-ci.org/commit/cloudbees-folder-plugin/ae55e47f3a5ca8e5bd0f5dc6871d1507b6b8049f
          Log:
          JENKINS-41004 Code review comments

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java http://jenkins-ci.org/commit/cloudbees-folder-plugin/ae55e47f3a5ca8e5bd0f5dc6871d1507b6b8049f Log: JENKINS-41004 Code review comments
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          pom.xml
          src/test/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProviderTest.java
          http://jenkins-ci.org/commit/cloudbees-folder-plugin/244d3a5ab4d9702614076b21d7b8a142fd50f2b3
          Log:
          JENKINS-41004 Add tests that verify correct sequencing of resolution

          • Also need to bump credentials plugin to 2.1.11 to ensure that the stores are identified in the correct sequence
          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: pom.xml src/test/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProviderTest.java http://jenkins-ci.org/commit/cloudbees-folder-plugin/244d3a5ab4d9702614076b21d7b8a142fd50f2b3 Log: JENKINS-41004 Add tests that verify correct sequencing of resolution Also need to bump credentials plugin to 2.1.11 to ensure that the stores are identified in the correct sequence
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
          http://jenkins-ci.org/commit/cloudbees-folder-plugin/4d936139c54bdc66fd5b0ad3600f64fa502c9fca
          Log:
          JENKINS-41004 Remove effectively duplicate code

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java http://jenkins-ci.org/commit/cloudbees-folder-plugin/4d936139c54bdc66fd5b0ad3600f64fa502c9fca Log: JENKINS-41004 Remove effectively duplicate code
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java
          http://jenkins-ci.org/commit/cloudbees-folder-plugin/1b1ddb6c248e19ee4db275292fd59a4cbac4942d
          Log:
          JENKINS-41004 Remove effectively duplicate code check

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider.java http://jenkins-ci.org/commit/cloudbees-folder-plugin/1b1ddb6c248e19ee4db275292fd59a4cbac4942d Log: JENKINS-41004 Remove effectively duplicate code check

            People

            • Assignee:
              stephenconnolly Stephen Connolly
              Reporter:
              abayer Andrew Bayer
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: