@Extension public static final class ApiTokenProperty.DescriptorImpl extends UserPropertyDescriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
clazz
Constructor and Description |
---|
DescriptorImpl() |
Modifier and Type | Method and Description |
---|---|
org.kohsuke.stapler.HttpResponse |
doChangeToken(User u,
org.kohsuke.stapler.StaplerResponse rsp) |
String |
getDisplayName()
Human readable name of this kind of configurable object.
|
ApiTokenProperty |
newInstance(User user)
When we are creating a default
ApiTokenProperty for User,
we need to make sure it yields the same value for the same user,
because there's no guarantee that the property is saved. |
isEnabled
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, findByDescribableClassName, findById, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
public String getDisplayName()
Descriptor
Class.getSimpleName()
on Descriptor.clazz
, so for example MyThing
from some.pkg.MyThing.DescriptorImpl
.
Historically some implementations returned null as a way of hiding the descriptor from the UI,
but this is generally managed by an explicit method such as isEnabled
or isApplicable
.getDisplayName
in class Descriptor<UserProperty>
public ApiTokenProperty newInstance(User user)
ApiTokenProperty
for User,
we need to make sure it yields the same value for the same user,
because there's no guarantee that the property is saved.
But we also need to make sure that an attacker won't be able to guess
the initial API token value. So we take the seed by hashing the secret + user ID.newInstance
in class UserPropertyDescriptor
public org.kohsuke.stapler.HttpResponse doChangeToken(@AncestorInPath User u, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
IOException
Copyright © 2018. All rights reserved.