Skip to content

Conversation

@End-rey
Copy link

@End-rey End-rey commented Oct 20, 2025

Refs #241.

@End-rey End-rey self-assigned this Oct 20, 2025
@End-rey End-rey marked this pull request as draft October 20, 2025 14:57
@End-rey End-rey force-pushed the new-session-token-v2 branch from e65a42a to 11f58a6 Compare October 20, 2025 15:17
// Not valid before epoch, the first epoch when token is valid.
uint64 nbf = 2 [json_name = "nbf"];

// Issued at Epoch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Issued at Epoch
// Issued at epoch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, it was just copied, ok. but still dot at the end would look better according to other fields

// Account represents an identity in NeoFS.
// It can be either direct (OwnerID) or indirect (NNS domain).
message Account {
// Account identifier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most of the time, we add dots at the end of comments in this repo


// Account represents an identity in NeoFS.
// It can be either direct (OwnerID) or indirect (NNS domain).
message Account {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure such a general entity should be described in the session package?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would look better there for me, yes

@End-rey End-rey force-pushed the new-session-token-v2 branch from 11f58a6 to 694d30d Compare October 22, 2025 18:58
@End-rey End-rey requested a review from carpawell October 22, 2025 19:21
@End-rey End-rey force-pushed the new-session-token-v2 branch 2 times, most recently from b967342 to 7a51333 Compare October 23, 2025 11:20
refs/types.proto Outdated
message Account {
// Account identifier.
oneof identifier {
// Direct account reference via OwnerID (hash of public key).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hash of verification script to be more correct.

refs/types.proto Outdated
// Direct account reference via OwnerID (hash of public key).
OwnerID owner_id = 1 [json_name = "ownerID"];

// Indirect account reference via NeoFS Name Service.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the expected NNS contents? This should be described as well.

refs/types.proto Outdated

// Account represents an identity in NeoFS.
// It can be either direct (OwnerID) or indirect (NNS domain).
message Account {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Account is OwnerID, we need some other term for this entity.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mb Identity?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

session.Target is an option, we don't have any other users for it now.


// CreateV2Request is information necessary for creating a session token v2.
message CreateV2Request {
// Session creation request v2 body.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This most likely to be used as the last token in chain, so we need some way to pass this chain for auth.

// Extended version supporting multiple verbs and targets.
message ObjectSessionContextV2 {
// Object request verbs.
enum Verb {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we already have some set of verbs?


// Target resource specification.
message Target {
// Container where operation is allowed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional.

repeated Verb verbs = 1 [json_name = "verbs"];

// If true, applies to all containers owned by the subject.
bool wildcard = 2 [json_name = "wildcard"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't make much sense to me as a separate field, missing container_id is exactly that.

TokenLifetime lifetime = 5 [json_name = "lifetime"];

// Authorization context - what operations are allowed.
oneof context {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not both?

ObjectSessionContextV2 object = 6 [json_name = "object"];

// ContainerService authorization context.
ContainerSessionContextV2 container = 7 [json_name = "container"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can have a single set of object/container operations? I'm not sure what this separation buys us.

@End-rey End-rey force-pushed the new-session-token-v2 branch from 7a51333 to 45af0fd Compare October 23, 2025 18:40
@End-rey End-rey requested a review from roman-khimov October 23, 2025 18:40
@End-rey End-rey force-pushed the new-session-token-v2 branch 2 times, most recently from d863037 to f7f489d Compare October 31, 2025 14:50
@End-rey End-rey force-pushed the new-session-token-v2 branch from f7f489d to a4dfb59 Compare November 17, 2025 16:38
Session Token v2 solves the delegation, power of attorney, and chain-of-trust
problems. It enables:
- Account-based authority (direct or NNS-based indirect)
- Multi-account subjects (multiple entities can use same token)
- Multi-verb operations (GET, PUT, DELETE in single token)
- Delegation chains (verifiable like X.509 certificates)
- Indirect accounts (NeoFS Name Service resolution)

Refs #241.

Signed-off-by: Andrey Butusov <[email protected]>
@End-rey End-rey marked this pull request as ready for review November 17, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants