public class ApiTokenProperty extends UserProperty
ApiTokenFilter
Modifier and Type | Class and Description |
---|---|
static class |
ApiTokenProperty.DescriptorImpl |
ExtensionPoint.LegacyInstancesAreScopedToHudson
user
Constructor and Description |
---|
ApiTokenProperty() |
Modifier and Type | Method and Description |
---|---|
void |
changeApiToken() |
String |
getApiToken()
Gets the API token.
|
boolean |
matchesPassword(String password) |
UserProperty |
reconfigure(org.kohsuke.stapler.StaplerRequest req,
net.sf.json.JSONObject form)
When a parent/owner object of a Describable gets a config form submission and instances are
recreated, this method is invoked on the existing instance (meaning the 'this' reference
points to the existing instance) to create a new instance to be added to the parent/owner object.
|
all, getDescriptor
@Nonnull public String getApiToken()
Jenkins.ADMINISTER
may be allowed to do it using SHOW_TOKEN_TO_ADMINS
.Messages.ApiTokenProperty_ChangeToken_TokenIsHidden()
if the user has no appropriate permissions.public boolean matchesPassword(String password)
public void changeApiToken() throws IOException
IOException
public UserProperty reconfigure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject form) throws Descriptor.FormException
ReconfigurableDescribable
The default implementation of this should be the following:
return form==null ? null : getDescriptor().newInstance(req, form);
reconfigure
in interface ReconfigurableDescribable<UserProperty>
reconfigure
in class UserProperty
req
- The current HTTP request being processed.form
- JSON fragment that corresponds to this describable object.
If the newly submitted form doesn't include a fragment for this describable
(meaning the user has de-selected your descriptor), then this argument is null.Descriptor.FormException
Copyright © 2016. All rights reserved.