Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
b9022fe
The username in a UsernamePasswordMultiBinding should not be consider…
Stovoy Aug 15, 2017
6616629
Resolves issues in previous commit from PR #44
henrist Jul 13, 2018
506c651
Add positive test for username and fix test log output
henrist Jul 13, 2018
fcd36ce
Set serialVersionUID for MultiEnvironment
henrist Jul 14, 2018
41ee17d
Bump plugin from 4.15 to 4.16
dependabot[bot] Feb 8, 2021
72449a6
Bump authorize-project from 1.3.0 to 1.4.0
dependabot[bot] Mar 15, 2021
37bc6f3
Bump plugin from 4.16 to 4.17
dependabot[bot] Mar 15, 2021
691690c
Bump plugin from 4.17 to 4.18
dependabot[bot] Apr 19, 2021
c4ea5aa
[JENKINS-65398] Terminology update
twasyl Apr 19, 2021
b4e5ad4
Merge pull request #127 from jenkinsci/dependabot/maven/org.jenkins-c…
jglick Apr 20, 2021
be6a222
Apply suggestions from code review
twasyl Apr 20, 2021
b8484d8
`maven-windows` agents seem broken
jglick Apr 26, 2021
3d8beb3
Merge pull request #129 from jglick/windows
jglick Apr 26, 2021
14604a1
Merge pull request #128 from twasyl/JENKINS-65398
jvz Apr 26, 2021
9fd5ab5
Improve interpolation documentation and changelog references
daniel-beck May 3, 2021
b19273d
Merge pull request #130 from jenkinsci/daniel-beck-patch-1
jglick May 3, 2021
7ecd5a4
Merge branch 'master' of https://github.com/jenkinsci/credentials-bin…
jglick May 3, 2021
dc6f381
Updated to 2.235.x
jglick May 3, 2021
3c67655
Merge pull request #125 from jenkinsci/dependabot/maven/org.jenkins-c…
jglick May 3, 2021
b18f91c
Merge branch 'master' of https://github.com/jenkinsci/credentials-bin…
jglick May 3, 2021
61be7c3
Merge branch 'master' of https://github.com/jenkinsci/credentials-bin…
jglick May 3, 2021
c9f6efe
Verify that `secretValues` and `publicValues` do not intersect
jglick May 3, 2021
20044b5
Making new behavior opt-in via `showUsername` field
jglick May 3, 2021
9e330b0
When `!showUsername`, retain order `usernameVariable` then `passwordV…
jglick May 3, 2021
c838e6f
Minimize diff in `BindingStep`
jglick May 3, 2021
58de8ca
[JENKINS-44860] Honor secret setting for username
jglick May 6, 2021
6efdc19
Masking message from `BindingStep` incorrectly named nonsecret keys
jglick May 6, 2021
8cf5a0e
Merge branch 'show-username-JENKINS-44860' into show-username-JENKINS…
jglick May 6, 2021
e75b52b
Adjusted `BindingStepTest.basics` to match
jglick May 6, 2021
a9c68b7
Bump
jglick May 6, 2021
4fe1b94
Javadoc fix
jglick May 6, 2021
8a4eed4
Bump bom-2.235.x from 29 to 807.v6d348e44c987
dependabot[bot] May 10, 2021
015c614
Merge pull request #133 from jenkinsci/dependabot/maven/io.jenkins.to…
jglick May 10, 2021
cd75e64
Bump bom-2.235.x from 807.v6d348e44c987 to 831.v9814430e6383
dependabot[bot] May 24, 2021
44637ea
Merge pull request #134 from jenkinsci/dependabot/maven/io.jenkins.to…
jglick May 24, 2021
7bf36da
Bump plugin from 4.18 to 4.19
dependabot[bot] May 31, 2021
0f8ff9f
Merge pull request #135 from jenkinsci/dependabot/maven/org.jenkins-c…
jglick Jun 1, 2021
5eba5f6
Merge branch 'master' of https://github.com/jenkinsci/credentials-bin…
jglick Jun 2, 2021
cb242b0
`credentials` 2.5 released
jglick Jun 2, 2021
eb36486
Merge pull request #132 from jglick/show-username-JENKINS-44860-alt
jglick Jun 2, 2021
78639db
[maven-release-plugin] prepare release credentials-binding-1.25
jglick Jun 2, 2021
e6d4481
[maven-release-plugin] prepare for next development iteration
jglick Jun 2, 2021
2e86a27
Bump bom-2.235.x from 831.v9814430e6383 to 841.vd6e713d848ab
dependabot[bot] Jun 7, 2021
a84e243
No longer need to override `credentials` version
jglick Jun 7, 2021
4ad1fc7
Trying to adapt to https://github.com/jenkinsci/durable-task-plugin/p…
jglick Jun 22, 2021
65272cb
https://github.com/jenkinsci/credentials-binding-plugin/pull/136#disc…
jglick Jun 23, 2021
616f8ae
Merge pull request #136 from jenkinsci/dependabot/maven/io.jenkins.to…
jglick Jun 23, 2021
bd9f4f6
Bump bom-2.235.x from 841.vd6e713d848ab to 872.v03c18fa35487
dependabot[bot] Jun 23, 2021
fcac190
Merge pull request #137 from jenkinsci/dependabot/maven/io.jenkins.to…
jglick Jun 23, 2021
9e85ee3
Use `LineTransformationOutputStream.Delegating`
jglick Jun 23, 2021
d235e55
Merge pull request #138 from jglick/LineTransformationOutputStream.De…
jglick Jun 23, 2021
9cc0b87
Introduced `MaskingOutputStream` to DRY between Pipeline & freestyle
jglick Jun 23, 2021
958f395
Expose `SecretPatterns` as an API
jglick Jun 23, 2021
6dc28f0
`SecretBuildWrapper` needs to initialize its pattern lazily
jglick Jun 23, 2021
615d236
Merge pull request #139 from jglick/MaskingOutputStream
jglick Jun 23, 2021
86e2ee7
[maven-release-plugin] prepare release credentials-binding-1.26
jglick Jun 23, 2021
b625041
[maven-release-plugin] prepare for next development iteration
jglick Jun 23, 2021
a3b593f
Bump bom-2.235.x from 872.v03c18fa35487 to 887.vae9c8ac09ff7
dependabot[bot] Jun 28, 2021
bd0f011
Merge pull request #140 from jenkinsci/dependabot/maven/io.jenkins.to…
jglick Jun 28, 2021
51ee655
[JENKINS-64361] Make fix for JENKINS-44860 apply to Pipeline step arg…
dwnusbaum Jul 1, 2021
3ccdd7e
[JENKINS-64631] Make Overrider.secretKeys serializable when initializ…
dwnusbaum Jul 1, 2021
b4800dc
Bump git-changelist-maven-extension from 1.0-beta-7 to 1.2
dependabot[bot] Jul 5, 2021
543b13d
Merge pull request #142 from jenkinsci/dependabot/maven/io.jenkins.to…
jglick Jul 6, 2021
cb1f084
Refactor `Overridder` to take `overrides` + `publicOverrides`
jglick Jul 12, 2021
c36a486
Rename `SSHUserPrivateKeyTest` to `SSHUserPrivateKeyBindingTest` to m…
jglick Jul 12, 2021
fde8db9
Unused initializer
jglick Jul 12, 2021
86269f1
Do not suggest `passphraseVariable: , usernameVariable: ` in snippet …
jglick Jul 12, 2021
824c0c9
Merge pull request #143 from jglick/JENKINS-64631-amendment
jglick Jul 12, 2021
535900d
Merge pull request #144 from jglick/null-hygiene
jglick Jul 12, 2021
5146664
[maven-release-plugin] prepare release credentials-binding-1.27
jglick Jul 12, 2021
a892158
[maven-release-plugin] prepare for next development iteration
jglick Jul 12, 2021
3c0d8fb
Use java.nio.charset.StandardCharsets where possible
basil Jul 23, 2021
3d55c13
Bump plugin from 4.19 to 4.21
dependabot[bot] Jul 26, 2021
65d2273
Merge pull request #147 from jenkinsci/dependabot/maven/org.jenkins-c…
jglick Jul 26, 2021
1033ff6
Bump bom-2.235.x from 887.vae9c8ac09ff7 to 918.vae501d2cdc99
dependabot[bot] Aug 2, 2021
9a278dd
Bump plugin from 4.21 to 4.24
dependabot[bot] Aug 2, 2021
892fcb1
Merge pull request #149 from jenkinsci/dependabot/maven/org.jenkins-c…
jglick Aug 2, 2021
5d15471
Merge pull request #148 from jenkinsci/dependabot/maven/io.jenkins.to…
jglick Aug 2, 2021
fdf3f8c
Refactor and simplify some code.
offa Sep 3, 2021
053a61d
Remove unused imports and exception declarations.
offa Sep 3, 2021
dc157da
Remove deprecated API usages.
offa Sep 3, 2021
fcd2205
Fix nullability issues; remove JSR305.
offa Sep 3, 2021
a36967e
Remove start imports.
offa Sep 3, 2021
7c31c40
Bump plugin from 4.24 to 4.25
dependabot[bot] Sep 13, 2021
a07903f
Bump plugin from 4.25 to 4.28
dependabot[bot] Oct 11, 2021
819b9c2
Merge pull request #153 from jenkinsci/dependabot/maven/org.jenkins-c…
dependabot[bot] Oct 11, 2021
1a175d6
Bump plugin from 4.28 to 4.29
dependabot[bot] Oct 18, 2021
6cbad63
Bump xmlunit-matchers from 2.8.2 to 2.8.3
dependabot[bot] Oct 18, 2021
07564b6
Merge pull request #145 from basil/charsets
jglick Oct 18, 2021
af56706
Merge branch 'master' into dev
jglick Oct 18, 2021
c2164af
Replace UTF-8 with default charset
offa Oct 19, 2021
d7c8db9
Use FileUtils instead of stream
offa Oct 19, 2021
75eef26
Revert changes related to AbstractStep
offa Oct 19, 2021
dc46e87
Use WorkspaceList.tempDir
offa Oct 19, 2021
7cbc6fe
Merge pull request #150 from offa/dev
jglick Oct 19, 2021
823faba
Merge pull request #156 from offa/workspace_tempdir
jglick Oct 21, 2021
bfd39ca
Bump plugin from 4.29 to 4.31
dependabot[bot] Nov 15, 2021
2dd5eda
[SECURITY-2342]
Wadeck Dec 20, 2021
c8eedda
Bump xmlunit-matchers from 2.8.3 to 2.8.4
dependabot[bot] Dec 20, 2021
b79eaa7
[maven-release-plugin] prepare release credentials-binding-1.27.1
Wadeck Dec 20, 2021
c57509e
[maven-release-plugin] prepare for next development iteration
Wadeck Dec 20, 2021
8b9406c
Bump git-changelist-maven-extension from 1.2 to 1.3
dependabot[bot] Jan 3, 2022
4a259df
Bump plugin from 4.31 to 4.32
dependabot[bot] Dec 27, 2021
6d3a687
Update parent, baseline, BOM
jglick Jan 10, 2022
6889c42
Merge pull request #163 from jglick/deps
jglick Jan 10, 2022
11ea6fd
Merge remote-tracking branch 'origin/1.27.x'
Wadeck Jan 12, 2022
5c03e87
Bump xmlunit-matchers from 2.8.4 to 2.9.0
dependabot[bot] Jan 31, 2022
b3771ec
Bump plugin from 4.33 to 4.34
dependabot[bot] Feb 14, 2022
2827d33
Bump plugin from 4.34 to 4.35
dependabot[bot] Feb 21, 2022
af5371c
Bump plugin from 4.35 to 4.37
dependabot[bot] Feb 28, 2022
c98820f
Bump plugin from 4.37 to 4.38
dependabot[bot] Mar 21, 2022
a514a6f
Integration test of `Credentials.forRun`
jglick Mar 23, 2022
24d634e
https://github.com/jenkinsci/credentials-plugin/pull/293 released
jglick Mar 26, 2022
4ea3eca
Merge pull request #169 from jglick/Credentials.forRun
jglick Mar 26, 2022
a2f03e6
Bump plugin from 4.38 to 4.39
dependabot[bot] Apr 4, 2022
915a692
Bump bom-2.319.x from 1210.vcd41f6657f03 to 1246.va_b_50630c1d19
dependabot[bot] Apr 4, 2022
0f3f165
Update POM & BOM, test on Java 17
jglick Apr 18, 2022
478792e
Merge pull request #175 from jglick/bumps
jglick Apr 18, 2022
0af51f7
Enable CD
jglick Apr 21, 2022
d859a4b
Merge pull request #176 from jglick/cd
jglick Apr 21, 2022
a1fd6a2
Bump bom-2.319.x from 1280.vd669827e38cd to 1289.v5c4b_1c43511b_ (#177)
dependabot[bot] Apr 21, 2022
e3a1819
Bump bom-2.319.x from 1289.v5c4b_1c43511b_ to 1342.v729ca_3818e88
dependabot[bot] May 2, 2022
b5db8bb
Merge pull request #178 from jenkinsci/dependabot/maven/io.jenkins.to…
dependabot[bot] May 2, 2022
eac4b29
[JENKINS-26398] Use standard `JenkinsRule.createSlave`
jglick May 2, 2022
77e8c8d
Incremental build
jglick May 2, 2022
b5175eb
https://github.com/jenkinsci/jenkins-test-harness/pull/428 released
jglick May 2, 2022
e81dab7
Bump bom-2.319.x from 1342.v729ca_3818e88 to 1362.v59f2f3db_80ee
dependabot[bot] May 9, 2022
2cdfe02
Merge pull request #180 from jenkinsci/dependabot/maven/io.jenkins.to…
dependabot[bot] May 9, 2022
4899e31
Bump bom-2.319.x from 1362.v59f2f3db_80ee to 1382.v7d694476f340
dependabot[bot] May 16, 2022
8082ea0
Merge pull request #182 from jenkinsci/dependabot/maven/io.jenkins.to…
dependabot[bot] May 17, 2022
7c98d77
Bump bom-2.319.x from 1382.v7d694476f340 to 1409.v7659b_c072f18
dependabot[bot] May 30, 2022
f1489da
Merge pull request #184 from jenkinsci/dependabot/maven/io.jenkins.to…
dependabot[bot] Jun 1, 2022
01075a7
chore: use jenkins infra maven cd reusable workflow
jetersen Jun 14, 2022
749bab7
Bump bom-2.319.x from 1409.v7659b_c072f18 to 1438.v6a_2c29d73f82
dependabot[bot] Jun 20, 2022
decc7fd
Bump plugin from 4.40 to 4.41
dependabot[bot] Jun 27, 2022
f539476
Bump bom-2.319.x from 1438.v6a_2c29d73f82 to 1451.v15f1fdb_772a_f
dependabot[bot] Jun 27, 2022
88951d1
Bump bom-2.319.x from 1451.v15f1fdb_772a_f to 1466.v85a_616ea_b_87c
dependabot[bot] Jul 4, 2022
c30613d
Bump bom-2.319.x from 1466.v85a_616ea_b_87c to 1478.v81d3dc4f9a_43
dependabot[bot] Jul 11, 2022
0add44d
Bump plugin from 4.41 to 4.42
dependabot[bot] Jul 11, 2022
1e41eda
Bump plugin from 4.42 to 4.43.1
dependabot[bot] Jul 18, 2022
b21b9e3
Bump git-changelist-maven-extension from 1.3 to 1.4
dependabot[bot] Jul 25, 2022
c0eb511
Bump bom-2.319.x from 1478.v81d3dc4f9a_43 to 1508.v4b_d09ff0e893
dependabot[bot] Jul 25, 2022
4372d17
Bump plugin from 4.43.1 to 4.45
dependabot[bot] Aug 1, 2022
516f6e1
Bump bom-2.319.x from 1508.v4b_d09ff0e893 to 1556.vfc6a_f216e3c6
dependabot[bot] Aug 1, 2022
f31d568
2.319.3
jglick Aug 1, 2022
1dba52e
Bump plugin from 4.45 to 4.47
dependabot[bot] Aug 29, 2022
1ca09a2
Bump bom-2.319.x from 1556.vfc6a_f216e3c6 to 1607.va_c1576527071
dependabot[bot] Aug 29, 2022
734f105
Merge pull request #204 from jenkinsci/dependabot/maven/io.jenkins.to…
dependabot[bot] Aug 29, 2022
5541a7f
Merge pull request #203 from jenkinsci/dependabot/maven/org.jenkins-c…
dependabot[bot] Aug 29, 2022
ecd43c9
Bump plugin from 4.47 to 4.48
dependabot[bot] Oct 3, 2022
bac774e
Merge pull request #185 from jetersen/chore/maven-cd-reusable-workflow
jglick Oct 4, 2022
0d357c6
Merge pull request #206 from jenkinsci/dependabot/maven/org.jenkins-c…
dependabot[bot] Oct 4, 2022
0dc4002
Merge branch 'master' of https://github.com/jenkinsci/credentials-bin…
jglick Oct 13, 2022
4ca5d8a
Need to quote path on Windows, too
jglick Oct 13, 2022
ba6ecb7
Merge pull request #179 from jglick/agents-JENKINS-26398
jglick Oct 13, 2022
c3db08d
Bump bom-2.319.x from 1607.va_c1576527071 to 1643.v1cffef51df73
dependabot[bot] Oct 17, 2022
4b24487
Merge pull request #207 from jenkinsci/dependabot/maven/io.jenkins.to…
dependabot[bot] Oct 17, 2022
2d76e29
Bump xmlunit-matchers from 2.9.0 to 2.9.1
dependabot[bot] Jan 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ updates:
open-pull-requests-limit: 10
reviewers:
- jglick
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
1 change: 0 additions & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
_extends: .github
tag-template: credentials-binding-$NEXT_MINOR_VERSION
15 changes: 15 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins

name: cd
on:
workflow_dispatch:
check_run:
types:
- completed

jobs:
maven-cd:
uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1
secrets:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
target/
work*/
work/

# IntelliJ project files
*.iml
Expand Down
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.0-beta-7</version>
<version>1.4</version>
</extension>
</extensions>
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
-Pconsume-incrementals
-Pmight-produce-incrementals
-Dchangelist.format=%d.v%s
5 changes: 4 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
buildPlugin(useAci: true)
buildPlugin(useContainerAgent: true, configurations: [
[platform: 'linux', jdk: '17', jenkins: '2.343'],
[platform: 'windows', jdk: '8'],
])
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ withCredentials([usernamePassword(credentialsId: 'amazon', usernameVariable: 'US
You should use a single quote (`'`) instead of a double quote (`"`) whenever you can.
This is particularly important in Pipelines where a statement may be interpreted by both the Pipeline engine and an external interpreter, such as a Unix shell (`sh`) or Windows Command (`bat`) or Powershell (`ps`).
This reduces complications with password masking and command processing.
The first step in the above example properly demonstrates this.
The next two steps use the basic Pipeline `echo` step.
The first one references the Groovy variable and needs no quotes.
The second one needs to use double quotes, so that the interpolation is performed in Groovy.
The first step in the above example properly demonstrates this.
It references an environment variable, so the single-quoted string passes its value unprocessed to the `sh` step, and the shell interprets `$PASSWORD`.
The next two steps use the basic Pipeline `echo` step.
The last one needs to use double quotes, so that the [string interpolation](https://en.wikipedia.org/wiki/String_interpolation) is performed by the Pipeline DSL.

For more information, see the Pipeline step reference for [Credentials Binding Plugin](https://www.jenkins.io/doc/pipeline/steps/credentials-binding/).

## Changelog

See [GitHub Releases](https://github.com/jenkinsci/credentials-binding-plugin/releases) for new releases,
or the [old changelog](old-changelog.md) for history.
See [GitHub Releases](https://github.com/jenkinsci/credentials-binding-plugin/releases) for new releases (version 1.20 and newer),
or the [old changelog](old-changelog.md) for history (version 1.19 and earlier).
34 changes: 14 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,20 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.15</version>
<version>4.48</version>
<relativePath />
</parent>

<artifactId>credentials-binding</artifactId>
<version>${revision}${changelist}</version>
<version>${changelist}</version>
<packaging>hpi</packaging>

<name>Credentials Binding Plugin</name>
<description>Allows credentials to be bound to environment variables for use from miscellaneous build steps.
</description>
<url>https://github.com/jenkinsci/credentials-binding-plugin</url>
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
<properties>
<revision>1.25</revision>
<changelist>-SNAPSHOT</changelist>
<jenkins.version>2.176.4</jenkins.version>
<java.level>8</java.level>
<workflow-step-api.version>2.23</workflow-step-api.version> <!-- TODO: Delete when in BOM -->
<changelist>999999-SNAPSHOT</changelist>
<jenkins.version>2.319.3</jenkins.version>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
</properties>
<licenses>
<license>
Expand All @@ -31,10 +27,10 @@
</license>
</licenses>

<scm>
<connection>scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
<developerConnection>scm:git:git@github.com:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
<connection>scm:git:https://github.com/${gitHubRepo}</connection>
<developerConnection>scm:git:https://github.com/${gitHubRepo}</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
</scm>

Expand All @@ -55,8 +51,8 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.176.x</artifactId>
<version>16</version>
<artifactId>bom-2.319.x</artifactId>
<version>1643.v1cffef51df73</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand All @@ -74,7 +70,6 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>${workflow-step-api.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down Expand Up @@ -113,7 +108,6 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>${workflow-step-api.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
Expand All @@ -131,13 +125,13 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>authorize-project</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-matchers</artifactId>
<version>2.8.2</version>
<version>2.9.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down
23 changes: 11 additions & 12 deletions src/main/java/org/jenkinsci/plugins/credentialsbinding/Binding.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

import com.cloudbees.plugins.credentials.common.StandardCredentials;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.FilePath;
import hudson.Launcher;
Expand All @@ -34,9 +36,6 @@
import hudson.model.BuildListener;
import java.io.IOException;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import hudson.model.Run;
import hudson.model.TaskListener;
import java.util.Collections;
Expand Down Expand Up @@ -93,7 +92,7 @@ public interface Environment {

@Deprecated
@SuppressWarnings("rawtypes")
public Environment bind(@Nonnull final AbstractBuild build, final Launcher launcher, final BuildListener listener) throws IOException, InterruptedException {
public Environment bind(@NonNull final AbstractBuild build, final Launcher launcher, final BuildListener listener) throws IOException, InterruptedException {
final SingleEnvironment e = bindSingle(build, build.getWorkspace(), launcher, listener);
return new Environment() {
@Override public String value() {
Expand All @@ -113,10 +112,10 @@ public Environment bind(@Nonnull final AbstractBuild build, final Launcher launc
* @param listener The task listener. Cannot be null.
* @return The configured {@link SingleEnvironment}
*/
public /* abstract */SingleEnvironment bindSingle(@Nonnull Run<?,?> build,
public /* abstract */SingleEnvironment bindSingle(@NonNull Run<?,?> build,
@Nullable FilePath workspace,
@Nullable Launcher launcher,
@Nonnull TaskListener listener) throws IOException, InterruptedException {
@NonNull TaskListener listener) throws IOException, InterruptedException {
if (Util.isOverridden(Binding.class, getClass(), "bind", AbstractBuild.class, Launcher.class, BuildListener.class) && build instanceof AbstractBuild && listener instanceof BuildListener) {
Environment e = bind((AbstractBuild) build, launcher, (BuildListener) listener);
return new SingleEnvironment(e.value(), new UnbinderWrapper(e));
Expand All @@ -134,29 +133,29 @@ private static class UnbinderWrapper implements Unbinder {
UnbinderWrapper(Environment e) {
this.e = e;
}
@Override public void unbind(@Nonnull Run<?, ?> build,
@Override public void unbind(@NonNull Run<?, ?> build,
@Nullable FilePath workspace,
@Nullable Launcher launcher,
@Nonnull TaskListener listener) throws IOException, InterruptedException {
@NonNull TaskListener listener) throws IOException, InterruptedException {
e.unbind();
}
}


@Override public final MultiEnvironment bind(@Nonnull Run<?,?> build,
@Override public final MultiEnvironment bind(@NonNull Run<?,?> build,
@Nullable FilePath workspace,
@Nullable Launcher launcher,
@Nonnull TaskListener listener) throws IOException, InterruptedException {
@NonNull TaskListener listener) throws IOException, InterruptedException {
SingleEnvironment single = bindSingle(build, workspace, launcher, listener);
return new MultiEnvironment(Collections.singletonMap(variable, single.value), single.unbinder);
}

@Override public final Set<String> variables() {
@Override public final Set<String> variables(@NonNull Run<?, ?> build) {
return Collections.singleton(variable);
}

@Deprecated
protected final @Nonnull C getCredentials(@Nonnull AbstractBuild<?,?> build) throws IOException {
protected final @NonNull C getCredentials(@NonNull AbstractBuild<?,?> build) throws IOException {
return super.getCredentials(build);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.common.AbstractIdCredentialsListBoxModel;
import com.cloudbees.plugins.credentials.common.StandardCredentials;
import com.cloudbees.plugins.credentials.domains.DomainRequirement;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.model.Descriptor;
import hudson.model.Item;
import hudson.security.ACL;
Expand Down Expand Up @@ -60,12 +60,14 @@ public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item owner) {
// when configuring the job, you only want those credentials that are available to ACL.SYSTEM selectable
// as we cannot select from a user's credentials unless they are the only user submitting the build
// (which we cannot assume) thus ACL.SYSTEM is correct here.
return new Model().withAll(CredentialsProvider.lookupCredentials(type(), owner, ACL.SYSTEM, Collections.<DomainRequirement>emptyList()));
return new Model().withAll(CredentialsProvider.lookupCredentials(type(), owner, ACL.SYSTEM, Collections.emptyList()));
}

private final class Model extends AbstractIdCredentialsListBoxModel<Model,C> {

@Override protected String describe(C c) {
@NonNull
@Override
protected String describe(@NonNull C c) {
return CredentialsNameProvider.name(c);
}

Expand Down
Loading