Support new session token v2 decoding #455

Open
opened 2025-12-28 18:16:24 +00:00 by sami · 0 comments
Owner

Originally created by @End-rey on GitHub (Dec 26, 2025).

I'm always frustrated when we get a new session token v2 and get errors like Failed: failed to decode JSON output: 'NoneType' object is not subscriptable because the sessionToken field becomes NoneType and a new sessionTokenV2 field appears, which needs to be decoded correctly.

Describe the solution you'd like

Here, check None and create a new function decode_session_tokenv2:
nspcc-dev/neofs-testcases@06d326990e/pytest_tests/lib/helpers/json_transformers.py (L78-L87)

Also here make check for new session token:
nspcc-dev/neofs-testcases@06d326990e/pytest_tests/lib/helpers/storage_object_info.py (L46-L64)

I haven't found any more mentions of session tokens that are broken, but if there are any, add support for new tokens as well.

Describe alternatives you've considered

There is no alternative. We need to add support for new session tokens in the tests.

Additional context

https://rest.fs.neo.org/Aku38wpn2xEqfEPxmwyAa7N3VnAkMV8PEVkpLqwKM1z3/4604-1766766224/index.html#suites/87d8da5f92824d091055170c29079bc0/24ddf0e403008103/
Refs https://github.com/nspcc-dev/neofs-node/pull/3671.

Originally created by @End-rey on GitHub (Dec 26, 2025). ## Is your feature request related to a problem? Please describe. <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when ... --> I'm always frustrated when we get a new session token v2 and get errors like `Failed: failed to decode JSON output: 'NoneType' object is not subscriptable` because the `sessionToken` field becomes `NoneType` and a new `sessionTokenV2` field appears, which needs to be decoded correctly. ## Describe the solution you'd like <!-- A clear and concise description of what you want to happen. --> Here, check `None` and create a new function `decode_session_tokenv2`: https://github.com/nspcc-dev/neofs-testcases/blob/06d326990e21568f13509d8d6dd4043d76aff6ad/pytest_tests/lib/helpers/json_transformers.py#L78-L87 Also here make check for new session token: https://github.com/nspcc-dev/neofs-testcases/blob/06d326990e21568f13509d8d6dd4043d76aff6ad/pytest_tests/lib/helpers/storage_object_info.py#L46-L64 I haven't found any more mentions of session tokens that are broken, but if there are any, add support for new tokens as well. ## Describe alternatives you've considered <!-- A clear and concise description of any alternative solutions or features you've considered. --> There is no alternative. We need to add support for new session tokens in the tests. ## Additional context <!-- Add any other context or screenshots about the feature request here. --> https://rest.fs.neo.org/Aku38wpn2xEqfEPxmwyAa7N3VnAkMV8PEVkpLqwKM1z3/4604-1766766224/index.html#suites/87d8da5f92824d091055170c29079bc0/24ddf0e403008103/ Refs https://github.com/nspcc-dev/neofs-node/pull/3671.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-testcases#455
No description provided.