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

Session token expiration value ignored in the request #1168

Closed
alexvanin opened this issue Feb 10, 2022 · 1 comment · Fixed by #1275
Closed

Session token expiration value ignored in the request #1168

alexvanin opened this issue Feb 10, 2022 · 1 comment · Fixed by #1275
Assignees
Labels
question Further information is requested
Milestone

Comments

@alexvanin
Copy link
Contributor

Session tokens are attached to requests in RequestMetaHeader by the clients. This token should contain correct owner ID, public key, and token ID. However there is also lifetime field which is most probably ignored. Lifetime expiration is stored in session token copy on storage node, but it is ignored in request.

E.g. when pool sends request, it ignores lifetime but it works fine.

// https://github.com/nspcc-dev/neofs-sdk-go/blob/b6abb02acec4d081f6a2c2abf0f845dd350fd749/pool/pool.go#L1002
func sessionTokenForOwner(id *owner.ID, cliRes *client.CreateSessionRes) *session.Token {
	st := session.NewToken()
	st.SetOwnerID(id)
	st.SetID(cliRes.ID())
	st.SetSessionKey(cliRes.PublicKey())

	return st
}

Is it okay? It seems like a bug, but expiration still checked in session token storage.

@fyrchik
Copy link
Contributor

fyrchik commented Mar 29, 2022

Expiration in token storage affects how long we should store the key, i.e. session lifetime.
At the same time one could create some tokens with a different lifetime but the same session key. In this case I would expect them to stop working after the expiration epoch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants