Record Class TokenRequestContext

java.lang.Object
java.lang.Record
io.confluent.kafka.odyssey.auth.TokenRequestContext
Record Components:
orgResourceId - the organization resource ID (e.g., "org-xxxxx")
authenticatedPrincipalCrn - the CRN to use as the authenticated principal
principalResourceId - the principal resource ID for authorization (e.g., "sa-xxxxx" or "u-xxxxx")
targetWorkloadType - the target physical workload type for the token scope

public record TokenRequestContext(String orgResourceId, String authenticatedPrincipalCrn, String principalResourceId, cloud.confluent.cc_auth_dataplane.v2.TargetPhysicalWorkloadType targetWorkloadType) extends Record
Context required to issue a Logical Access Token from Token Platform.

This record encapsulates all the information needed to request a token. The authenticatedPrincipalCrn should be constructed by the caller using their service-specific CRN format.

  • Constructor Details

    • TokenRequestContext

      public TokenRequestContext(String orgResourceId, String authenticatedPrincipalCrn, String principalResourceId, cloud.confluent.cc_auth_dataplane.v2.TargetPhysicalWorkloadType targetWorkloadType)
      Creates an instance of a TokenRequestContext record class.
      Parameters:
      orgResourceId - the value for the orgResourceId record component
      authenticatedPrincipalCrn - the value for the authenticatedPrincipalCrn record component
      principalResourceId - the value for the principalResourceId record component
      targetWorkloadType - the value for the targetWorkloadType record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • orgResourceId

      public String orgResourceId()
      Returns the value of the orgResourceId record component.
      Returns:
      the value of the orgResourceId record component
    • authenticatedPrincipalCrn

      public String authenticatedPrincipalCrn()
      Returns the value of the authenticatedPrincipalCrn record component.
      Returns:
      the value of the authenticatedPrincipalCrn record component
    • principalResourceId

      public String principalResourceId()
      Returns the value of the principalResourceId record component.
      Returns:
      the value of the principalResourceId record component
    • targetWorkloadType

      public cloud.confluent.cc_auth_dataplane.v2.TargetPhysicalWorkloadType targetWorkloadType()
      Returns the value of the targetWorkloadType record component.
      Returns:
      the value of the targetWorkloadType record component