-
Notifications
You must be signed in to change notification settings - Fork 50
Cli session token v2 #3750
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
Cli session token v2 #3750
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3750 +/- ##
==========================================
- Coverage 26.51% 26.24% -0.28%
==========================================
Files 655 658 +3
Lines 41400 41823 +423
==========================================
- Hits 10979 10976 -3
- Misses 29416 29841 +425
- Partials 1005 1006 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3ec6321 to
3f4dd85
Compare
|
Currently, by default, I am creating new v2 tokens for requests in the CLI, which is causing errors in the tests. Perhaps I should leave the v1 tokens in this PR and create v2 tokens in the PR with node and IR processing? |
|
Yes, tests should still pass. |
3f4dd85 to
a61e781
Compare
| } | ||
|
|
||
| if !tok.AssertContainer(verb, cnrID) { | ||
| return fmt.Errorf("v2 session token does not authorize %v for container %s", verb, cnrID.String()) |
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.
hm, i believe, we need session.Verb to implement fmt.Stringer, otherwise it prints digits from SDK
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.
I thought about it, but looked at the previous ObjectVerb and ContainerVerb, which did not have a String method, so I did not create one for the new one.
@roman-khimov Do we need it?
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.
Yes, it's very convenient to have one.
a61e781 to
1857a2d
Compare
roman-khimov
left a comment
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.
How can I create a chain of sessions with this?
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.
Pull request overview
This PR adds support for V2 session tokens in the NeoFS CLI, introducing a new session create-v2 command and integrating V2 token handling into existing object and container operations.
- Adds
session create-v2command for creating V2 session tokens with multiple subjects and contexts - Updates SDK dependency to enable V2 token support
- Implements backward-compatible V2 token validation and usage in object and container operations
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Updates neofs-sdk-go dependency to version supporting V2 session tokens |
| go.sum | Updates checksums for neofs-sdk-go dependency |
| CHANGELOG.md | Documents new session create-v2 command and SDK update |
| docs/cli-commands/neofs-cli_session_create-v2.md | Adds documentation for new create-v2 command with usage examples |
| docs/cli-commands/neofs-cli_session.md | Adds reference to create-v2 subcommand |
| cmd/neofs-cli/modules/session/root.go | Registers create-v2 command |
| cmd/neofs-cli/modules/session/create_v2.go | Implements V2 session token creation with subject and context parsing |
| cmd/neofs-cli/modules/object/util_session_v2.go | Adds V2 token reading, validation, and verification for object operations |
| cmd/neofs-cli/modules/object/util.go | Integrates V2 token support with backward compatibility for V1 tokens |
| cmd/neofs-cli/modules/container/util_session_v2.go | Adds V2 token handling for container operations |
| cmd/neofs-cli/modules/container/set_eacl.go | Updates to support both V1 and V2 session tokens |
| cmd/neofs-cli/modules/container/delete.go | Updates to support both V1 and V2 session tokens |
| cmd/neofs-cli/modules/container/create.go | Updates to support both V1 and V2 session tokens |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Upgrade to a version with full support for the new v2 session tokens. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
1857a2d to
eeef24e
Compare
eeef24e to
e25c995
Compare
Use new session tokens v2 in object and container cli operations. Also make new command `session create-v2`. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
e25c995 to
37a032a
Compare
Part of #3671.