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

Map error codes from The Things Join Server #7045

Open
4 of 6 tasks
johanstokking opened this issue Apr 23, 2024 · 0 comments
Open
4 of 6 tasks

Map error codes from The Things Join Server #7045

johanstokking opened this issue Apr 23, 2024 · 0 comments
Assignees
Milestone

Comments

@johanstokking
Copy link
Member

Summary

The Things Join Server returns various error codes which The Things Stack should understand better to improve the user experience.

Current Situation

Currently, when the device's claim authentication code (owner token) is wrong, TTJS returns 403 that is passed through to the client (Console), which suggests the user to sign-in again. Instead, this occassion should be mapped to 500 because it is bad configuration.

Why do we need this? Who uses it, and when?

We need not to confuse users to sign in again if server-to-server authentication failed or if a claim code is wrong.

Proposed Implementation

TTJS returns:

  • 401 if not authenticated as an AS = bad config, internal server error
  • 400 if the DevEUI is malformatted = client error, internal server error
  • 400 if the claim request is malformatted = client error, internal server error
  • 403 if the authenticated AS is not the AS in the claim request = client error, internal server error
  • 403 if the owner token is wrong

I.e. TTS cannot simply map a status code to another one, as some are reused (as they should be). Most notably, the last 403 is relevant to the end user, while the others are all bad config and should return 500.

The only way to implement this is to test the error message that TTJS returns. If it is 403 and the message is claim failed with given owner token, it should be mapped to 400 (Bad request) and the others should be 500 (Internal server error).

Contributing

  • I can help by doing more research.
  • I can help by implementing the feature after the proposal above is approved.
  • I can help by testing the feature before it's released.

Validation

Code of Conduct

@johanstokking johanstokking added the needs/triage We still need to triage this label Apr 23, 2024
@KrishnaIyer KrishnaIyer self-assigned this Apr 25, 2024
@KrishnaIyer KrishnaIyer added this to the v3.30.1 milestone Apr 25, 2024
@KrishnaIyer KrishnaIyer removed the needs/triage We still need to triage this label Apr 25, 2024
@KrishnaIyer KrishnaIyer modified the milestones: v3.30.1, v3.30.2 May 2, 2024
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

No branches or pull requests

2 participants