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.

  • Constructor Details

    • AnkaLabelsApiRootAction

      public AnkaLabelsApiRootAction()
  • Method Details

    • getIconFileName

      public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
    • getUrlName

      public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • getTarget

      public Object getTarget()
      Hide this action from Stapler unless the request targets /labels/<cloudName> for a cloud with a configured Labels API token.
      Specified by:
      getTarget in interface org.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 after labels/ (see StaplerRequest2.getRestOfPath()).

      Only reachable when getTarget() returns this.

      Throws:
      IOException
      See Also: