-
Notifications
You must be signed in to change notification settings - Fork 619
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid caching the credential, instead get the credential value whenev…
…er it is required through the request filter (#1712) * Avoid caching the credential, instead get the credential value whenever it is required through the request filter (ApiHeaderTokenFilter) * Fix tests * spotless * Update src/main/java/com/dabsquared/gitlabjenkins/connection/GitlabCredentialResolver.java Co-authored-by: Kris Stern <[email protected]> * Update src/main/java/com/dabsquared/gitlabjenkins/connection/GitlabCredentialResolver.java Co-authored-by: Kris Stern <[email protected]> * include imports * Update src/main/java/com/dabsquared/gitlabjenkins/connection/GitlabCredentialResolver.java Co-authored-by: Kris Stern <[email protected]> * Update src/main/java/com/dabsquared/gitlabjenkins/connection/GitlabCredentialResolver.java Co-authored-by: Kris Stern <[email protected]> --------- Co-authored-by: Aaron Echavarria <[email protected]> Co-authored-by: Kris Stern <[email protected]>
- Loading branch information
1 parent
2b3232e
commit 0ff4703
Showing
9 changed files
with
131 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/java/com/dabsquared/gitlabjenkins/connection/GitlabCredentialResolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.dabsquared.gitlabjenkins.connection; | ||
|
||
import hudson.model.Item; | ||
import org.kohsuke.accmod.Restricted; | ||
import org.kohsuke.accmod.restrictions.NoExternalUse; | ||
|
||
public class GitlabCredentialResolver { | ||
|
||
private Item item; | ||
private String credentialsId; | ||
|
||
public GitlabCredentialResolver() {} | ||
|
||
public GitlabCredentialResolver(Item item, String credentialsId) { | ||
this.item = item; | ||
this.credentialsId = credentialsId; | ||
} | ||
|
||
@Restricted(NoExternalUse.class) | ||
public Item getItem() { | ||
return item; | ||
} | ||
|
||
@Restricted(NoExternalUse.class) | ||
public void setItem(Item item) { | ||
this.item = item; | ||
} | ||
|
||
@Restricted(NoExternalUse.class) | ||
public String getCredentialsId() { | ||
return credentialsId; | ||
} | ||
|
||
@Restricted(NoExternalUse.class) | ||
public void setCredentialsId(String credentialsId) { | ||
this.credentialsId = credentialsId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.