Example #1
0
class RealmRolesUpdatedSchema(BaseSchema):
    __id__ = fields.String(required=True)
    __signal__ = fields.EnumCheckedConstant(BackendEvent.REALM_ROLES_UPDATED,
                                            required=True)
    organization_id = OrganizationIDField(required=True)
    author = DeviceIDField(required=True)
    realm_id = RealmIDField(required=True)
    user = UserIDField(required=True)
    role = RealmRoleField(required=True, allow_none=True)
Example #2
0
    class SCHEMA_CLS(BaseSignedDataSchema):
        type = fields.CheckedConstant("realm_role_certificate", required=True)
        realm_id = fields.UUID(required=True)
        user_id = UserIDField(required=True)
        role = RealmRoleField(required=True, allow_none=True)

        @post_load
        def make_obj(self, data: Dict[str, Any]) -> "RealmRoleCertificateContent":
            data.pop("type")
            return RealmRoleCertificateContent(**data)
Example #3
0
    class SCHEMA_CLS(BaseSchema):
        name = EntryNameField(required=True)
        id = EntryIDField(required=True)
        key = fields.SecretKey(required=True)
        encryption_revision = fields.Int(required=True,
                                         validate=validate.Range(min=0))
        encrypted_on = fields.DateTime(required=True)
        role_cached_on = fields.DateTime(required=True)
        role = RealmRoleField(required=True, allow_none=True)

        @post_load
        def make_obj(self, data: Dict[str, Any]) -> "WorkspaceEntry":
            return WorkspaceEntry(**data)