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 does not expire in the next epoch #2383

Closed
vvarg229 opened this issue Jun 14, 2023 · 3 comments
Closed

Static session does not expire in the next epoch #2383

vvarg229 opened this issue Jun 14, 2023 · 3 comments
Assignees
Labels
bug Something isn't working U3 Regular

Comments

@vvarg229
Copy link
Collaborator

The tests "Validate static session which expires at next epoch" and "Validate static session that is valid" do not work because the session token has not expired.

If I understand correctly, after the second tick of the epoch:

  1. First tick:
self.tick_epoch()
        head_object(
            user_wallet.path,
            container,
            object_id,
            self.shell,
            self.cluster.default_rpc_endpoint,
            session=token_start_at_next_epoch,
        )
  1. Second tick:
    self.tick_epoch()

we expect to get an error "session token has expired", but it's not happening:

COMMAND: neofs-cli --config /home/runner/work/neofs-node/neofs-node/neofs-testcases/wallet_config.yml object head --rpc-endpoint 's01.neofs.devenv:8080' --wallet '/home/runner/work/neofs-node/neofs-node/neofs-testcases/TemporaryDir/8f20109b-23f5-427c-b8b3-44a5124aa384.json' --cid '2LSsEJABGAwwJr4hqGUf6647mYwpsxajvbnAr1gnPbQL' --oid 'kgqiYoYiVSXBSJB19fMFixJi2VMKSar8mAhvrPSaYSq' --json --session '/home/runner/work/neofs-node/neofs-node/neofs-testcases/TemporaryDir/TestFilesDir/6a83bfce-0acb-401f-bd70-1db9d0e2cf76'
RETCODE: 0

STDOUT:
{"objectID":{"value":"CzEFno93OQJypfcPQjV5rD/ScQ/InaU5gTFhXzoMp24="}, "signature":{"key":"A0oRwfnyd1S2A9O94S6GdrHhHCI50V1AUn/XVgumd9ym", "signature":"owxarcx+i+oYOtv1P/j4IY1e2r0xC/liVBHiwJGsrvh09oHBy1+CYMfVgBHNV28LjXlk/WYubiY684Cf/QwybA==", "scheme":"ECDSA_RFC6979_SHA256"}, "header":{"version":{"major":2, "minor":13}, "containerID":{"value":"E9b4FxeolDM+QZ6zeHvIrP1dk+0XRpdPnhACdS6BqDE="}, "ownerID":{"value":"Nd5VJhaasv4m/ycf6cMo2h7bALR16UUpVw=="}, "creationEpoch":"105", "payloadLength":"201327592", "payloadHash":{"type":"SHA256", "sum":"7u+trBjtf5tLZOSFOcF7DHawhSybyYniu5jfjVwBoiU="}, "objectType":"REGULAR", "homomorphicHash":{"type":"TZ", "sum":"BEAbpsoj30AXWioBBBIQaiy8BfH565cPebAbML6bhPsW/7Uq6Mse5Ms/aTRCZ4unHJoCfgctHqAQ2V576RomCg=="}, "sessionToken":{"body":{"id":"UF2HcjxVS+OFWoALIYnT1Q==", "ownerID":{"value":"Nd5VJhaasv4m/ycf6cMo2h7bALR16UUpVw=="}, "lifetime":{"exp":"115", "nbf":"105", "iat":"105"}, "sessionKey":"A0oRwfnyd1S2A9O94S6GdrHhHCI50V1AUn/XVgumd9ym", "object":{"verb":"PUT", "target":{"container":{"value":"E9b4FxeolDM+QZ6zeHvIrP1dk+0XRpdPnhACdS6BqDE="}, "objects":[]}}}, "signature":{"key":"Ax0yV7TMsLgeLp7fAOXtM7ErgV84+wPCN/XQ24KxLQLd", "signature":"jZ1ioZ+vf5o+5Y5B4xuBlUBwhoXxVwPqBpw13ThmRuwPCIaBzHSRk4ORfKCH1SXWMi5IERHZkhT6IwP9SPuJiA==", "scheme":"ECDSA_RFC6979_SHA256"}}, "attributes":[{"key":"FileName", "value":"a67d5cdd-aa8d-4194-a47e-8eb1d771f3cb"}, {"key":"Timestamp", "value":"1686753128"}], "split":null}, "payload":""}

STDERR:

Start / End / Elapsed	 14:35:23.400490 / 14:35:23.849267 / 0:00:00.448777

See logs:
https://github.com/nspcc-dev/neofs-node/actions/runs/5267489783/jobs/9522807183
https://nspcc-dev.github.io/neofs-node/208/#categories/4b1b218519a23f484ef3888ffcf04b79/bcbea02514c8dda1/

Expected Behavior

We should get a message that the session token has expired.

Current Behavior

Steps to Reproduce (for bugs)

Run automated system tests.

Context

I'm trying to get consistently green tests.

Regression

Yes

Your Environment

Ubuntu-latest GitHub runner
neo-go 0.101.1
neofs-s3-authmate 0.27.0
neofs-cli c4f59679
neofs-adm c4f59679
neofs-ir c4f59679 
neofs-lens c4f59679 
neofs-cli c4f59679 
aws-cli/2.11.20 
Python/3.11.3 
Linux/5.15.0-1038-azure exe/x86_64.ubuntu.22 prompt/off
@vvarg229 vvarg229 added bug Something isn't working triage U3 Regular labels Jun 14, 2023
@vvarg229
Copy link
Collaborator Author

If it's really a bug, then the tests nspcc-dev/neofs-testcases#535 was falling correctly.

@roman-khimov roman-khimov added this to the v0.38.0 milestone Jun 14, 2023
@cthulhu-rider cthulhu-rider self-assigned this Jul 10, 2023
@cthulhu-rider
Copy link
Contributor

cthulhu-rider commented Jul 18, 2023

@vvarg229 IIUC we set exp to epoch N (99), and send request at epoch N. Currently, resulting behavior is expected and corresponds to the implementation: request is valid at epoch N and invalid starting from N+1

we have an open issue in protocol related to this topic nspcc-dev/neofs-api#253

if I didn't mess up the epoch numbers, i suggest to rework the test:

  • PASS at epoch exp
  • FAIL at epoch exp+1

@roman-khimov
Copy link
Member

No bug.

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

No branches or pull requests

3 participants