bayesline.api#

Description of the public-facing API for bayesline.

Core#

AsyncBayeslineApi()

Abstract base class for Bayesline API operations.

BayeslineApi()

Abstract base class for Bayesline API operations.

AsyncBayeslineApi()

Abstract base class for Bayesline API operations.

Authentication API#

ACLEntry(**data)

An individual ACL entry granting specific permissions to a principal for a resource.

ACLError

Base exception for ACL-related errors.

ACLValidationError

Raised when ACL data fails validation.

CreateACLEntry(**data)

Request model for creating a new ACL entry.

CreateGroupMembership(**data)

Request model for adding a user to a group.

CreateUserGroup(**data)

Request model for creating a new user group.

CreateUserRole(**data)

Request model for assigning a role to a user.

GroupCreationError

Raised when creating a group fails.

GroupDeletionError

Raised when deleting a group fails.

GroupMembership(**data)

Represents a user's membership in a group.

GroupMembershipError

Raised when adding or removing users from groups fails.

GroupUpdateError

Raised when updating a group fails.

PermissionDeniedError

Raised when a user attempts an action they don't have permission for.

PermissionGrantError

Raised when granting a permission fails.

PermissionLevel(value)

Permission levels for resource access.

PrincipalNotFoundError

Raised when a principal (user/group/role) referenced in ACL operations doesn't exist.

PrincipalType(value)

Types of principals that can be granted permissions.

ResourceNotFoundError

Raised when a resource referenced in ACL operations doesn't exist.

ResourcePermissionSummary(**data)

Summary of a user's permissions for a specific resource.

ResourceType(value)

Types of resources that can be protected by ACL.

RoleAssignmentError

Raised when assigning or revoking roles fails.

RoleType(value)

Built-in system roles with predefined permissions.

SharedResource(**data)

A grant of access to a resource that the current user made to a principal.

SharedResourceSummary(**data)

Summary of the resources that are shared with others.

UpdateACLEntry(**data)

Request model for updating an existing ACL entry.

UpdateUserGroup(**data)

Request model for updating an existing user group.

UserGroup(**data)

A group of users for simplified permission management.

UserPermissionsSummary(**data)

Complete summary of a user's permissions across all resources.

UserRef

UserRole(**data)

Represents a user's system role assignment.

expand_roles(held_roles)

Expand assigned roles into every role they fulfil via the hierarchy.

role_satisfies(held_roles, required_role)

Return whether the held roles satisfy required_role per the hierarchy.

AsyncPermissionsApi()

Abstract base class for asynchronous ACL-based permissionining API operations.

PermissionsApi()

Abstract base class for synchronous ACL-based permissionining API operations.

AsyncFeaturesApi()

Abstract base class for asynchronous feature flag API operations.

FeaturesApi()

Abstract base class for feature flag API operations.

FeaturesUnavailableError

Exception raised when features could not be read.

FEATURE_IDENTITY_PATTERN

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

AppFeature(value)

Base for the constants naming an application's features.

StableIdentityEnum(value)

An enum whose class and member names are stored as durable identities.

EffectiveFeature(**data)

A feature as it stands in this deployment.

FeatureDeclaration(**data)

A feature definition, plus what an application declares alongside it.

FeatureDefinition(**data)

What a feature is, as the application that owns it states it.

FeatureEnablementReason(value)

The reason why a feature is enabled or disabled.

FeatureExplanation(**data)

How a feature resolved for one user, and what it was resolved from.

FeatureEntitlement(**data)

A grant as it sits in the registry, for auditing who was given what.

Decider

Runtime representation of an annotated type.

canonical_identity(key)

One feature identity, as the registry holds it.

rekey_by_identity(by_key)

Rekey a mapping by the canonical identity of each key.

EvaluatedGrant(**data)

A grant, where it came from, and whether it is the one that decided.

GrantSource(value)

Where a grant that bears on a feature came from.

FeatureUpdateItem(**data)

A request to update a feature value.

FeatureValue(**data)

A value of a feature, i.e. its enabled state along with other info.

FromGrant(**data)

A grant the value was read from, and who holds it.

FromPolicy(**data)

A policy the value was read from, and what that authority said.

Grant(**data)

What one principal is granted on a feature.

GrantAttribution(**data)

Who wrote a stored grant, and when.

FeaturePolicy(**data)

A policy about what a feature is, holding for every user.

ScopedGrant(**data)

A grant on a feature, together with where it came from.

