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
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 <andrey@nspcc.io>
@End-rey End-rey marked this pull request as ready for review November 17, 2025 21:50
Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

But it looks good, pretty simple but powerful structure.

// Lifetime parameters of the token. Field names taken from rfc7519.
message TokenLifetime {
// Expiration epoch, the last epoch when token is valid.
// For SessionTokenV2 this is the last valid Unix timestamp.
Copy link
Member

Choose a reason for hiding this comment

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

  1. It's very different in semantics.
  2. Compatibility warning fires for the removal of old TokenLifetime, so we can keep it as is and add this new one for v2.

// NeoFS Name Service. The name must be a valid DNS-like domain name
// (e.g., "example.neofs") that is registered in the NNS contract on
// the Neo blockchain. The NNS record should contain a string record with
// the corresponding OwnerID value.
Copy link
Member

Choose a reason for hiding this comment

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

Mention NEP-18?

// Account that issued this token (who signed it).
Target issuer = 3 [json_name = "issuer"];

// Accounts authorized by this token (who can use it).
Copy link
Member

Choose a reason for hiding this comment

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

We need some limits for all repeated fields.

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