nucypher.characters.control.specifications

Submodules

class PolicyBaseSchema(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = , many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = , dump_only: Union[Sequence[str], Set[str]] = , partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)

Bases: nucypher.characters.control.specifications.base.BaseSchema

check_valid_n_and_m(data, **kwargs)
check_rate_or_value_not_both(data, **kwargs)
opts = <marshmallow.schema.SchemaOpts object>
class CreatePolicy(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = , many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = , dump_only: Union[Sequence[str], Set[str]] = , partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)

Bases: nucypher.characters.control.specifications.alice.PolicyBaseSchema

opts = <marshmallow.schema.SchemaOpts object>
class GrantPolicy(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = , many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = , dump_only: Union[Sequence[str], Set[str]] = , partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)

Bases: nucypher.characters.control.specifications.alice.PolicyBaseSchema

opts = <marshmallow.schema.SchemaOpts object>
class DerivePolicyEncryptionKey(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = , many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = , dump_only: Union[Sequence[str], Set[str]] = , partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)

Bases: nucypher.characters.control.specifications.base.BaseSchema

opts = <marshmallow.schema.SchemaOpts object>
class Revoke(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = , many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = , dump_only: Union[Sequence[str], Set[str]] = , partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)

Bases: nucypher.characters.control.specifications.base.BaseSchema

opts = <marshmallow.schema.SchemaOpts object>
class Decrypt(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = , many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = , dump_only: Union[Sequence[str], Set[str]] = , partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)

Bases: nucypher.characters.control.specifications.base.BaseSchema

opts = <marshmallow.schema.SchemaOpts object>
class PublicKeys(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = , many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = , dump_only: Union[Sequence[str], Set[str]] = , partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)

Bases: nucypher.characters.control.specifications.base.BaseSchema

opts = <marshmallow.schema.SchemaOpts object>
class BaseSchema(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = , many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = , dump_only: Union[Sequence[str], Set[str]] = , partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)

Bases: marshmallow.schema.Schema

class Meta

Bases: object

unknown = 'include'
handle_error(error, data, many, **kwargs)

Custom error handler function for the schema.

Parameters
  • error – The ValidationError raised during (de)serialization.

  • data – The original input data.

  • many – Value of many on dump or load.

  • partial – Value of partial on load.

New in version 2.0.0.

Changed in version 3.0.0rc9: Receives many and partial (on deserialization) as keyword arguments.

opts = <marshmallow.schema.SchemaOpts object>
class JoinPolicy(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = , many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = , dump_only: Union[Sequence[str], Set[str]] = , partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)

Bases: nucypher.characters.control.specifications.base.BaseSchema

opts = <marshmallow.schema.SchemaOpts object>
class Retrieve(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = , many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = , dump_only: Union[Sequence[str], Set[str]] = , partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)

Bases: nucypher.characters.control.specifications.base.BaseSchema

opts = <marshmallow.schema.SchemaOpts object>
class PublicKeys(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = , many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = , dump_only: Union[Sequence[str], Set[str]] = , partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)

Bases: nucypher.characters.control.specifications.base.BaseSchema

opts = <marshmallow.schema.SchemaOpts object>
class EncryptMessage(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = , many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = , dump_only: Union[Sequence[str], Set[str]] = , partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)

Bases: nucypher.characters.control.specifications.base.BaseSchema

format_method_arguments(data, **kwargs)

input can be through either the file input or a raw message, we output one of them as the “plaintext” arg to enrico.encrypt_message

opts = <marshmallow.schema.SchemaOpts object>
exception SpecificationError

Bases: ValueError

The protocol request is completely unusable

exception MissingField

Bases: nucypher.characters.control.specifications.exceptions.SpecificationError

The protocol request cannot be deserialized because it is missing required fields

exception InvalidInputData

Bases: nucypher.characters.control.specifications.exceptions.SpecificationError

Input data does not match the input specification

exception InvalidOutputData

Bases: nucypher.characters.control.specifications.exceptions.SpecificationError

Response data does not match the output specification

exception InvalidArgumentCombo

Bases: nucypher.characters.control.specifications.exceptions.SpecificationError

Arguments specified are incompatible