Skip to content

Commit

Permalink
fix(Corrected newauthentication schema)
Browse files Browse the repository at this point in the history
newauthetication in newauthentication response should be optional as it not sent if the password is wrong for the new auth reqest. Fixes #17. Also fixed typo in docs for the same (#18)
  • Loading branch information
Krolken committed Aug 26, 2021
1 parent 83ce4f4 commit b5e623a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/source/sos_access_protocol.rst
Expand Up @@ -398,7 +398,7 @@ XML Examples <requestnewauthenticationresponse>
<reference>46</reference>
<status>0</status>
<info>OK</info>
<authentication>8usedlb54a234md</authentication>
<newauthentication>8usedlb54a234md</newauthentication>
<arrivaltime>2006-12-24 15:00:00</arrivaltime>
</requestnewauthenticationresponse>
Expand Down
4 changes: 2 additions & 2 deletions sos_access/schemas.py
Expand Up @@ -160,7 +160,7 @@ class NewAuthResponse(SOSAccessRequest):
"""

def __init__(
self, status, info, new_authentication, arrival_time=None, reference=None
self, status, info, new_authentication=None, arrival_time=None, reference=None
):
self.reference = reference
self.status = status
Expand Down Expand Up @@ -438,7 +438,7 @@ class NewAuthResponseSchema(SOSAccessSchema):
)
info = marshmallow.fields.String(required=True, validate=[Length(min=1, max=255)])
new_authentication = marshmallow.fields.String(
required=True, validate=[Length(equal=15)], data_key="newauthentication"
required=False, validate=[Length(equal=15)], data_key="newauthentication"
)
arrival_time = marshmallow.fields.DateTime(
allow_none=True, data_key="arrivaltime", datetimeformat="rfc"
Expand Down

0 comments on commit b5e623a

Please sign in to comment.