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

Create status codes for session-related errors #191

Closed
fyrchik opened this issue Feb 7, 2022 · 5 comments · Fixed by #192
Closed

Create status codes for session-related errors #191

fyrchik opened this issue Feb 7, 2022 · 5 comments · Fixed by #192
Assignees

Comments

@fyrchik
Copy link
Contributor

fyrchik commented Feb 7, 2022

Currently there are 2 candidates https://github.com/nspcc-dev/neofs-node/blob/master/pkg/services/object/util/key.go#L13

@alexvanin
Copy link
Contributor

I suggest to move this issue to NeoFS API repository (like #189 and #190).

@alexvanin
Copy link
Contributor

alexvanin commented Feb 7, 2022

Also errSessionTokenExpired may be redundant on API level. Storage node will never produce such error after nspcc-dev/neofs-node#1133. If token is expired but still available on the storage node, it can return token not found API error anyway.

@fyrchik
Copy link
Contributor Author

fyrchik commented Feb 9, 2022

I think there is still a race condition in case of token expiration, so it is possible to get expired token from storage.

@alexvanin
Copy link
Contributor

alexvanin commented Feb 9, 2022

I think there is still a race condition in case of token expiration, so it is possible to get expired token from storage.

It is. My point was that those errors are pretty much the same? If it is expired and if it is not found, both indicate that client has to renew session token. Maybe it can be encoded as a detail, not the separate error code. I am not completely sure about that, though.

@fyrchik
Copy link
Contributor Author

fyrchik commented Feb 9, 2022

I agree they are essentially the same, just that an error message in case of expired token can be confusing. Maybe user-facing software should just tell token was not found or has expired, this way one status is enough. Anyway both errors should be processed in an equal fashion.

cthulhu-rider pushed a commit that referenced this issue Feb 21, 2022
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
@cthulhu-rider cthulhu-rider added this to the v2.12.0 milestone Feb 22, 2022
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 a pull request may close this issue.

3 participants