Package com.veertu.plugin.anka
Class AnkaLabelsApiRootAction
java.lang.Object
com.veertu.plugin.anka.AnkaLabelsApiRootAction
- All Implemented Interfaces:
ExtensionPoint,Action,ModelObject,RootAction,UnprotectedRootAction,org.kohsuke.stapler.StaplerProxy
@Extension
public class AnkaLabelsApiRootAction
extends Object
implements UnprotectedRootAction, org.kohsuke.stapler.StaplerProxy
Unauthenticated root URL segment for token-based node label updates.
POST /anka-build-cloud/labels/<cloudName> with JSON body (see README).
Security model: Implements UnprotectedRootAction without ACL
checks; callers must present the matching per-cloud secret (AnkaMgmtCloud.verifyLabelsApiToken(java.lang.String)). StaplerProxy.getTarget() returns null when no cloud has a Labels API token configured, or when the target
cloud is missing or has no token, so Stapler does not route the request to doLabels(org.kohsuke.stapler.StaplerRequest2, org.kohsuke.stapler.StaplerResponse2). CSRF for enabled paths
is handled via a narrow AnkaLabelsApiCrumbExclusion; POST-only via POST below. See
Automation / CSRF trade-offs.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoLabels(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Stapler maps this to/anka-build-cloud/labels/....Hide this action from Stapler unless the request targets/labels/<cloudName>for a cloud with a configured Labels API token.
-
Constructor Details
-
AnkaLabelsApiRootAction
public AnkaLabelsApiRootAction()
-
-
Method Details
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject
-
getUrlName
- Specified by:
getUrlNamein interfaceAction
-
getTarget
Hide this action from Stapler unless the request targets/labels/<cloudName>for a cloud with a configured Labels API token.- Specified by:
getTargetin interfaceorg.kohsuke.stapler.StaplerProxy
-
doLabels
@POST public void doLabels(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException Stapler maps this to/anka-build-cloud/labels/.... The cloud name is the first path segment afterlabels/(seeStaplerRequest2.getRestOfPath()).Only reachable when
getTarget()returnsthis.- Throws:
IOException- See Also:
-