auth
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AuthAccount aclientp.schema.v2.auth **UNSTABLE**: An account or credential the agent has configured. |
||
| AuthMethodAgent aclientp.schema.v2.auth Agent handles authentication itself through ``auth/login``. |
||
| AuthMethodTerminal aclientp.schema.v2.auth Terminal-based authentication method. |
||
| AuthStatusRequest aclientp.schema.v2.auth **UNSTABLE**: Request parameters for the ``auth/status`` method. |
||
| AuthStatusResponse aclientp.schema.v2.auth **UNSTABLE**: Response to the ``auth/status`` method. |
||
| AuthStatusUpdateNotification aclientp.schema.v2.auth **UNSTABLE**: Notification sent by the agent when its authentication status changes. |
||
| LoginAuthRequest aclientp.schema.v2.auth Request parameters for the ``auth/login`` method. |
||
| LoginAuthResponse aclientp.schema.v2.auth Response to the ``auth/login`` method. |
||
| LogoutAuthRequest aclientp.schema.v2.auth Request parameters for the ``auth/logout`` method. |
||
| LogoutAuthResponse aclientp.schema.v2.auth Response to the ``auth/logout`` method. |
||
| UnknownAuthMethod aclientp.schema.v2.auth A custom or future auth method; ``type`` values starting with ``_`` are extensions. |
🛈 DocStrings¶
v2 authentication: auth methods, auth/login, auth/logout and auth/status.
An agent that returns a non-empty authMethods list in initialize MUST implement
auth/login and auth/logout; otherwise clients MUST NOT call them.
AuthMethod
module-attribute
¶
AuthMethod = Annotated[
Annotated[AuthMethodTerminal, Tag("terminal")]
| Annotated[AuthMethodAgent, Tag("agent")]
| Annotated[UnknownAuthMethod, Tag(OTHER_TAG)],
Discriminator(open_discriminator("type", frozenset({"terminal", "agent"}))),
]
An authentication method the agent offers, discriminated by type.
AuthState
module-attribute
¶
UNSTABLE: The agent's overall authentication state.
authenticated does not guarantee valid credentials. Values starting with _ are
extensions.
AuthAccount
¶
Bases: AnnotatedObject
UNSTABLE: An account or credential the agent has configured.
For example a signed-in user account or an API key. All fields are display information only.
Source code in src/aclientp/schema/v2/auth.py
active
class-attribute
instance-attribute
¶
Whether the agent currently uses this account by default.
description
class-attribute
instance-attribute
¶
Short text shown with the label, such as the credential source, for example API key
helper. MUST NOT contain credentials.
email
class-attribute
instance-attribute
¶
Email address of the user.
label
instance-attribute
¶
Human-readable name for the account, suitable for display on its own, for example
Claude Max, OpenAI API key, or Vertex AI.
name
class-attribute
instance-attribute
¶
Display name of the user, such as a username or full name.
organization
class-attribute
instance-attribute
¶
Display name of the organization, team, or workspace the account is using.
AuthMethodAgent
¶
Bases: AnnotatedObject
Agent handles authentication itself through auth/login.
Source code in src/aclientp/schema/v2/auth.py
description
class-attribute
instance-attribute
¶
Optional human-readable description of this authentication method.
method_id
instance-attribute
¶
method_id: AuthMethodId
Unique identifier for this authentication method.
AuthMethodTerminal
¶
Bases: AnnotatedObject
Terminal-based authentication method.
The client runs the configured agent program as a separate interactive process, with
args appended and env set, for the user to authenticate in a TUI. Requires the
client's auth.terminal capability.
Source code in src/aclientp/schema/v2/auth.py
args
class-attribute
instance-attribute
¶
Additional arguments to append to the configured agent invocation for terminal auth.
description
class-attribute
instance-attribute
¶
Optional human-readable description of this authentication method.
env
class-attribute
instance-attribute
¶
env: Sequence[EnvVariable] | MISSING = MISSING
Additional environment variables to set on the configured agent invocation for terminal auth. Names MUST be unique. These values override same-named variables in the base launch configuration.
method_id
instance-attribute
¶
method_id: AuthMethodId
Unique identifier for this authentication method.
AuthStatusRequest
¶
Bases: AnnotatedObject
UNSTABLE: Request parameters for the auth/status method.
Source code in src/aclientp/schema/v2/auth.py
AuthStatusResponse
¶
Bases: AnnotatedObject
UNSTABLE: Response to the auth/status method.
Source code in src/aclientp/schema/v2/auth.py
accounts
class-attribute
instance-attribute
¶
accounts: Sequence[AuthAccount] | MISSING = MISSING
The accounts the agent has configured, for display.
AuthStatusUpdateNotification
¶
Bases: AnnotatedObject
UNSTABLE: Notification sent by the agent when its authentication status changes.
Source code in src/aclientp/schema/v2/auth.py
accounts
class-attribute
instance-attribute
¶
accounts: Sequence[AuthAccount] | MISSING = MISSING
The accounts the agent has configured, for display.
LoginAuthRequest
¶
Bases: AnnotatedObject
Request parameters for the auth/login method.
Source code in src/aclientp/schema/v2/auth.py
method_id
instance-attribute
¶
method_id: AuthMethodId
The ID of the authentication method to use. Must be one of the methods advertised in the initialize response.
LoginAuthResponse
¶
Bases: AnnotatedObject
Response to the auth/login method.
Source code in src/aclientp/schema/v2/auth.py
LogoutAuthRequest
¶
Bases: AnnotatedObject
Request parameters for the auth/logout method.
Source code in src/aclientp/schema/v2/auth.py
LogoutAuthResponse
¶
Bases: AnnotatedObject
Response to the auth/logout method.
Source code in src/aclientp/schema/v2/auth.py
UnknownAuthMethod
¶
Bases: Unknown
A custom or future auth method; type values starting with _ are extensions.
Source code in src/aclientp/schema/v2/auth.py
method_id
instance-attribute
¶
method_id: AuthMethodId
Unique identifier for this authentication method.