Package com.mwdle.bitwarden.converters
Class CredentialProxy
java.lang.Object
com.mwdle.bitwarden.converters.CredentialProxy
- All Implemented Interfaces:
Serializable,InvocationHandler
A lazy-loading proxy for Bitwarden credentials.
Provides non-secret data (ID, description) instantly from memory, and defers fetching secrets via the Bitwarden CLI until the exact moment they are requested.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends com.cloudbees.plugins.credentials.common.StandardCredentials>
Tcreate(String id, BitwardenItemMetadata metadata, Class<T> credentialInterface, Class<? extends T> credentialClass, Class<? extends CredentialConverter> converterClass) Returns a Jenkins credential proxy.
-
Method Details
-
create
@NonNull public static <T extends com.cloudbees.plugins.credentials.common.StandardCredentials> T create(@NonNull String id, @NonNull BitwardenItemMetadata metadata, @NonNull Class<T> credentialInterface, @NonNull Class<? extends T> credentialClass, @NonNull Class<? extends CredentialConverter> converterClass) Returns a Jenkins credential proxy.- Type Parameters:
T- the type of the standard credential interface- Parameters:
id- the Jenkins credential IDmetadata- the Bitwarden item metadatacredentialInterface- the standard credential interface this proxy implementscredentialClass- the concrete Jenkins credential type this proxy representsconverterClass- the class of the converter that created this proxy- Returns:
- a proxy implementing the specified standard credential interface
-
invoke
@CheckForNull public Object invoke(@NonNull Object proxy, @NonNull Method method, @CheckForNull Object[] args) throws Throwable - Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-