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

Add error 100 message #96

Merged
merged 2 commits into from
Oct 16, 2021
Merged

Add error 100 message #96

merged 2 commits into from
Oct 16, 2021

Conversation

v0idzz
Copy link
Contributor

@v0idzz v0idzz commented Oct 16, 2021

From my testing, error 100 happens when either digest or signature headers have invalid values.

@kuba2k2
Copy link
Collaborator

kuba2k2 commented Oct 16, 2021

What is the message returned by the server in case of this error code?

@v0idzz
Copy link
Contributor Author

v0idzz commented Oct 16, 2021

The message is Użytkownik nie jest uprawniony do przeglądania żądanych danych: <base64_string> where the base64_string can be decoded to: <canonical_url><some_other_base64_value><gmt_timestamp>. For example: api%2fmobile%2fregister%2fnew<base64_val_redacted>Sat, 16 Oct 2021 09:06:07 GMT.

Due to the fact I am unsure what the other base64 value is, I redacted it. Either way it surely is not a UTF-8 string.

@kuba2k2
Copy link
Collaborator

kuba2k2 commented Oct 16, 2021

Oh, okay. What happens if you try to access for example some other student's data?
I'm asking as I think I remember the error code 100 in more different situations, which would mean the exception's message needs to be more generic.

@kuba2k2
Copy link
Collaborator

kuba2k2 commented Oct 16, 2021

Yup, just checked it. When trying to access a different pupilId, the error is Użytkownik nie jest uprawniony do przeglądania żądanych danych, but without the Base64 string. For now, your solution in the API may be confusing, as it always returns a signature error.
I think checking for the presence of the B64 string should be enough, for now.

@v0idzz
Copy link
Contributor Author

v0idzz commented Oct 16, 2021

This should do the job.

@kapi2289 kapi2289 merged commit 4d2b20c into kapi2289:master Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants