Skip to content

Entitlement type definitions for kdb Insights Enterprise.

Defines the data models and enumerations used by the Entitlement Service: access levels, entity types, policy mappings, and the core entitlement record structures.

Classes:

  • Access – Access level flags for an entitlement.
  • Actor – A Keycloak group actor with membership information.
  • Entitlement – Full entitlement record for an entity.
  • EntitlementElem – Entitlement record as returned by list and get operations.
  • EntityType – Types of entities that can be entitled.
  • Group – A Keycloak group with an assigned access level.
  • Owner – Owner identification for an entitlement.
  • PodOwner – Mapping from a pod IP address to its Keycloak owner UUID.
  • PolicyMappingElem – A mapping of policy types to lists of policy values.
  • PolicyTypes – Types of data access policies.
  • User – A Keycloak user with an assigned access level.

Access

Bases: Flag

Access level flags for an entitlement.

Flags can be combined. ADMIN implies READ, WRITE, and EXECUTE. EXECUTE and WRITE each imply READ.

Attributes:

  • NONE – No access.
  • READ (R) – Read-only access.
  • WRITE (W) – Write access (implies READ).
  • EXECUTE (X) – Execute access (implies READ).
  • ADMIN (A) – Full administrative access (implies READ, WRITE, EXECUTE).
  • ALL – All flags combined.
Example
from kxi.authorization.entitlement_types import Access

level = Access.from_str("RW")
print(level)         # "RW"
has_read = bool(level & Access.READ)  # True

Functions:

  • from_str – Convert string representation to enum.

from_str

from_str(data)

Convert string representation to enum.

Actor

Bases: BaseModel

A Keycloak group actor with membership information.

Attributes:

Entitlement

Bases: BaseModel

Full entitlement record for an entity.

Attributes:

EntitlementElem

Bases: Entitlement

Entitlement record as returned by list and get operations.

Extends Entitlement with a richer owner field that may be either an Owner object or a raw UUID.

Attributes:

EntityType

Bases: AutoNameEnum

Types of entities that can be entitled.

Attributes:

  • database – A kdb+ database or YAML assembly.
  • assembly – Assembly entity (alias for database).
  • package – A kdb Insights package.
  • view – A dashboard view.
  • query – A named query.
  • all – Wildcard — matches all entity types.

Functions:

valid_members

valid_members()

List all valid members.

Group

Bases: BaseModel

A Keycloak group with an assigned access level.

Attributes:

Owner

Bases: BaseModel

Owner identification for an entitlement.

Attributes:

PodOwner

Bases: BaseModel

Mapping from a pod IP address to its Keycloak owner UUID.

Attributes:

  • ip (str) – Pod IP address.
  • owner (UUID) – Keycloak user UUID of the pod owner.
  • podName (str) – Kubernetes pod name.

PolicyMappingElem

Bases: RootModel

A mapping of policy types to lists of policy values.

Maps PolicyTypes keys to lists of policy strings. Used in per-group row/column policy configuration.

Example
from kxi.authorization.entitlement_types import PolicyMappingElem

mapping = PolicyMappingElem()
mapping.row = ["region=EMEA", "desk=rates"]

PolicyTypes

Bases: AutoNameEnum

Types of data access policies.

Attributes:

  • row – Row-level access policy.
  • column – Column-level access policy.

User

Bases: BaseModel

A Keycloak user with an assigned access level.

Attributes:

  • id (UUID) – Keycloak user UUID.
  • username (str) – Keycloak username.
  • access (Access) – Access level granted to this user. Default: Access.R.
Back to top