Skip to content

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

                        AuthState = Literal['authenticated', 'unauthenticated', 'not_required', 'unknown'] | str
                        

                        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
                        class AuthAccount(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.
                            """
                        
                            label: str
                            """Human-readable name for the account, suitable for display on its own, for example
                            ``Claude Max``, ``OpenAI API key``, or ``Vertex AI``."""
                        
                            description: str | MISSING | None = MISSING
                            """Short text shown with the label, such as the credential source, for example ``API key
                            helper``. MUST NOT contain credentials."""
                        
                            active: bool | MISSING | None = MISSING
                            """Whether the agent currently uses this account by default."""
                        
                            name: str | MISSING | None = MISSING
                            """Display name of the user, such as a username or full name."""
                        
                            email: str | MISSING | None = MISSING
                            """Email address of the user."""
                        
                            organization: str | MISSING | None = MISSING
                            """Display name of the organization, team, or workspace the account is using."""
                        

                        active class-attribute instance-attribute

                        active: bool | MISSING | None = MISSING
                        

                        Whether the agent currently uses this account by default.

                        description class-attribute instance-attribute

                        description: str | MISSING | None = MISSING
                        

                        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: str | MISSING | None = MISSING
                        

                        Email address of the user.

                        label instance-attribute

                        label: str
                        

                        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

                        name: str | MISSING | None = MISSING
                        

                        Display name of the user, such as a username or full name.

                        organization class-attribute instance-attribute

                        organization: str | MISSING | None = MISSING
                        

                        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
                        class AuthMethodAgent(AnnotatedObject):
                            """Agent handles authentication itself through ``auth/login``."""
                        
                            type: Literal["agent"] = Field(default="agent", init=False)
                        
                            method_id: AuthMethodId
                            """Unique identifier for this authentication method."""
                        
                            name: str
                            """Human-readable name of the authentication method."""
                        
                            description: str | MISSING | None = MISSING
                            """Optional human-readable description of this authentication method."""
                        

                        description class-attribute instance-attribute

                        description: str | MISSING | None = MISSING
                        

                        Optional human-readable description of this authentication method.

                        method_id instance-attribute

                        method_id: AuthMethodId
                        

                        Unique identifier for this authentication method.

                        name instance-attribute

                        name: str
                        

                        Human-readable name of the 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
                        class AuthMethodTerminal(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.
                            """
                        
                            type: Literal["terminal"] = Field(default="terminal", init=False)
                        
                            method_id: AuthMethodId
                            """Unique identifier for this authentication method."""
                        
                            name: str
                            """Human-readable name of the authentication method."""
                        
                            description: str | MISSING | None = MISSING
                            """Optional human-readable description of this authentication method."""
                        
                            args: Sequence[str] | MISSING = MISSING
                            """Additional arguments to append to the configured agent invocation for terminal auth."""
                        
                            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."""
                        

                        args class-attribute instance-attribute

                        args: Sequence[str] | MISSING = MISSING
                        

                        Additional arguments to append to the configured agent invocation for terminal auth.

                        description class-attribute instance-attribute

                        description: str | MISSING | None = MISSING
                        

                        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.

                        name instance-attribute

                        name: str
                        

                        Human-readable name of the authentication method.

                        AuthStatusRequest

                        Bases: AnnotatedObject

                        UNSTABLE: Request parameters for the auth/status method.

                        Source code in src/aclientp/schema/v2/auth.py
                        class AuthStatusRequest(AnnotatedObject):
                            """**UNSTABLE**: Request parameters for the ``auth/status`` method."""
                        

                        AuthStatusResponse

                        Bases: AnnotatedObject

                        UNSTABLE: Response to the auth/status method.

                        Source code in src/aclientp/schema/v2/auth.py
                        class AuthStatusResponse(AnnotatedObject):
                            """**UNSTABLE**: Response to the ``auth/status`` method."""
                        
                            state: AuthState
                            """Whether the agent can start sessions without the user signing in first."""
                        
                            accounts: Sequence[AuthAccount] | MISSING = MISSING
                            """The accounts the agent has configured, for display."""
                        

                        accounts class-attribute instance-attribute

                        accounts: Sequence[AuthAccount] | MISSING = MISSING
                        

                        The accounts the agent has configured, for display.

                        state instance-attribute

                        state: AuthState
                        

                        Whether the agent can start sessions without the user signing in first.

                        AuthStatusUpdateNotification

                        Bases: AnnotatedObject

                        UNSTABLE: Notification sent by the agent when its authentication status changes.

                        Source code in src/aclientp/schema/v2/auth.py
                        class AuthStatusUpdateNotification(AnnotatedObject):
                            """**UNSTABLE**: Notification sent by the agent when its authentication status changes."""
                        
                            state: AuthState
                            """Whether the agent can start sessions without the user signing in first."""
                        
                            accounts: Sequence[AuthAccount] | MISSING = MISSING
                            """The accounts the agent has configured, for display."""
                        

                        accounts class-attribute instance-attribute

                        accounts: Sequence[AuthAccount] | MISSING = MISSING
                        

                        The accounts the agent has configured, for display.

                        state instance-attribute

                        state: AuthState
                        

                        Whether the agent can start sessions without the user signing in first.

                        LoginAuthRequest

                        Bases: AnnotatedObject

                        Request parameters for the auth/login method.

                        Source code in src/aclientp/schema/v2/auth.py
                        class LoginAuthRequest(AnnotatedObject):
                            """Request parameters for the ``auth/login`` method."""
                        
                            method_id: AuthMethodId
                            """The ID of the authentication method to use. Must be one of the methods advertised in the
                            initialize response."""
                        

                        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
                        class LoginAuthResponse(AnnotatedObject):
                            """Response to the ``auth/login`` method."""
                        

                        LogoutAuthRequest

                        Bases: AnnotatedObject

                        Request parameters for the auth/logout method.

                        Source code in src/aclientp/schema/v2/auth.py
                        class LogoutAuthRequest(AnnotatedObject):
                            """Request parameters for the ``auth/logout`` method."""
                        

                        LogoutAuthResponse

                        Bases: AnnotatedObject

                        Response to the auth/logout method.

                        Source code in src/aclientp/schema/v2/auth.py
                        class LogoutAuthResponse(AnnotatedObject):
                            """Response to the ``auth/logout`` method."""
                        

                        UnknownAuthMethod

                        Bases: Unknown

                        A custom or future auth method; type values starting with _ are extensions.

                        Source code in src/aclientp/schema/v2/auth.py
                        class UnknownAuthMethod(Unknown):
                            """A custom or future auth method; ``type`` values starting with ``_`` are extensions."""
                        
                            type: str
                            """The method type."""
                        
                            method_id: AuthMethodId
                            """Unique identifier for this authentication method."""
                        
                            name: str
                            """Human-readable name of the authentication method."""
                        

                        method_id instance-attribute

                        method_id: AuthMethodId
                        

                        Unique identifier for this authentication method.

                        name instance-attribute

                        name: str
                        

                        Human-readable name of the authentication method.

                        type instance-attribute

                        type: str
                        

                        The method type.