Class BitwardenCredentialsProvider
- All Implemented Interfaces:
ExtensionPoint
,Describable<com.cloudbees.plugins.credentials.CredentialsProvider>
,Saveable
,Loadable
,OnMaster
,IconSpec
This class is a singleton managed by Jenkins. Its primary role is to respond to requests for credentials
(from pipelines or the UI) by fetching metadata from the BitwardenCacheManager
and converting
it into a list of lazy-loading CredentialProxy
objects.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class com.cloudbees.plugins.credentials.CredentialsProvider
CREATE, DELETE, GROUP, MANAGE_DOMAINS, NONE, UPDATE, USE_ITEM, USE_OWN, VIEW
Fields inherited from class hudson.model.Descriptor
clazz
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<C extends com.cloudbees.plugins.credentials.Credentials>
List<C>getCredentialsInItemGroup
(Class<C> type, ItemGroup itemGroup, org.springframework.security.core.Authentication authentication, List<com.cloudbees.plugins.credentials.domains.DomainRequirement> domainRequirements) Called by Jenkins to get a list of credentials that are available in a given context.Provides the CSS class name for the SVG symbol used as this provider's icon.static BitwardenCredentialsProvider
Provides global access to the single instance of this provider.com.cloudbees.plugins.credentials.CredentialsStore
getStore
(ModelObject object) Provides theBitwardenCredentialsStore
to the Jenkins UI for the global credentials context.List<com.cloudbees.plugins.credentials.Credentials>
The primary method for generating the list of all available Bitwarden credentials.Methods inherited from class com.cloudbees.plugins.credentials.CredentialsProvider
_isApplicable, all, allCredentialsDescriptors, enabled, enabled, findCredentialById, findCredentialById, findCredentialById, getCredentialIds, getCredentialIds, getCredentialIdsInItem, getCredentialIdsInItemGroup, getCredentials, getCredentials, getCredentials, getCredentials, getCredentialsDescriptors, getCredentialsInItem, getDescriptor, getDisplayName, getFingerprintOf, getOrCreateFingerprintOf, getScopes, hasCredentialsDescriptors, hasStores, isApplicable, isApplicable, isEnabled, isEnabled, listCredentials, listCredentials, listCredentialsInItem, listCredentialsInItemGroup, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentials, lookupCredentialsInItem, lookupCredentialsInItem, lookupCredentialsInItemGroup, lookupCredentialsInItemGroup, lookupScopes, lookupStores, saveAll, snapshot, snapshot, track, track, track, trackAll, trackAll, trackAll, trackAll, trackAll, trackAll
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
BitwardenCredentialsProvider
public BitwardenCredentialsProvider()
-
-
Method Details
-
getInstance
Provides global access to the single instance of this provider.- Returns:
- The singleton instance of this provider.
-
getStore
Provides theBitwardenCredentialsStore
to the Jenkins UI for the global credentials context.- Overrides:
getStore
in classcom.cloudbees.plugins.credentials.CredentialsProvider
- Parameters:
object
- The context for which the store is being requested.- Returns:
- The singleton
BitwardenCredentialsStore
if the context is the Jenkins root, otherwisenull
.
-
listCredentials
The primary method for generating the list of all available Bitwarden credentials.This method is safe for all consumers (UI and pipelines). It fetches the latest metadata from the cache, intelligently assigns a Jenkins ID (using the name for unique items and the UUID for items with duplicate names), and returns a list of credential proxies.
It will not block or throw exceptions if the cache is being refreshed or has failed to load, and will instead return an empty list.
- Returns:
- A list of all available
Credentials
proxies from Bitwarden.
-
getCredentialsInItemGroup
@Nonnull public <C extends com.cloudbees.plugins.credentials.Credentials> List<C> getCredentialsInItemGroup(@Nonnull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable org.springframework.security.core.Authentication authentication, @Nonnull List<com.cloudbees.plugins.credentials.domains.DomainRequirement> domainRequirements) Called by Jenkins to get a list of credentials that are available in a given context.This implementation delegates to
listCredentials()
to get all available proxies and then filters that list to return only the credentials of the requested type.- Overrides:
getCredentialsInItemGroup
in classcom.cloudbees.plugins.credentials.CredentialsProvider
- Parameters:
type
- The class of credentials being requested.itemGroup
- The context in which the credentials are being requested.authentication
- The authentication context of the user or process.domainRequirements
- Any domain requirements for the credentials.- Returns:
- A list of dynamically-generated credentials matching the request.
-
getIconClassName
Provides the CSS class name for the SVG symbol used as this provider's icon. The corresponding SVG file is located insrc/main/resources/images/symbols/
.- Specified by:
getIconClassName
in interfaceIconSpec
- Overrides:
getIconClassName
in classcom.cloudbees.plugins.credentials.CredentialsProvider
- Returns:
- The CSS class name for the icon.
-