heimdall.models package

Submodules

heimdall.models.authorization_atom module

class heimdall.models.authorization_atom.AuthContext(*, predicate: str, context: AuthObject)[source]

Bases: BaseModel

context: AuthObject
predicate: str
class heimdall.models.authorization_atom.AuthObject(*, tags: List[str] | None = None, paths: List[str] | None = None)[source]

Bases: BaseModel

paths: List[str] | None
tags: List[str] | None
class heimdall.models.authorization_atom.AuthorizationAtom(*, id: str, description: str, predicate: str, tags: List[str] | None = None, paths: List[str] | None = None, variables: List[str] | None = None)[source]

Bases: BaseModel

class Config[source]

Bases: object

orm_mode = True
copy()[source]

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters:
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns:

new model instance

description: str
has_variables() bool[source]
id: str
paths: List[str] | None
predicate: str
tags: List[str] | None
to_auth_context() AuthContext[source]
variables: List[str] | None

heimdall.models.authorization_request module

class heimdall.models.authorization_request.AuthContext(*, predicate: str, object: AuthObject, metadata: Dict[str, Any] | None = None)[source]

Bases: BaseModel

metadata: Dict[str, Any] | None
object: AuthObject
predicate: str
class heimdall.models.authorization_request.AuthObject(*, tags: List[str] | None = None, paths: List[str] | None = None)[source]

Bases: BaseModel

paths: List[str] | None
tags: List[str] | None
class heimdall.models.authorization_request.AuthorizationRequest(*, token: str, context: AuthContext | None = None, pep_context: PepContext | None = None)[source]

Bases: BaseModel

context: AuthContext | None
pep_context: PepContext | None
token: str
class heimdall.models.authorization_request.AuthorizationRequestBatch(*, token: str, contexts: Dict[str, AuthContext])[source]

Bases: BaseModel

contexts: Dict[str, AuthContext]
token: str
class heimdall.models.authorization_request.PepContext(*, user_agent: str | None = None, authorization_atom_id: str)[source]

Bases: BaseModel

authorization_atom_id: str
user_agent: str | None

heimdall.models.authorization_response module

class heimdall.models.authorization_response.AuthObject(*, tags: List[str] | None = None)[source]

Bases: BaseModel

tags: List[str] | None
class heimdall.models.authorization_response.AuthResponseSingle(*, allow: bool = False, valid: bool = False, error: Error | None = None)[source]

Bases: BaseModel

Represents a single authorization response within a batch.

Parameters:
  • allow (bool) – Whether the request is allowed, defaults to False.

  • valid (bool) – Whether the request is valid, defaults to False.

  • error (Optional[Error]) – The error encountered during the authorization request, defaults to None.

allow: bool
error: Error | None
valid: bool
class heimdall.models.authorization_response.AuthorizationResponse(*, allow: bool = False, valid: bool = False, result: Result | None = None, error: Error | None = None)[source]

Bases: BaseModel

Represents the response of an authorization request.

Parameters:
  • allow (bool) – Whether the request is allowed, defaults to False.

  • valid (bool) – Whether the request is valid, defaults to False.

  • result (Result, optional) – The result of the authorization request, defaults to None.

  • error (Error, optional) – The error encountered during the authorization request, defaults to None.

allow: bool
error: Error | None
result: Result | None
valid: bool
class heimdall.models.authorization_response.AuthorizationResponseBatch(*, id: str = None, tags: List[str] | None = None, results: Dict[str, AuthorizationResponse] | None = None)[source]

Bases: BaseModel

Represents a batch of authorization responses.

Parameters:
  • id (str) – The identifier of the batch, defaults to “”.

  • tags (Optional[List[str]]) – The tags associated with the batch, defaults to None.

  • results (Optional[Dict[str, AuthorizationResponse]]) – The results of the authorization request, defaults to None.

id: str
results: Dict[str, AuthorizationResponse] | None
tags: List[str] | None
class heimdall.models.authorization_response.Error(*, status: int = -1, message: str = '')[source]

Bases: BaseModel

Represents an error encountered during an authorization request.

