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

Static session requests does not respect lifetime fields nbf and iat. #2028

Closed
abereziny opened this issue Nov 8, 2022 · 1 comment
Closed
Assignees
Labels
bug Something isn't working neofs-storage Storage node application issues U3 Regular

Comments

@abereziny
Copy link

abereziny commented Nov 8, 2022

When static session is created it have lifetime fields exp, nbf, iat.

Currently, only exp field is checked during requests.
nbf and iat are ignored.

  1. Create 2 object session tokens with expiration fields like:
"lifetime": {
            "exp": "100000000",
            "nbf": "<current epoch> + 1",
            "iat": "<current epoch>"
        },

and

"lifetime": {
            "exp": "100000000",
            "nbf": "<current epoch>",
            "iat": "<current epoch> + 10"
        },
  1. Sign both tokens
  2. Using these static session_tokens make 2 requests to grpc (one for each token)
neofs-cli --config wallet_config.yml object head --rpc-endpoint '172.26.163.161:8080' --wallet '38d0e55d-6cac-447d-97fc-954965271d09.json' --cid '5chibTkwxuxNEaS1JnK7oENZ9dVHU4RhjkgDa66kZu9N' --oid 'ApiU6rPXYMZN7GPS24MAEH2GAvBrn4mg8Cg4M3gtK6se' --json --session 'aff7610f-60bb-4e7b-b9d8-5c6ceb0bf352'

Expected Behavior

For both tokens there should be error with reason of failure

Error:
return code: 1 
Output: rpc error: read object header via client: status: code = 1024 message = malformed request <reason of failure>

Current Behavior

Both requests passed successfully

Autotests

in feature branch
https://github.com/abereziny/neofs-testcases/tree/feature/abereziny-add-object-static-session-tests
testsuites.session_token.test_object_session_token#test_static_session_start_at_next
testsuites.session_token.test_object_session_token#test_static_session_invalid_issued_epoch

@fyrchik
Copy link
Contributor

fyrchik commented Nov 12, 2022

Closed via #2041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working neofs-storage Storage node application issues U3 Regular
Projects
None yet
Development

No branches or pull requests

4 participants