Sereto types
sereto.sereto_types
¶
TypeCategories = list[TypeCategoryName]
module-attribute
¶
Type for set of categories.
The values should meet the following requirements:
- It can only contain letters (
a-zA-Z), numbers (0-9), underscore (_), dash (-), and dot (.). - It should be between 1 and 20 characters long.
Example
You can provide values such as dast, sast (or DAST, SAST), etc.
TypeCategoryName = Annotated[str, StringConstraints(pattern='^[a-zA-Z0-9._-]{1,20}$', strict=True)]
module-attribute
¶
Type for category name.
The value should meet the following requirements:
- It can only contain letters (
a-zA-Z), numbers (0-9), underscore (_), dash (-), and dot (.). - It should be between 1 and 20 characters long.
TypeNonce12B = Annotated[SecretBytes, Len(12, 12), Strict(), AfterValidator(_zero_bytes)]
module-attribute
¶
Type for a 12 byte long nonce.
Using SecretBytes prevents the nonce from being printed in logs or tracebacks.
The value must contain at least one non-zero byte. This check is in place to prevent unintentional errors.
TypePassword = Annotated[SecretStr, Strict(), Len(8, 100)]
module-attribute
¶
Type for password.
Using SecretStr prevents the password from being printed in logs or tracebacks.
The value should meet the following requirements:
- It should be between 8 and 100 characters long.
TypePathName = Annotated[str, StringConstraints(pattern='^[a-zA-Z0-9._-]{1,100}$', strict=True)]
module-attribute
¶
Type for path name.
The value should meet the following requirements:
- It can only contain letters (
a-zA-Z), numbers (0-9), underscore (_), dash (-), and dot (.). - It should be between 1 and 100 characters long.
TypeProjectId = Annotated[str, StringConstraints(pattern='^[a-zA-Z0-9._-]{1,20}$', strict=True)]
module-attribute
¶
Type for project ID.
The value should meet the following requirements:
- It can only contain letters (
a-zA-Z), numbers (0-9), underscore (_), dash (-), and dot (.). - It should be between 1 and 20 characters long.
TypeRisk = Annotated[Risk, BeforeValidator(_coerce_risk)]
module-attribute
¶
Type for Risk enum with automatic coercion from string.
Accepts either a Risk enum value or a string that can be converted to Risk.
TypeRiskOptional = Annotated[Risk | None, BeforeValidator(_coerce_risk_optional)]
module-attribute
¶
Type for optional Risk enum with automatic coercion from string.
Accepts either a Risk enum value, a string that can be converted to Risk, or None.
TypeSalt16B = Annotated[SecretBytes, Len(16, 16), Strict(), AfterValidator(_zero_bytes)]
module-attribute
¶
Type for a 16 byte long salt.
Using SecretBytes prevents the salt from being printed in logs or tracebacks.
The value must contain at least one non-zero byte. This check is in place to prevent unintentional errors.