antimatter.builders
#
Submodules#
Package Contents#
Classes#
Builder class for creating a CapabilityRule. |
|
Builder class for creating a list of FactPolicyRulesInner. |
|
Builder class for creating a FactPolicyRulesInnerArgumentsInner. |
|
A builder class for constructing a ReadContext object. |
|
Builder class for creating a ReadContextConfigRule. |
|
Builder class for creating a ReadContextConfigRuleFactArgument. |
|
Builder class for creating a settings patch. |
|
Builder class for creating WriteContext objects. |
|
Builder class for creating WriteContextConfigInfo objects. |
|
Builder class for creating a WriteContextRegexRule |
|
Enum class for defining the operator of the match expression. |
|
Enum class for defining the operation. |
|
Enum class for defining the result. |
|
Enum class for defining the source of a fact policy argument. |
|
Enum class for defining the operator of a fact policy. |
|
Enum representing the available hooks. |
|
Enum class for defining the principal type. |
|
Enum class for defining the type of identity provider. |
|
Enum class for defining the action of the rule. |
|
Enum class for defining the operator of the match expression. |
|
Enum class for defining the source of the match expression. |
|
Enum class for defining the format of the token. |
|
Enum class for defining the scope of the token. |
|
Enum class for defining the operation of a settings patch. |
|
Class representing the mode of the WriteContextHook. |
Functions#
Create a KeyInfos object with Antimatter delegated AWS key information |
|
|
Create a KeyInfos object with AWS service account key information |
|
Create a KeyInfos object with GCP service account key information |
- class antimatter.builders.CapabilityRulesBuilder(*rules)#
Builder class for creating a CapabilityRule.
- Parameters:
rules – A list of tuples containing the name, operator, and values of the match expression.
- with_rule(name: str, operator: antimatter.constants.CapabilityOperator | str | None, values: List[str] | None = None) CapabilityRulesBuilder #
Add a match expression to the rule.
- Parameters:
name – The name of the match expression.
operator – The operator of the match expression.
values – The values of the match expression.
- build() antimatter_api.CapabilityRule #
Build the rule.
- Returns:
The CapabilityRule which can be used to create a new capability.
- class antimatter.builders.FactPoliciesBuilder#
Builder class for creating a list of FactPolicyRulesInner.
- with_policy(name: str, operator: antimatter.constants.FactOperator | str, *policies: FactPolicyArgumentBuilder) FactPoliciesBuilder #
Add a policy to the list.
- Parameters:
name – The name of the policy.
operator – The operator of the policy.
policies – The arguments of the policy.
- Returns:
The builder instance.
- build() List[antimatter_api.FactPolicyRulesInner] #
Build the list of policies.
- Returns:
The built list of policies.
- class antimatter.builders.FactPolicyArgumentBuilder(source: str | antimatter.constants.FactArgumentSource, capability: str | None = None, any_value: bool | None = None, value: str | None = None)#
Builder class for creating a FactPolicyRulesInnerArgumentsInner.
- Parameters:
source – The source of the argument.
capability – The capability of the argument.
any_value – Whether the argument can be any value.
value – The value of the argument.
- build() antimatter_api.FactPolicyRulesInnerArgumentsInner #
Build the argument.
- Returns:
The built argument.
- class antimatter.builders.ReadContextBuilder#
A builder class for constructing a ReadContext object.
- set_summary(summary: str) ReadContextBuilder #
Sets the summary of the ReadContext.
- Parameters:
summary – The summary to set.
- Returns:
The instance of the builder.
- set_description(description: str) ReadContextBuilder #
Sets the description of the ReadContext.
- Parameters:
description – The description to set.
- Returns:
The instance of the builder.
- add_required_hook(name: antimatter.constants.Hook | str, constraint: str = '>1.0.0', write_context: str = None) ReadContextBuilder #
Adds a required hook to the ReadContext.
- Parameters:
name – The name of the hook.
constraint – The constraint of the hook.
write_context – The write context for the hook
- Returns:
The instance of the builder.
- add_read_parameter(key: str, required: bool, description: str) ReadContextBuilder #
Adds a read parameter to the ReadContext.
- Parameters:
key – The key of the parameter.
required – Whether the parameter is required.
description – The description of the parameter.
- Returns:
The instance of the builder.
- set_key_cache_ttl(ttl: int) ReadContextBuilder #
Sets the recommended TTL for client-side CapsuleOpenResponses associated with this ReadContext.
- Parameters:
ttl – The TTL to set.
- Returns:
The instance of the builder.
- set_disable_read_logging() ReadContextBuilder #
Instructs the client that read logging associated with this ReadContext can be skipped, which speeds up access to capsules.
- Returns:
This instance of the builder.
- build() antimatter_api.AddReadContext #
Builds the ReadContext and returns it.
- Returns:
The built ReadContext.
- class antimatter.builders.ReadContextRuleBuilder#
Builder class for creating a ReadContextConfigRule.
- add_match_expression(source: antimatter.constants.Source | str, key: str, operator: antimatter.constants.Operator | str, values: List[str] | None = None, value: str | None = None) ReadContextRuleBuilder #
Add a match expression to the rule.
- Parameters:
source – The source of the match expression.
key – The key of the match expression.
operator – The operator of the match expression.
values – The values of the match expression.
value – The value of the match expression.
- Returns:
The builder instance.
- set_action(action: antimatter.constants.Action | str) ReadContextRuleBuilder #
Set the action of the rule.
- Parameters:
action – The action of the rule.
- Returns:
The builder instance.
- set_token_scope(token_scope: antimatter.constants.TokenScope | str) ReadContextRuleBuilder #
Set the token scope of the rule.
- Parameters:
token_scope – The token scope of the rule.
- Returns:
The builder instance.
- set_token_format(token_format: antimatter.constants.TokenFormat | str) ReadContextRuleBuilder #
Set the token format of the rule.
- Parameters:
token_format – The token format of the rule.
- Returns:
The builder instance.
- set_priority(priority: int) ReadContextRuleBuilder #
Set the priority of the rule.
- Parameters:
priority – The priority of the rule.
- Returns:
The builder instance.
- add_fact(operator: antimatter.builders.fact_policy.FactOperator | str, name: str, arguments_builder: ReadContextRuleFactArgumentBuilder = None) ReadContextRuleBuilder #
Add a fact to the rule.
- Parameters:
operator – The operator of the fact.
name – The name of the fact.
arguments_builder – The arguments builder of the fact.
- Returns:
The builder instance.
- build() antimatter_api.NewReadContextConfigRule #
Build the rule.
- Returns:
The built rule.
- class antimatter.builders.ReadContextRuleFactArgumentBuilder#
Builder class for creating a ReadContextConfigRuleFactArgument.
- add_argument(source: antimatter.constants.Source | str, key: str = None, value: str = None) ReadContextRuleFactArgumentBuilder #
Add an argument to the fact.
- Parameters:
source – The source of the argument.
key – The key of the argument.
value – The value of the argument.
- Returns:
The builder instance.
- build() List[antimatter_api.ReadContextRuleFactsInnerArgumentsInner] #
Build the arguments.
- Returns:
The built arguments.
- class antimatter.builders.SettingsPatchBuilder#
Builder class for creating a settings patch.
- Parameters:
path – The path of the patch.
value – The value of the patch.
operation – The operation of the patch.
- path: str#
- value: bool | float | str | int#
- operation: antimatter.constants.PatchOperation | str#
- build() antimatter_api.PatchRequestInner #
Build the patch.
- Returns:
The built patch.
- class antimatter.builders.WriteContextBuilder#
Builder class for creating WriteContext objects.
- set_summary(summary: str) WriteContextBuilder #
Set the summary of the WriteContext.
- Parameters:
summary – The summary to set.
- Returns:
The WriteContextBuilder instance.
- set_description(description: str) WriteContextBuilder #
Set the description of the WriteContext.
- Parameters:
description – The description to set.
- Returns:
The WriteContextBuilder instance.
- add_hook(name: antimatter.constants.Hook | str, constraint: str = '>1.0.0', mode: antimatter.constants.WriteContextHookMode | str = WriteContextHookMode.Sync) WriteContextBuilder #
Add a hook to the WriteContext.
- Parameters:
name – The name of the hook.
constraint – The constraint of the hook.
mode – The mode of the hook.
- Returns:
The WriteContextBuilder instance.
- set_key_reuse_ttl(seconds: int) WriteContextBuilder #
Set the recommended key reuse TTL, which instructs the client to reuse encryption keys (and associated capsule IDs) for up to this duration in seconds.
- Parameters:
seconds – The TTL in seconds to set.
- Returns:
The WriteContextBuilder instance.
- build() antimatter_api.AddWriteContext #
Build the WriteContext.
- Returns:
The built WriteContext.
- class antimatter.builders.WriteContextConfigurationBuilder#
Builder class for creating WriteContextConfigInfo objects.
- add_hook(name: antimatter.constants.Hook | str, constraint: str = '>1.0.0', mode: antimatter.constants.WriteContextHookMode | str = WriteContextHookMode.Sync) WriteContextConfigurationBuilder #
Add a hook to the WriteContextConfigurationBuilder.
- Parameters:
name – The name of the hook.
constraint – The constraint of the hook.
mode – The mode of the hook.
- Returns:
The WriteContextConfigurationBuilder instance.
- set_key_reuse_ttl(seconds: int) WriteContextConfigurationBuilder #
Set the recommended key reuse TTL, which instructs the client to reuse encryption keys (and associated capsule IDs) for up to this duration in seconds.
- Parameters:
seconds – The TTL in seconds to set.
- Returns:
The WriteContextConfigurationBuilder instance.
- build() antimatter_api.WriteContextConfigInfo #
Build the WriteContextConfigInfo.
- Returns:
The built WriteContextConfigInfo.
- class antimatter.builders.WriteContextRegexRuleBuilder(pattern: str, match_on_key: bool = False)#
Builder class for creating a WriteContextRegexRule
- add_span_tag(name: str, tag_type: str | antimatter.tags.TagType = TagType.Unary, value: str | None = None) WriteContextRegexRuleBuilder #
The span tag to add when the regex rule matches
- Parameters:
name – The span tag name
tag_type – The span tag type; default ‘unary’
value – The span tag value, if the tag_type is not ‘unary’
- Returns:
The builder instance
- add_capsule_tag(name: str, tag_type: str | antimatter.tags.TagType = TagType.Unary, value: str | None = None) WriteContextRegexRuleBuilder #
The capsule tag to add when the regex rule matches
- Parameters:
name – The capsule tag name
tag_type – The capsule tag type; default ‘unary’
value – The capsule tag value, if the tag_type is not ‘unary’
- Returns:
The builder instance
- build() antimatter_api.WriteContextRegexRule #
Build the rule.
- Returns:
The built rule
- antimatter.builders.antimatter_delegated_aws_key_info(key_arn: str) antimatter_api.KeyInfos #
Create a KeyInfos object with Antimatter delegated AWS key information
Example usage:
key_info = antimatter_delegated_aws_key_info(key_arn="key_arn")
- Parameters:
key_arn – The key ARN
- Returns:
A KeyInfos object with the specified key information
- antimatter.builders.aws_service_account_key_info(access_key_id: str, secret_access_key: str, key_arn: str = '') antimatter_api.KeyInfos #
Create a KeyInfos object with AWS service account key information
Example usage:
key_info = aws_service_account_key_info( access_key_id="access_key_id", secret_access_key="secret_access_key", key_arn="key_arn" )
- Parameters:
access_key_id – The access key ID
secret_access_key – The secret access key
key_arn – The key ARN
- Returns:
A KeyInfos object with the specified key information
- antimatter.builders.gcp_service_account_key_info(project_id: str, location: str, key_ring_id: str = '', key_id: str = '', service_account_credentials: str = '', service_account_credentials_path: str = '') antimatter_api.KeyInfos #
Create a KeyInfos object with GCP service account key information
Example usage:
key_info = gcp_service_account_key_info( project_id="project_id", location="location", key_ring_id="key_ring_id", key_id="key_id", service_account_credentials="<service_account_credentials_as_json_string>", service_account_credentials_path="/path/to/service_account_credentials.json" )
Either service_account_credentials or service_account_credentials_path should be provided.
- Parameters:
project_id – The project ID
location – The location
key_ring_id – The key ring ID
key_id – The key ID
service_account_credentials – The service account credentials as JSON string
service_account_credentials_path – The path to the service account credentials
- Returns:
A KeyInfos object with the specified key information
- class antimatter.builders.CapabilityOperator#
Bases:
str
,enum.Enum
Enum class for defining the operator of the match expression.
- In = 'In'#
- NotIn = 'NotIn'#
- Exists = 'Exists'#
- NotExists = 'NotExists'#
- class antimatter.builders.Operation#
Bases:
str
,enum.Enum
Enum class for defining the operation.
- Edit = 'edit'#
- View = 'view'#
- Use = 'use'#
- class antimatter.builders.Result#
Bases:
str
,enum.Enum
Enum class for defining the result.
- Allow = 'allow'#
- Deny = 'deny'#
- class antimatter.builders.FactArgumentSource#
Bases:
str
,enum.Enum
Enum class for defining the source of a fact policy argument.
- DomainIdentity = 'domainIdentity'#
- Literal = 'literal'#
- Any = 'any'#
- class antimatter.builders.FactOperator#
Bases:
str
,enum.Enum
Enum class for defining the operator of a fact policy.
- Exists = 'Exists'#
- NotExists = 'NotExists'#
- class antimatter.builders.Hook#
Bases:
str
,enum.Enum
Enum representing the available hooks.
- Fast = 'fast-pii'#
- Accurate = 'accurate-pii'#
- Regex = 'regex-classifier'#
- Datastructure = 'data-structure-classifier'#
- class antimatter.builders.PrincipalType#
Bases:
str
,enum.Enum
Enum class for defining the principal type.
- ApiKey = 'APIKey'#
- Email = 'Email'#
- HostedDomain = 'HostedDomain'#
- class antimatter.builders.ProviderType#
Bases:
str
,enum.Enum
Enum class for defining the type of identity provider.
- GoogleOAuth = 'GoogleOAuth'#
- ApiKey = 'APIKey'#
- class antimatter.builders.Action#
Bases:
str
,enum.Enum
Enum class for defining the action of the rule.
- DenyCapsule = 'DenyCapsule'#
- DenyRecord = 'DenyRecord'#
- Redact = 'Redact'#
- Tokenize = 'Tokenize'#
- Allow = 'Allow'#
- class antimatter.builders.Operator#
Bases:
str
,enum.Enum
Enum class for defining the operator of the match expression.
- In = 'In'#
- NotIn = 'NotIn'#
- Exists = 'Exists'#
- NotExists = 'NotExists'#
- DateDeltaLessThan = 'DateDeltaLessThan'#
- DateDeltaGreaterThan = 'DateDeltaGreaterThan'#
- class antimatter.builders.Source#
Bases:
str
,enum.Enum
Enum class for defining the source of the match expression.
- DomainIdentity = 'domainIdentity'#
- ReadParameters = 'readParameters'#
- Tags = 'tags'#
- Literal = 'literal'#
- class antimatter.builders.TokenFormat#
Bases:
str
,enum.Enum
Enum class for defining the format of the token.
- Explicit = 'explicit'#
- Synthetic = 'synthetic'#
- class antimatter.builders.TokenScope#
Bases:
str
,enum.Enum
Enum class for defining the scope of the token.
- Unique = 'unique'#
- Capsule = 'capsule'#
- Domain = 'domain'#