Class InMemoryContextCredentialService

java.lang.Object
org.a2aproject.sdk.client.transport.spi.interceptors.auth.InMemoryContextCredentialService
All Implemented Interfaces:
CredentialService

public class InMemoryContextCredentialService extends Object implements CredentialService
A simple in-memory store for session-keyed credentials. This class uses the 'sessionId' from the ClientCallContext state to store and retrieve credentials
  • Constructor Details

    • InMemoryContextCredentialService

      public InMemoryContextCredentialService()
  • Method Details

    • getCredential

      public @Nullable String getCredential(String securitySchemeName, @Nullable ClientCallContext clientCallContext)
      Description copied from interface: CredentialService
      Retrieves a credential (e.g., token) for a security scheme.
      Specified by:
      getCredential in interface CredentialService
      Parameters:
      securitySchemeName - the name of the security scheme
      clientCallContext - the client call context, which may be null.
      Returns:
      the credential or null if the credential could not be retrieved
    • setCredential

      public void setCredential(String sessionId, String securitySchemeName, String credential)
      Method to populate the in-memory credential service.
      Parameters:
      sessionId - the session ID
      securitySchemeName - the name of the security scheme
      credential - the credential string