Skip to content

API Reference parrot.services.identity_credential_sink

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

parrot.services.identity_credential_sink

View source

Transactional CredentialStore adapter for navigator-auth's Identity Vault.

Class IdentityVaultCredentialStore

CredentialStore over navigator-auth's Identity Vault for any 3LO provider (FEAT-773 M8).

Single account per (principal, provider) in v1 (S3): a minted save atomically replaces superseded accounts. The caller (AbstractOAuth2Manager) holds the per-principal lock; this class never takes it.

Parameter Type Default Description
db_pool Any
cipher Optional[Any] None

Method IdentityVaultCredentialStore.load

Load the newest enabled row as an OAuth token payload, or None.

load(user_id: str, provider: str) -> Optional[Dict[str, Any]]

Parameter Type Default Description
user_id str
provider str

Returns: Optional[Dict[str, Any]]

Method IdentityVaultCredentialStore.save

Persist a minted grant by replacement or refresh the selected grant.

save(user_id: str, provider: str, payload: Dict[str, Any], *, minted: bool, principal: Optional['Principal'], state_payload: Optional[Dict[str, Any]]) -> None

Parameter Type Default Description
user_id str
provider str
payload Dict[str, Any]
minted bool
principal Optional['Principal']
state_payload Optional[Dict[str, Any]]

Method IdentityVaultCredentialStore.delete

Delete every credential row for a principal and provider atomically.

delete(user_id: str, provider: str) -> None

Parameter Type Default Description
user_id str
provider str

Alias Principal

Re-exported from parrot.auth.principal.Principal.

Class StaleCredentialError

A refresh targeted a credential row that no longer owns the refreshed account.

Function fetch_credential_row

Re-read one identity row by id (fresh snapshot, e.g. to verify a re-seal); None when gone.

fetch_credential_row(db_pool: Any, identity_id: Any) -> Optional[Any]

Parameter Type Default Description
db_pool Any
identity_id Any

Returns: Optional[Any]

Function list_credential_rows

Every credential-bearing identity row (disabled included) for providers (empty -> all).

list_credential_rows(db_pool: Any, providers: Sequence[str]) -> List[Any]

Parameter Type Default Description
db_pool Any
providers Sequence[str]

Returns: List[Any]

Function reseal_identity_row

Re-seal every present token column of one row under the active key; preserve all metadata.

reseal_identity_row(db_pool: Any, row: Any, *, cipher: Optional[Any] = None) -> None

Parameter Type Default Description
db_pool Any
row Any
cipher Optional[Any] None

Raises:

  • IdentityCredentialError — A present column cannot be decrypted; nothing is written.

Function verify_active_only

True iff every present token column decrypts with a ring holding ONLY the active key.

verify_active_only(row: Any, *, active_cipher: Any) -> bool

Parameter Type Default Description
row Any
active_cipher Any

Returns: bool

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