Class StsScope

java.lang.Object
com.eqixiac.equinix.sts.model.StsScope

public final class StsScope extends Object
Typed values for the STS token-exchange scope (TokenRequest.scope(StsScope)).

The live service (2026-11-11) accepts exactly these forms and rejects anything else with invalid_scope: "scope must be an access policy ERN or a string of the form roleassignments:<org-id> or projectpolicies:<project-id> or principalpolicy:<project-id>". A free-text value such as roles is rejected.

Project ids are sent bare (the service reports projectpolicies:abc as project:abc); a project: prefix is stripped.

  • Method Details

    • accessPolicyErn

      public static StsScope accessPolicyErn(String accessPolicyErn)
      An access-policy ERN given verbatim.
      Parameters:
      accessPolicyErn - the ERN, starting with ern:
      Returns:
      the scope
      Throws:
      IllegalArgumentException - if the value does not start with ern: or has not the seven colon-separated ERN segments
    • accessPolicy

      public static StsScope accessPolicy(String projectId, String accessPolicyId)
      The access-policy ERN for a policy in a project: ern:eqix:equinix/access:global:<project-id>:AccessPolicy:<policy-id>.

      Shape: the service's ERN validator accepts this form and rejects lower-case accesspolicy and other service segments (observed 2026-11-11); a successful exchange with it was not verified. Use accessPolicyErn(String) for an ERN the console or IAM gives you.

      Parameters:
      projectId - the project id, bare or project:<id>
      accessPolicyId - the policy id, bare or accesspolicy:<id>
      Returns:
      the scope
    • roleAssignments

      public static StsScope roleAssignments(String organizationId)
      roleassignments:<org-id>: a token carrying the caller's role assignments in an organization.
      Parameters:
      organizationId - the organization id
      Returns:
      the scope
    • projectPolicies

      public static StsScope projectPolicies(String projectId)
      projectpolicies:<project-id>: a token carrying the project's policies.
      Parameters:
      projectId - the project id, bare or project:<id>
      Returns:
      the scope
    • principalPolicy

      public static StsScope principalPolicy(String projectId)
      principalpolicy:<project-id>: a token carrying the caller's principal policy in a project.
      Parameters:
      projectId - the project id, bare or project:<id>
      Returns:
      the scope
    • getValue

      public String getValue()
      Returns the wire value sent as the scope form field.
      Returns:
      the scope string
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object