Skip to content
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

Fix Credentiallookup and HTTPS pom #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,23 @@
*/
public class CodeCommitURLHelper extends GitSCMExtension {
private String credentialId;
private String repositoryName;

@DataBoundConstructor
public CodeCommitURLHelper(String credentialId, String repositoryName) {
this.credentialId = credentialId;
this.repositoryName = repositoryName;
}

public String getCredentialId() {
return this.credentialId;
}

public String getRepositoryName() {
return this.repositoryName;
}


private static final class RepositoryUsernameReference {
private final UsernamePasswordCredentialsImpl credential;

Expand Down Expand Up @@ -199,15 +210,20 @@ public String getDisplayName() {

public AbstractIdCredentialsListBoxModel<?, ?> doFillCredentialIdItems(
@AncestorInPath Item owner) {
if (owner == null || !owner.hasPermission(Item.CONFIGURE)) {

if (owner != null && !owner.hasPermission(Item.CONFIGURE)) {
return new AWSCredentialsListBoxModel();
}

List<AmazonWebServicesCredentials>
creds =
CredentialsProvider
List<AmazonWebServicesCredentials> creds;
if (owner == null) {
// no owner (e.g. no Job), this happens on the "Configure System" page when adding a Global Library
creds = CredentialsProvider.lookupCredentials(AmazonWebServicesCredentials.class);
} else {
creds = CredentialsProvider
.lookupCredentials(AmazonWebServicesCredentials.class, owner, ACL.SYSTEM,
Collections.<DomainRequirement>emptyList());
}

return new AWSCredentialsListBoxModel()
.withEmptySelection()
Expand All @@ -228,4 +244,3 @@ protected String describe(@NonNull AmazonWebServicesCredentials c) {
}
}
}