PolicyAuthority(value)

Who a policy comes from, and so how far it outranks another.

PolicyProvider

Principal(**data)

Anything a grant can be addressed to.

role_grant(role, *[, enabled, data])

Build a grant addressed to everyone who fulfils a role.

AsyncReadableFeaturesApi()

Abstract base class for asynchronous feature flag read API operations.

User(**data)

The properties of a user.

Settings API#

AsyncRegistryBasedApiBase()

Concrete base for RegistryBasedApi implementations.

AsyncSettingsRegistry()

Abstract base class for settings registries.

AsyncTypedSettingsRegistry()

Abstract base class for typed settings registries.

RegistryBasedApiBase()

Concrete base for RegistryBasedApi implementations.

SettingsIdentifiers(**data)

Holds mappings of globally unique settings identifiers to other properties.

SettingsRegistry()

Abstract base class for settings registries.

TypedSettingsRegistry()

Abstract base class for typed settings registries.

ChangeOwnerItemResult(**data)

The result of a single change-owner operation.

ChangeOwnerResult(**data)

The result of a batch change-owner operation.

CouldNotChangeOwnerError

Raised when the owner of a settings object could not be changed.

CouldNotDeleteSettingsError

Raised when a settings object could not be deleted from the registry.

CouldNotPermissionSettingsError

Raised when a settings object could not be permissioned.

CouldNotSaveSettingsError

Raised when a settings object could not be saved to the registry.

DatasetAwareSettings(**data)

Settings bound to a dataset.

DatasetError

Exception raised for dataset-related errors.

DeleteItemResult(**data)

The result of a single delete operation.

DeleteResult(**data)

The result of a batch delete operation.

EmptySettingsMenu(**data)

Empty settings menu implementation.

ItemResult(**data)

The result of a single item operation, e.g. delete on a single settings object.

ItemStatus(value)

The status of a single item operation, e.g. delete on a single settings object.

PermissionItemResult(**data)

The result of a single permission operation.

PermissionResult(**data)

The result of a batch permission operation.

RawSettings(**data)

Raw settings data structure.

SaveItemResult(**data)

The result of a single save operation.

SaveResult(**data)

The result of a batch save operation.

SettingInvalid(name, id, owner, raw_json, issues)

A settings result that exists but is invalid.

SettingNotFound(name, id[, kind])

A settings result that could not be found.

SettingNotPermissioned(name, id, owner[, kind])

A settings result that exists but the current user does not have read permissions.

SettingResult

Settings(**data)

Base class for all settings objects.

SettingsMenu(**data)

Abstract base class for settings menus.

SettingsMetaData(**data)

Metadata for settings objects.

SETTINGS_DESCRIPTION_MAX_LENGTH

int([x]) -> integer int(x, base=10) -> integer

SettingsRegistryError

Raised when an unexpected error occurs in the settings registry.

SettingsRegistryResult(**data)

The result of a batch operation, e.g. a batch delete operation.

SettingsTransferObject(**data)

A settings transfer object.

SettingValid(name, id, owner, value, ...[, ...])

A settings result that exists and is valid.

expect_valid(result)

Like unwrap_valid, but returns the SettingValid wrapper.

unwrap_valid(result)

Convert a SettingResult[T] into the bare DatasetAwareSettings[T].

REPORT_SETTINGS_TYPES

Built-in mutable sequence.

RISKDATASET_SETTINGS_TYPES

Built-in mutable sequence.

SETTINGS_TYPES

Built-in mutable sequence.

migrate_raw_json(settings_type, raw_json)

Apply sequential migrations to raw_json and strip the version key.

parse_stored(settings_type, raw_json)

Migrate and validate persisted raw JSON into a Settings instance.

stamp_version(settings_type, raw_json)

Stamp the current schema version into raw_json for persistence.

strip_meta_keys(raw_json)

Return raw_json without storage-level meta keys.

validate_migration_chain(settings_type)

Validate that a settings type has a complete chain of migrations.

DATASET_KEY

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Tasks API#

AsyncTask()

Abstract base class representing a task that produces a result of type T.

AsyncTasksApi()

Abstract base class for synchronous task API operations.

Task()

Abstract base class representing a task that produces a result of type T.

TaskError

Exception raised when a task operation fails.

TaskProgress(**data)

The progress of a task.

TaskResponse(**data)

Response model for task operations.

TasksApi()

Abstract base class for synchronous task API operations.

TaskState(value)

The state of a task.