Parameters:
  • status (int) – The status code associated with the error, defaults to -1.

  • message (str) – The error message associated with the error, defaults to “”.

message: str
status: int
class heimdall.models.authorization_response.Result(*, id: str = None, tags: List[str] | None = None)[source]

Bases: BaseModel

Represents the result of an authorization request.

Parameters:
  • id (str) – The identifier of the result, defaults to “”.

  • tags (List[str], optional) – The tags associated with the result, defaults to None.

id: str
tags: List[str] | None

heimdall.models.authorization_result_data module

class heimdall.models.authorization_result_data.AuthorizationResultData(*, id: str | None = None, data: Any = None, tags: List[str] | None = None)[source]

Bases: BaseModel

data: Any
id: str | None
tags: List[str] | None

heimdall.models.data module

class heimdall.models.data.Data(*, key: str | None = None, base64Value: str | None = None)[source]

Bases: BaseModel

base64Value: str | None
key: str | None

heimdall.models.data_policy module

class heimdall.models.data_policy.ColumnSelector(*, tags: List[str] | None = None, names: List[str] | None = None)[source]

Bases: BaseModel

names: List[str] | None
tags: List[str] | None
class heimdall.models.data_policy.DataPolicy(*, priority: int, type: str, selector: Selector | None = None, mask: Mask | None = None, filters: List[Filter] | None = None, dataset_id: str, name: str | None = None, description: str | None = None)[source]

Bases: BaseModel

dataset_id: str
description: str | None
filters: List[Filter] | None
mask: Mask | None
name: str | None
priority: int
selector: Selector | None
type: str
class heimdall.models.data_policy.Selector(*, user: UserSelector | None = None, column: ColumnSelector | None = None)[source]

Bases: BaseModel

column: ColumnSelector | None
user: UserSelector | None
class heimdall.models.data_policy.UserSelector(*, match: str, tags: List[str])[source]

Bases: BaseModel

match: str
tags: List[str]

heimdall.models.dataset module

class heimdall.models.dataset.Column(*, name: str, data_type: str)[source]

Bases: BaseModel

data_type: str
name: str
class heimdall.models.dataset.Dataset(*, id: str, tags: List[str] | None = None, columns: List[Column] | None = None)[source]

Bases: BaseModel

columns: List[Column] | None
id: str
tags: List[str] | None

heimdall.models.decision module

class heimdall.models.decision.Decision(*, table: Dataset | None = None, user: AuthorizationResultData | None = None, masks: Dict[str, Mask] | None = None, filter: List[Filter] | None = None)[source]

Bases: BaseModel

filter: List[Filter] | None
masks: Dict[str, Mask] | None
table: Dataset | None
user: AuthorizationResultData | None

heimdall.models.filter module

class heimdall.models.filter.Filter(*, column: str | None = None, operator: str | None = None, value: str | None = None, valueFrom: ValueFrom | None = None, supported_data_types: List[str] | None = None)[source]

Bases: BaseModel

column: str | None
operator: str | None
supported_data_types: List[str] | None
value: str | None
value_from: ValueFrom | None
class heimdall.models.filter.ValueFrom(*, user_attribute: str)[source]

Bases: BaseModel

user_attribute: str

heimdall.models.heimdall_secret module

class heimdall.models.heimdall_secret.HeimdallSecret(*, id: str, data: List[Data], _links: Links, ACCESS_KEY_ID: str = 'awsaccesskeyid', SECRET_KEY: str = 'awssecretaccesskey', AZURE_STORAGE_ACCOUNT_NAME: str = 'azurestorageaccountname', AZURE_STORAGE_ACCOUNT_KEY: str = 'azurestorageaccountkey', ABFSS_STORAGE_ACCOUNT_KEY_TEMPLATE: str = 'fs.azure.account.key.%s.dfs.core.windows.net', WASBS_STORAGE_ACCOUNT_KEY_TEMPLATE: str = 'fs.azure.account.key.%s.blob.core.windows.net', S3_ACCESS_KEY: str = 'fs.s3a.access.key', S3_SECRET_KEY: str = 'fs.s3a.secret.key', GCS_KEY_JSON: str = 'gcskey_json', PRIVATE_KEY: str = 'privatekey', PRIVATE_KEY_ID: str = 'privatekeyid', EMAIL: str = 'email', GCS_CLIENT_EMAIL: str = 'client_email', GCS_PRIVATE_KEY_ID: str = 'private_key_id', GCS_PRIVATE_KEY: str = 'private_key', GCS_SERVICE_ACCOUNT_EMAIL: str = 'fs.gs.auth.service.account.email', GCS_SERVICE_PRIVATE_KEY_ID: str = 'fs.gs.auth.service.account.private.key.id', GCS_SERVICE_PRIVATE_KEY: str = 'fs.gs.auth.service.account.private.key')[source]

