Class EphemeralCredentialsPutGlobalVariable
- All Implemented Interfaces:
ExtensionPoint
Registers ephemeralCredentialsPut(...) as a global step (no
@Library import needed), caching a credential into EphemeralCredentialsProvider for the current run directly - the
pipeline-facing equivalent of EphemeralCredentialsAccessor.put(java.lang.String, com.cloudbees.plugins.credentials.Credentials).
Two call shapes, both keyword-argument only (deliberately - see below):
ephemeralCredentialsPut(id: 'FOO', credentials: someCredentials)- caches an already-builtCredentialsobject directly.ephemeralCredentialsPut(spec: ephemeralUsernamePassword(id: 'FOO', description: '...'), values: [username: 'u', password: 'p'])- materializesspecfromvaluesfirst, the same shapeinput's answer would have been, letting a pipeline pre-populate a credential from data it already has (fetched mid-pipeline, computed, ...) without ever pausing oninput.
Both shapes are handled by one single-Map-argument
doCall rather than two overloaded doCall methods distinguished
by parameter count/type - Closure subclasses do not reliably
support Java-style overload resolution for doCall the way a
plain Java class would, so two separate overloads risk one shape being
silently mis-dispatched (no exception, but nothing findable afterwards).
One doCall(Map), branching on which keys are present, is the same
shape every other GlobalVariable factory in this plugin already
uses.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class org.jenkinsci.plugins.workflow.cps.GlobalVariable
ALL -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.jenkinsci.plugins.workflow.cps.GlobalVariable
byName, forJob, forRun
-
Constructor Details
-
EphemeralCredentialsPutGlobalVariable
public EphemeralCredentialsPutGlobalVariable()
-
-
Method Details
-
getName
- Specified by:
getNamein classorg.jenkinsci.plugins.workflow.cps.GlobalVariable
-
getValue
- Specified by:
getValuein classorg.jenkinsci.plugins.workflow.cps.GlobalVariable
-