Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation error in type IndyProofReqAttrSpecNonRevoked (via IndyProofReqAttrSpec via IndyProofRequest) #65

Closed
morrieinmaas opened this issue Oct 28, 2021 · 0 comments · Fixed by #69

Comments

@morrieinmaas
Copy link
Collaborator

morrieinmaas commented Oct 28, 2021

The from_ and to attrs validators seem to be wrong in non_revoked. Following error encountered:

pydantic.error_wrappers.ValidationError: 2 validation errors for IndyProofRequest
E   requested_attributes -> additionalProp1 -> non_revoked -> from
E     from_ must be less than -1, currently 1640995199 (type=value_error)
E   requested_attributes -> additionalProp1 -> non_revoked -> to
E     to must be less than -1, currently 1640995199 (type=value_error)

similar errors have been encountered before. The value should not as the validator suggests in aries_cloudcontroller/model/indy_proof_req_attr_spec_non_revoked.py be less than -1 (to) and larger 0 (from_). Both should just be positive integers(?) since according to aca-py swagger these values are seconds since unix epoch values.

actually this just seems off:

from aries_cloudcontroller/model/indy_proof_req_attr_spec_non_revoked.py

@validator("from_")
    def from__max(cls, value):
        # Property is optional
        if value is None:
            return

        if value > -1:
            raise ValueError(f"from_ must be less than -1, currently {value}")
        return value

    @validator("from_")
    def from__min(cls, value):
        # Property is optional
        if value is None:
            return

        if value < 0:
            raise ValueError(f"from_ must be greater than 0, currently {value}")
        return value

    @validator("to")
    def to_max(cls, value):
        # Property is optional
        if value is None:
            return

        if value > -1:
            raise ValueError(f"to must be less than -1, currently {value}")
        return value

    @validator("to")
    def to_min(cls, value):
        # Property is optional
        if value is None:
            return

        if value < 0:
            raise ValueError(f"to must be greater than 0, currently {value}")
        return value
TimoGlastra added a commit that referenced this issue Nov 10, 2021
Fixes #65
See issue in ACA-Py: openwallet-foundation/acapy#1485

Signed-off-by: Timo Glastra <timo@animo.id>
TimoGlastra added a commit that referenced this issue Nov 10, 2021
Fixes #65
See issue in ACA-Py: openwallet-foundation/acapy#1485

Signed-off-by: Timo Glastra <timo@animo.id>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant