Class ScopedCredentials
java.lang.Object
io.jenkins.plugins.credentials.secretsmanager.ScopedCredentials
- All Implemented Interfaces:
com.cloudbees.plugins.credentials.common.IdCredentials,com.cloudbees.plugins.credentials.common.StandardCredentials,com.cloudbees.plugins.credentials.Credentials,ExtensionPoint,Describable<com.cloudbees.plugins.credentials.Credentials>,Serializable
public class ScopedCredentials
extends Object
implements com.cloudbees.plugins.credentials.common.StandardCredentials
Wrapper that adds folder scope metadata to any StandardCredentials.
This allows credentials to be filtered based on the requesting folder context
without modifying the individual credential type implementations.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface com.cloudbees.plugins.credentials.common.IdCredentials
com.cloudbees.plugins.credentials.common.IdCredentials.HelpersNested classes/interfaces inherited from interface com.cloudbees.plugins.credentials.common.StandardCredentials
com.cloudbees.plugins.credentials.common.StandardCredentials.NameProvider -
Constructor Summary
ConstructorsConstructorDescriptionScopedCredentials(com.cloudbees.plugins.credentials.common.StandardCredentials delegate, FolderScope folderScope) Creates a scoped credential wrapper. -
Method Summary
Modifier and TypeMethodDescription<T> TGets the underlying credential cast to the specified type.booleancom.cloudbees.plugins.credentials.common.StandardCredentialsGets the underlying delegate credential.com.cloudbees.plugins.credentials.CredentialsDescriptorGets the folder scope for this credential.getId()com.cloudbees.plugins.credentials.CredentialsScopegetScope()inthashCode()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.cloudbees.plugins.credentials.Credentials
forRun
-
Constructor Details
-
ScopedCredentials
public ScopedCredentials(@NonNull com.cloudbees.plugins.credentials.common.StandardCredentials delegate, @NonNull FolderScope folderScope) Creates a scoped credential wrapper.- Parameters:
delegate- the underlying credentialfolderScope- the folder scope for this credential
-
-
Method Details
-
getFolderScope
Gets the folder scope for this credential.- Returns:
- the folder scope
-
as
Gets the underlying credential cast to the specified type.- Type Parameters:
T- the credential type- Parameters:
type- the type to cast to- Returns:
- the credential as the specified type, or null if not compatible
-
getDelegate
@NonNull public com.cloudbees.plugins.credentials.common.StandardCredentials getDelegate()Gets the underlying delegate credential.- Returns:
- the delegate credential
-
getId
- Specified by:
getIdin interfacecom.cloudbees.plugins.credentials.common.IdCredentials
-
getDescription
- Specified by:
getDescriptionin interfacecom.cloudbees.plugins.credentials.common.StandardCredentials
-
getScope
@NonNull public com.cloudbees.plugins.credentials.CredentialsScope getScope()- Specified by:
getScopein interfacecom.cloudbees.plugins.credentials.Credentials
-
getDescriptor
@NonNull public com.cloudbees.plugins.credentials.CredentialsDescriptor getDescriptor()- Specified by:
getDescriptorin interfacecom.cloudbees.plugins.credentials.Credentials- Specified by:
getDescriptorin interfaceDescribable<com.cloudbees.plugins.credentials.Credentials>
-
equals
-
hashCode
public int hashCode() -
toString
-