Class IamContext

java.lang.Object
com.chaosguide.iam.vertex.context.IamContext

public final class IamContext extends Object
Convenience accessors for the current IAM-authenticated request.
  • Method Details

    • current

      public static IamContext current()
      Returns the current IAM user or throws an SDK exception when the request is unauthenticated.
    • currentOptional

      public static Optional<IamContext> currentOptional()
      Returns the current IAM context from a verified JWT or an authenticated server-session principal.
    • currentUser

      public static IamCurrentUser currentUser()
      Returns the immutable current-user value object, useful for injection and audit DTOs.
    • currentUserOptional

      public static Optional<IamCurrentUser> currentUserOptional()
      Returns the current-user value object if the request is IAM authenticated.
    • requireCurrent

      public static IamContext requireCurrent()
      Alias for current() for call sites that prefer explicit naming.
    • requireCurrentUser

      public static IamCurrentUser requireCurrentUser()
      Alias for currentUser() for call sites that prefer explicit naming.
    • currentAccessToken

      public static Optional<String> currentAccessToken()
      Returns the raw access token for explicit user-profile calls, if Spring exposes it.
    • user

      public IamCurrentUser user()
    • getUserId

      public String getUserId()
    • getEmail

      public String getEmail()
    • getRoles

      public Set<String> getRoles()
    • getPermissions

      public Set<String> getPermissions()
    • getOrgId

      public String getOrgId()
    • getOrgRole

      public String getOrgRole()
    • getActorId

      public String getActorId()
    • hasPermission

      public boolean hasPermission(String resource, String action)
    • isImpersonating

      public boolean isImpersonating()
    • hasMfa

      public boolean hasMfa()