Package jenkins.security.apitoken
Class LegacyApiTokenAdministrativeMonitor
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.AdministrativeMonitor
-
- jenkins.security.apitoken.LegacyApiTokenAdministrativeMonitor
-
- All Implemented Interfaces:
ExtensionPoint
,ModelObject
,SearchableModelObject
,SearchItem
,org.kohsuke.stapler.StaplerProxy
@Extension @Symbol("legacyApiTokenUsage") @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class LegacyApiTokenAdministrativeMonitor extends AdministrativeMonitor
Monitor the list of users that still have legacy token
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LegacyApiTokenAdministrativeMonitor.RevokeAllSelectedModel
static class
LegacyApiTokenAdministrativeMonitor.RevokeAllSelectedUserAndUuid
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.AdministrativeMonitor
id
-
-
Constructor Summary
Constructors Constructor Description LegacyApiTokenAdministrativeMonitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.kohsuke.stapler.HttpResponse
doIndex()
org.kohsuke.stapler.HttpResponse
doRevokeAllSelected(LegacyApiTokenAdministrativeMonitor.RevokeAllSelectedModel content)
String
getDisplayName()
List<User>
getImpactedUserList()
ApiTokenProperty.TokenInfoAndStats
getLegacyStatsOf(User user, ApiTokenStore.HashedToken legacyToken)
ApiTokenStore.HashedToken
getLegacyTokenOf(User user)
boolean
hasFreshToken(User user, ApiTokenProperty.TokenInfoAndStats legacyStats)
Determine if the user has at least one "new" token that was created after the last use of the legacy tokenboolean
hasMoreRecentlyUsedToken(User user, ApiTokenProperty.TokenInfoAndStats legacyStats)
Determine if the user has at least one "new" token that was used after the last use of the legacy tokenboolean
isActivated()
Returns true if this monitor is activated and wants to produce a warning message.boolean
isSecurity()
Returns true if this monitor is security related.-
Methods inherited from class hudson.model.AdministrativeMonitor
all, disable, doDisable, getRequiredPermission, getSearchUrl, getTarget, getUrl, isEnabled
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
-
-
-
Method Detail
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceModelObject
- Overrides:
getDisplayName
in classAdministrativeMonitor
-
isActivated
public boolean isActivated()
Description copied from class:AdministrativeMonitor
Returns true if this monitor is activated and wants to produce a warning message.This method is called from the HTML rendering thread, so it should run efficiently.
- Specified by:
isActivated
in classAdministrativeMonitor
-
isSecurity
public boolean isSecurity()
Description copied from class:AdministrativeMonitor
Returns true if this monitor is security related. This will be used to determine which icon will be used in the navigation bar.- Overrides:
isSecurity
in classAdministrativeMonitor
-
doIndex
public org.kohsuke.stapler.HttpResponse doIndex() throws IOException
- Throws:
IOException
-
getImpactedUserList
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<User> getImpactedUserList()
-
getLegacyTokenOf
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Nullable public ApiTokenStore.HashedToken getLegacyTokenOf(@NonNull User user)
-
getLegacyStatsOf
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Nullable public ApiTokenProperty.TokenInfoAndStats getLegacyStatsOf(@NonNull User user, ApiTokenStore.HashedToken legacyToken)
-
hasFreshToken
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean hasFreshToken(@NonNull User user, ApiTokenProperty.TokenInfoAndStats legacyStats)
Determine if the user has at least one "new" token that was created after the last use of the legacy token
-
hasMoreRecentlyUsedToken
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean hasMoreRecentlyUsedToken(@NonNull User user, ApiTokenProperty.TokenInfoAndStats legacyStats)
Determine if the user has at least one "new" token that was used after the last use of the legacy token
-
doRevokeAllSelected
public org.kohsuke.stapler.HttpResponse doRevokeAllSelected(@JsonBody LegacyApiTokenAdministrativeMonitor.RevokeAllSelectedModel content) throws IOException
- Throws:
IOException
-
-