Skip to content

API Reference parrot_formdesigner.core.auth

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

parrot_formdesigner.core.auth

View source

Authentication configuration models for form submission forwarding.

This module defines the AuthConfig discriminated union used by SubmitAction to configure how outbound HTTP requests are authenticated when forwarding form submissions to external endpoints.

Credentials are always resolved from environment variables at forwarding time — never stored as raw secrets in the form schema.

Class ApiKeyAuth

API key authentication resolved from an environment variable.

The key is read from the environment at forwarding time — never stored in the form schema.

Fields:

Field Type Default Description
type Literal['api_key'] 'api_key' Discriminator literal, always "api_key".
key_env str Name of the environment variable holding the API key.
header_name str 'X-API-Key' HTTP header to inject the key into. Defaults to "X-API-Key".

Method ApiKeyAuth.resolve

Resolve the API key from env and return the configured header.

resolve() -> dict[str, str]

Returns: dict[str, str] — Dict with {header_name: key_value}.

Raises:

  • ValueError — When the env var named by key_env is not set.

Attribute AuthConfig

Class BearerAuth

Bearer token authentication resolved from an environment variable.

The token is read from the environment at forwarding time — never stored in the form schema.

Fields:

Field Type Default Description
type Literal['bearer'] 'bearer' Discriminator literal, always "bearer".
token_env str Name of the environment variable holding the Bearer token.

Method BearerAuth.resolve

Resolve the Bearer token from env and return Authorization header.

resolve() -> dict[str, str]

Returns: dict[str, str] — Dict with {"Authorization": "Bearer <token>"}.

Raises:

  • ValueError — When the env var named by token_env is not set.

Class NoAuth

No authentication — default, backward-compatible.

Fields:

Field Type Default Description
type Literal['none'] 'none' Discriminator literal, always "none".

Method NoAuth.resolve

Return empty auth headers (no authentication).

resolve() -> dict[str, str]

Returns: dict[str, str] — An empty dict — no headers are added.

Attribute logger

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