dogwood.values#
Python value, event, response, and fallback authorizer types.
These classes mirror the names in dogwood_language so code written against
dogwood-py follows the Rust API shape. Schema-backed production behavior should
use dogwood.native; the classes here also power the temporary
schema-less fallback path.
Classes
|
Stateful fallback authorizer. |
|
Authorization decision. |
|
Decision diagnostics. |
|
Reference to an originating Dogwood rule. |
|
Cedar entity uid wrapper. |
|
Dogwood event. |
|
Builder for |
|
Authorization response. |
- class dogwood.values.Decision(*values)[source]#
Authorization decision.
Rust mapping:
dogwood_language::Decision.- ALLOW = 'Allow'#
- DENY = 'Deny'#
- class dogwood.values.Entity(ty: str, id: str)[source]#
Cedar entity uid wrapper.
Rust mapping: Dogwood events ultimately carry Cedar entity UIDs for principal/resource scope.
- ty: str#
- id: str#
- __init__(ty: str, id: str) None#
- class dogwood.values.DogwoodRuleRef(rule_index: int, cedar_policy_id: str)[source]#
Reference to an originating Dogwood rule.
Rust mapping:
dogwood_language::DogwoodRuleRef.- rule_index: int#
- cedar_policy_id: str#
- __init__(rule_index: int, cedar_policy_id: str) None#
- class dogwood.values.Diagnostics(reason: tuple[DogwoodRuleRef, ...] = (), errors: tuple[str, ...] = ())[source]#
Decision diagnostics.
Rust mapping:
dogwood_language::Diagnostics. Native diagnostics are not fully exposed through PyO3 yet; the fallback stores determining rule refs and errors.- reason: tuple[DogwoodRuleRef, ...] = ()#
- errors: tuple[str, ...] = ()#
- __init__(reason: tuple[DogwoodRuleRef, ...] = (), errors: tuple[str, ...] = ()) None#
- class dogwood.values.Response(decision: Decision, diagnostics: Diagnostics = <factory>)[source]#
Authorization response.
Rust mapping:
dogwood_language::Responsereturned byAuthorizer::is_authorizedfor decision-kind events.- diagnostics: Diagnostics#
- __init__(decision: Decision, diagnostics: Diagnostics = <factory>) None#
- class dogwood.values.Event(action_name: str, kind_name: str, ts: int = 0, scope_principal: Entity | None = None, scope_resource: Entity | None = None, logged: dict[str, ~typing.Any]=<factory>, request_ctx: dict[str, ~typing.Any]=<factory>, entities: dict[str, dict[str, ~typing.Any]]=<factory>)[source]#
Dogwood event.
Rust mapping:
dogwood_language::Event. An event generalizes a Cedar request with a first-classkindsuch asrequestorresponse. Decision kinds are defined by the Dogwood event schema; the default schema makesrequesta decision kind andresponsehistory-only.- action_name: str#
- kind_name: str#
- ts: int = 0#
- logged: dict[str, Any]#
- request_ctx: dict[str, Any]#
- entities: dict[str, dict[str, Any]]#
- classmethod builder(action: str, kind: str) EventBuilder[source]#
Start building an event.
Rust mapping:
Event::builder(action, kind).
- property action: str#
- property kind: str#
- principal() str | None[source]#
Return the request principal, if this event carries request scope.
Rust mapping:
Event::principal().
- resource() str | None[source]#
Return the request resource, if this event carries request scope.
Rust mapping:
Event::resource().
- field(group: str, name: str) Any | None[source]#
Read one logged event field.
Rust mapping:
Event::field(group, name).
- fields(group: str) Iterable[tuple[str, Any]][source]#
Iterate logged event fields in a group.
Rust mapping:
Event::fields(group).
- class dogwood.values.EventBuilder(action: str, kind: str)[source]#
Builder for
Event.Rust mapping:
dogwood_language::EventBuilder.- timestamp(ts: int) EventBuilder[source]#
Set the event timestamp.
Rust mapping:
EventBuilder::timestamp.
- principal(uid: str) EventBuilder[source]#
Set request principal scope.
Rust mapping:
EventBuilder::principal.
- resource(uid: str) EventBuilder[source]#
Set request resource scope.
Rust mapping:
EventBuilder::resource.
- field(group: str, name: str, value: Any) EventBuilder[source]#
Add one logged event field.
Rust mapping:
EventBuilder::field.
- logged_group(group: str, value: dict[str, Any]) EventBuilder[source]#
Add a full logged event field group.
- request_context(group: str, name: str, value: Any) EventBuilder[source]#
Add one Cedar request context field.
- request_context_group(group: str, value: dict[str, Any]) EventBuilder[source]#
Add a full Cedar request context group.
- class dogwood.values.Authorizer(policies: Any)[source]#
Stateful fallback authorizer.
Rust mapping:
dogwood_language::Authorizer. The native equivalent isdogwood.native.NativeAuthorizer; this class is the temporary schema-less Python fallback.