Skip to content
Draft
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 @@ -68,8 +68,8 @@
<changelist>999999-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.504</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
<jenkins.baseline>2.528</jenkins.baseline>
<jenkins.version>2.544</jenkins.version>
<ban-junit4-imports.skip>false</ban-junit4-imports.skip>
<hpi.compatibleSinceVersion>1372</hpi.compatibleSinceVersion>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
import com.cloudbees.plugins.credentials.domains.Domain;
import com.cloudbees.plugins.credentials.domains.DomainSpecification;
import com.cloudbees.plugins.credentials.impl.BaseStandardCredentials;
import com.cloudbees.plugins.credentials.links.MoveCredentialsLink;
import com.cloudbees.plugins.credentials.links.NewCredentialsLink;
import com.cloudbees.plugins.credentials.links.NewDomainLink;
import com.cloudbees.plugins.credentials.links.UpdateCredentialsLink;
import com.cloudbees.plugins.credentials.links.UpdateDomainLink;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
Expand Down Expand Up @@ -84,6 +89,7 @@
import org.apache.commons.lang3.StringUtils;
import org.jenkins.ui.icon.IconSpec;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.DoNotUse;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.HttpResponse;
Expand Down Expand Up @@ -509,77 +515,92 @@
getACL().checkPermission(permission);
}

@Restricted(DoNotUse.class) // jelly
public NewDomainLink getNewDomainLink() {
return new NewDomainLink();
}

/**
* {@inheritDoc}
*/
@Override
public boolean hasPermission(@NonNull Permission permission) {
return getACL().hasPermission(permission);
}

/**
* A wrapper object to bind and expose {@link Domain} instances into the web UI.
*/
@ExportedBean
public static class DomainWrapper extends AbstractDescribableImpl<DomainWrapper> implements
ModelObject, AccessControlled, IconSpec {

/**
* The {@link CredentialsStoreAction} that we belong to.
*/
private final CredentialsStoreAction parent;
/**
* The {@link Domain} that we are exposing.
*/
private final Domain domain;

/**
* Our constructor.
*
* @param parent our parent action.
* @param domain the domain we are wrapping.
*/
public DomainWrapper(CredentialsStoreAction parent, Domain domain) {
this.parent = parent;
this.domain = domain;
}

/**
* Expose a Jenkins {@link Api}.
*
* @return the {@link Api}.
*/
public Api getApi() {
return new Api(this);
}

/**
* Expose the backing {@link CredentialsStore}.
*
* @return the backing {@link CredentialsStore}.
*/
public CredentialsStore getStore() {
return getParent().getStore();
}

/**
* Expose the backing {@link Domain}.
*
* @return the backing {@link Domain}.
*/
public Domain getDomain() {
return domain;
}

/**
* Expose the parent {@link CredentialsStoreAction}.
*
* @return the parent {@link CredentialsStoreAction}.
*/
public CredentialsStoreAction getParent() {
return parent;
}

@Restricted(DoNotUse.class) // jelly
public UpdateDomainLink getUpdateDomainLink() {
return new UpdateDomainLink();

Check warning on line 596 in src/main/java/com/cloudbees/plugins/credentials/CredentialsStoreAction.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 520-596 are not covered by tests
}

@Restricted(DoNotUse.class) // jelly
public NewCredentialsLink getNewCredentialsLink() {
return new NewCredentialsLink();
}

/**
* Return the URL name.
*
Expand Down Expand Up @@ -1026,6 +1047,17 @@
return new Api(this);
}

@Restricted(DoNotUse.class) // jelly
public UpdateCredentialsLink getUpdateLink() {
return new UpdateCredentialsLink();
}

@Restricted(DoNotUse.class) // jelly
public MoveCredentialsLink getMoveLink() {
return new MoveCredentialsLink();

Check warning on line 1057 in src/main/java/com/cloudbees/plugins/credentials/CredentialsStoreAction.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 1057 is not covered by tests
}


/**
* Gets the display name of the {@link Credentials}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
@Restricted(NoExternalUse.class)
public class ManageCredentialsConfiguration extends ManagementLink {

public String getCategoryName() {
return "SECURITY";
@NonNull
@Override
public Category getCategory() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanup while I was here

return Category.SECURITY;

Check warning on line 22 in src/main/java/com/cloudbees/plugins/credentials/ManageCredentialsConfiguration.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 22 is not covered by tests
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.ExtensionList;
import hudson.model.Action;
import hudson.model.Api;
import hudson.model.Item;
import hudson.model.ItemGroup;
import hudson.model.ManagementLink;
import hudson.model.ModelObject;
import hudson.model.RootAction;
import hudson.model.TopLevelItem;
Expand All @@ -58,6 +60,7 @@
import jenkins.model.TransientActionFactory;
import org.jenkins.ui.icon.IconSpec;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.DoNotUse;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
Expand Down Expand Up @@ -236,6 +239,11 @@
return false;
}

@Restricted(DoNotUse.class) // for jelly
public ManagementLink getManagementLink() {
return ExtensionList.lookupSingleton(ManageCredentialsConfiguration.class);

Check warning on line 244 in src/main/java/com/cloudbees/plugins/credentials/ViewCredentialsAction.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 244 is not covered by tests
}

/**
* Administrator's view credentials from 'Manage Jenkins'.
* @param accessControlled an access controlled object.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.cloudbees.plugins.credentials.links;

public class MoveCredentialsLink {
public String getDisplayName() {
return Messages.MoveCredentialsLink_displayName();

Check warning on line 5 in src/main/java/com/cloudbees/plugins/credentials/links/MoveCredentialsLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 3-5 are not covered by tests
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.cloudbees.plugins.credentials.links;

public class NewCredentialsLink {
public String getDisplayName() {
return Messages.NewCredentialsLink_displayName();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.cloudbees.plugins.credentials.links;

public class NewDomainLink {
public String getDisplayName() {
return Messages.NewDomainLink_displayName();

Check warning on line 5 in src/main/java/com/cloudbees/plugins/credentials/links/NewDomainLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 3-5 are not covered by tests
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.cloudbees.plugins.credentials.links;

public class UpdateCredentialsLink {
public String getDisplayName() {
return Messages.UpdateCredentialsLink_displayName();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.cloudbees.plugins.credentials.links;

public class UpdateDomainLink {
public String getDisplayName() {
return Messages.UpdateDomainLink_displayName();

Check warning on line 5 in src/main/java/com/cloudbees/plugins/credentials/links/UpdateDomainLink.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 3-5 are not covered by tests
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading