-
Notifications
You must be signed in to change notification settings - Fork 18
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 checks for lifetime, expire_at flags #621
Conversation
Doesn't this PR: nspcc-dev/neofs-sdk-go#503 fix this problem? |
It's a different thing, here we add some tests for CLI utilities/network logic around expirations. That PR improves session token handling in SDK to solve spurious gateway error problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- too long commit headings (~60 chars preferred, 80 is a must)
- commit messages don't have component prefixes
- e04bc70 can't close Add expire-at/lifetime flags check #612, it only lays some foundation for it
'get range hash' command doesn't work with the generated token
It's a protocol issue. Please add it to https://github.com/nspcc-dev/neofs-api/ and please add getrange
to the token, getrangehash
can't work on its own and won't do that.
I have to set expire_at=current_epoch + 2 during the token creation to have the same behavior as with lifetime=1
This needs to be checked at the node side (please add an issue), if it can be reproduced on every run then the test should be disabled for now.
test_session_token_expiration_flags, seems like expire-at param for a session token doesn't have any effect. Lifetime works ok
Please add a node issue and disable the test temporarily.
Signed-off-by: Evgeniy Zayats <zayatsevgeniy@nspcc.io>
Signed-off-by: Evgeniy Zayats <zayatsevgeniy@nspcc.io>
Test to validate lifetime, expire_at params Signed-off-by: Evgeniy Zayats <zayatsevgeniy@nspcc.io>
Add proper checks for lifetime, expire_at params Signed-off-by: Evgeniy Zayats <zayatsevgeniy@nspcc.io>
Add proper checks for lifetime, expire_at params Signed-off-by: Evgeniy Zayats <zayatsevgeniy@nspcc.io>
c3c84ca
to
b2e494d
Compare
Added issues, updated commits, disabled failing tests. Didn't get the part with: |
To validate session token expiration flags - lifetime, expire_at Signed-off-by: Evgeniy Zayats <zayatsevgeniy@nspcc.io>
b2e494d
to
3b5877a
Compare
Signed-off-by: Evgeniy Zayats <zayatsevgeniy@nspcc.io>
One more thing - in my opinion CLI tests that check just CLI code (e.g. that lifetime and expire-at flags are mutually exclusive, or the generation of a bearer token) should be done in other type of tests, more low level (component). Tests here are too expensive to do checks like these. We can't add them here as much as we can - eventually we will be out of resources in any case. So I suggest to start adding more tests in PRs like this - nspcc-dev/neofs-node#2521, written in go and with the whole system mocked, just to validate that CLI logic works. |
IIUC your token has one operation enabled with all others disabled. A token with getrangehash only is dysfunctional as you've noticed already and the reason is that you can't have getrangehash working with getrange disabled, so if you're to add both to the token it'll work. |
No, token should has all operations enabled, it was generated with the following acl:
|
Huh. Then it's a different bug, please add to neofs-node repo. |
Currently there are multiple problems here (allure with logs is attached):
In the logs there are the following entries:
All other commands work as expected. It only happens on get range hash
Same test test_bearer_token_expiration, I set lifetime=1 and expire_at=current_epoch + 1 and I expect that the token will expire after 2 epoch ticks. In other scenarios it works ok. But here, I have to set expire_at=current_epoch + 2 during the token creation to have the same behavior as with lifetime=1. It seems strange.
Another new test - test_session_token_expiration_flags, seems like expire-at param for a session token doesn't have any effect. Lifetime works ok.
All failures are in the attached allure - allure.tar.gz or here - https://github.com/evgeniiz321/neofs-node/suites/15662779232/artifacts/894066888