Bases: BaseModel

ABFSS_STORAGE_ACCOUNT_KEY_TEMPLATE: str
ACCESS_KEY_ID: str
AZURE_STORAGE_ACCOUNT_KEY: str
AZURE_STORAGE_ACCOUNT_NAME: str
S3_ACCESS_KEY: str
S3_SECRET_KEY: str
SECRET_KEY: str
WASBS_STORAGE_ACCOUNT_KEY_TEMPLATE: str
data: List[Data]
id: str
toABFSSSecrets(key: str) Dict[str, str][source]
toGCSSecrets(key: str) Dict[str, str][source]
toS3Secrets(key: str) Dict[str, str][source]
toWASBSSecrets(key: str) Dict[str, str][source]

heimdall.models.mask module

class heimdall.models.mask.Mask(*, operator: str, pass_through: MaskPassThrough | None = None, hash: MaskHash | None = None, redact: Dict[str, Any] | None = None, bucket_number: MaskBucketNumber | None = None, bucket_date: MaskBucketDate | None = None, rand_pattern: MaskRandPattern | None = None, rand_regexify: MaskRandRegexify | None = None, regex_replace: MaskRegexReplace | None = None, supported_data_types: List[str] | None = None)[source]

Bases: BaseModel

bucket_date: MaskBucketDate | None
bucket_number: MaskBucketNumber | None
hash: MaskHash | None
operator: str
pass_through: MaskPassThrough | None
rand_pattern: MaskRandPattern | None
rand_regexify: MaskRandRegexify | None
redact: Dict[str, Any] | None
regex_replace: MaskRegexReplace | None
supported_data_types: List[str] | None
class heimdall.models.mask.MaskBucketDate(*, precision: str)[source]

Bases: BaseModel

precision: str
class heimdall.models.mask.MaskBucketNumber(*, buckets: List[int])[source]

Bases: BaseModel

buckets: List[int]
class heimdall.models.mask.MaskHash(*, algo: str)[source]

Bases: BaseModel

algo: str
class heimdall.models.mask.MaskPassThrough[source]

Bases: BaseModel

class heimdall.models.mask.MaskRandPattern(*, pattern: str)[source]

Bases: BaseModel

pattern: str
class heimdall.models.mask.MaskRandRegexify(*, pattern: str)[source]

Bases: BaseModel

pattern: str
class heimdall.models.mask.MaskRegexReplace(*, pattern: str, replacement: str)[source]

Bases: BaseModel

pattern: str
replacement: str

heimdall.models.secret_response module

class heimdall.models.secret_response.SecretResponse(*, id: str, data: List[Data], _links: Links)[source]

Bases: BaseModel

data: List[Data]
id: str

heimdall.models.token module

class heimdall.models.token.Token(*, name: str, expiration: str, type: str, data: Dict, user_id: str, _links: Links)[source]

Bases: BaseModel

data: Dict
expiration: str
name: str
type: str
user_id: str

heimdall.models.user module

class heimdall.models.user.User(*, name: str, type: str, id: str, email: str, cid: str, properties: List[Dict] | None = None, federated_user_id: str | None = None, federated_connector_id: str | None = None, tags: List[str] | None = None, _links: Links)[source]

Bases: BaseModel

cid: str
email: str
federated_connector_id: str | None
federated_user_id: str | None
id: str
name: str
properties: List[Dict] | None
tags: List[str] | None
type: str

Module contents