Record Class UiApiCredentials
java.lang.Object
java.lang.Record
com.kingsrook.qqq.middleware.javalin.specs.invoke.UiApiCredentials
- Record Components:
sessionUUID- the sessionUUID cookiesessionId- the sessionId cookie- the Authorization headerapiKey- the x-api-key headerinProcessSessionToken- JVM-local session token, never captured from a client
public record UiApiCredentials(String sessionUUID, String sessionId, String authorization, String apiKey, String inProcessSessionToken)
extends Record
The credentials a caller's request carried, to forward on in-process UI API
calls so they authenticate exactly as the caller did: whatever the
authentication module (session cookies for OAuth2/OIDC, Auth0, table-based,
mock; Authorization or x-api-key headers for API keys and bearer tokens).
Capture them with fromContext() while handling the user's request (e.g. at
the start of an assistant turn); they hold secrets - never log them.
-
Constructor Summary
ConstructorsConstructorDescriptionUiApiCredentials(String sessionUUID, String sessionId, String authorization, String apiKey) Backwards-compatible credentials without an in-process session.UiApiCredentials(String sessionUUID, String sessionId, String authorization, String apiKey, String inProcessSessionToken) Creates an instance of aUiApiCredentialsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionapiKey()Returns the value of theapiKeyrecord component.Returns the value of theauthorizationrecord component.final booleanIndicates whether some other object is "equal to" this one.static UiApiCredentialsfromContext(io.javalin.http.Context context) The credentials of a request being handled.final inthashCode()Returns a hash code value for this object.Returns the value of theinProcessSessionTokenrecord component.booleanWhether any credential is present.static UiApiCredentialsofInProcessSession(String token) Credentials minted by a component in this JVM after authenticating a user.static UiApiCredentialsofSessionUUID(String sessionUUID) Credentials of just a session UUID (the sessionUUID cookie).Returns the value of thesessionIdrecord component.Returns the value of thesessionUUIDrecord component.toString()Never print the secrets.
-
Constructor Details
-
UiApiCredentials
-
UiApiCredentials
public UiApiCredentials(String sessionUUID, String sessionId, String authorization, String apiKey, String inProcessSessionToken) Creates an instance of aUiApiCredentialsrecord class.- Parameters:
sessionUUID- the value for thesessionUUIDrecord componentsessionId- the value for thesessionIdrecord componentauthorization- the value for theauthorizationrecord componentapiKey- the value for theapiKeyrecord componentinProcessSessionToken- the value for theinProcessSessionTokenrecord component
-
-
Method Details
-
ofInProcessSession
Credentials minted by a component in this JVM after authenticating a user. -
fromContext
The credentials of a request being handled. -
ofSessionUUID
Credentials of just a session UUID (the sessionUUID cookie). -
isPresent
public boolean isPresent()Whether any credential is present. -
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
sessionUUID
Returns the value of thesessionUUIDrecord component.- Returns:
- the value of the
sessionUUIDrecord component
-
sessionId
-
authorization
Returns the value of theauthorizationrecord component.- Returns:
- the value of the
authorizationrecord component
-
apiKey
-
inProcessSessionToken
Returns the value of theinProcessSessionTokenrecord component.- Returns:
- the value of the
inProcessSessionTokenrecord component
-