Class RequiredGrants

java.lang.Object
io.jenkins.plugins.namespacecloud.client.RequiredGrants

public final class RequiredGrants extends Object
The Namespace permissions this plugin needs, and the nsc token create invocation that mints a token carrying exactly those grants.

Resource types and actions are those documented at namespace.so/docs/security/permissions. Keeping the list here (rather than scattered across call sites) means the configuration page can show the operator a copy-pasteable command.

  • Field Details

  • Method Details

    • forConfiguration

      public static List<RequiredGrants.Grant> forConfiguration(boolean anyTemplateUsesSsh)
      All grants that apply, given whether any template uses the SSH launcher.
    • nscCommand

      public static String nscCommand(boolean anyTemplateUsesSsh)
      Renders an nsc token create command that mints a token with these grants. Shown on the configuration page so the operator does not have to assemble the JSON by hand.
    • mergeByResourceType

      public static List<RequiredGrants.Grant> mergeByResourceType(List<RequiredGrants.Grant> grants)
      Collapses grants that share a resource type, so instance appears once with the union of its actions rather than twice.
    • describe

      public static String describe(RequiredGrants.Grant g)
      "instance: create, get, list" — for display.