Skip to content

API Reference parrot.auth.oauth2.remote_client

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.auth.oauth2.remote_client

View source

aiohttp client for /api/v1/connections* (FEAT-774 M4). CLI-side only; never imports server code.

Class ConnectAttempt

CLI-side correlation of one connect (S10); never stored server-side.

Fields:

Field Type Default Description
provider str
state str
auth_url str
started_at float
expires_in int 600

Alias NotConnected

Re-exported from parrot.auth.oauth2.models.NotConnected.

Class NotLoggedIn

No login record; run parrot login.

Alias PulledToken

Re-exported from parrot.auth.oauth2.models.PulledToken.

Class ServerConnectionsClient

Call the remote connections API using the current CLI login bearer.

Parameter Type Default Description
store LoginStore Login store providing the bearer. A read_only store is never refreshed or rewritten: an HTTP 401 raises :class:LoginExpired instead.
session Optional[aiohttp.ClientSession] None Optional injected aiohttp session (left open on close).
server_url Optional[str] None Pinned server base URL. When set it replaces the record's own server_url, so a login file can never redirect the bearer elsewhere.

Method ServerConnectionsClient.close

Close the lazily created session, leaving injected sessions open.

close() -> None

Method ServerConnectionsClient.me

Return the Navigator principal represented by the CLI bearer.

me() -> WhoAmI

Returns: WhoAmI

Method ServerConnectionsClient.list

List the current principal's connection descriptors.

list() -> List[Dict[str, Any]]

Returns: List[Dict[str, Any]]

Method ServerConnectionsClient.status

Return the connection descriptor for a provider.

status(provider: str) -> Dict[str, Any]

Parameter Type Default Description
provider str

Returns: Dict[str, Any]

Method ServerConnectionsClient.start_connect

Start a provider connection and retain the local start timestamp.

start_connect(provider: str, *, channel: str = 'cli', scopes: Optional[List[str]] = None) -> ConnectAttempt

Parameter Type Default Description
provider str
channel str 'cli'
scopes Optional[List[str]] None

Returns: ConnectAttempt

Method ServerConnectionsClient.complete

Complete a browser authorization callback pasted into the CLI.

complete(provider: str, *, code: str, state: str) -> Dict[str, Any]

Parameter Type Default Description
provider str
code str
state str

Returns: Dict[str, Any]

Method ServerConnectionsClient.pull_token

Pull a provider access token, mapping an absent connection to NotConnected.

pull_token(provider: str) -> PulledToken

Parameter Type Default Description
provider str

Returns: PulledToken

Method ServerConnectionsClient.disconnect

Disconnect the provider for the current principal.

disconnect(provider: str) -> None

Parameter Type Default Description
provider str

Method ServerConnectionsClient.device_start

Start the provider's server-mediated device authorization flow.

device_start(provider: str) -> Dict[str, Any]

Parameter Type Default Description
provider str

Returns: Dict[str, Any]

Method ServerConnectionsClient.device_poll

Poll one server-mediated device authorization attempt.

device_poll(provider: str, handle: str) -> Dict[str, Any]

Parameter Type Default Description
provider str
handle str

Returns: Dict[str, Any]

Alias WhoAmI

Re-exported from parrot.auth.oauth2.models.WhoAmI.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally