You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
@@ -147,6 +152,21 @@ Context information for Session Tokens related to ContainerService requests.
147
152
| container_id |[neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID)|| Particular container to which the action applies. Ignored if wildcard flag is set. |
148
153
149
154
155
+
<aname="neo.fs.v2.session.DelegationInfo"></a>
156
+
157
+
### Message DelegationInfo
158
+
DelegationInfo represents a single delegation in a chain of trust.
159
+
160
+
161
+
| Field | Type | Label | Description |
162
+
| ----- | ---- | ----- | ----------- |
163
+
| issuer |[Target](#neo.fs.v2.session.Target)|| Account that performed this delegation. |
164
+
| subject |[Target](#neo.fs.v2.session.Target)|| Account that received the delegation. |
165
+
| timestamp |[int64](#int64)|| Unix timestamp when this delegation was created. |
166
+
| verbs |[Verb](#neo.fs.v2.session.Verb)| repeated | List of verbs authorized by this delegation. |
167
+
| signature |[neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature)|| Signature of the issuer confirming this delegation record. The signature is created over the deterministic serialization of this DelegationInfo message excluding this field. |
| session_token |[SessionToken](#neo.fs.v2.session.SessionToken)|| Session token within which the request is sent |
208
+
| session_token_v2 |[SessionTokenV2](#neo.fs.v2.session.SessionTokenV2)|| Session token v2 with delegation chain support. If both session_token and session_token_v2 are set, session_token_v2 takes precedence. |
188
209
| bearer_token |[neo.fs.v2.acl.BearerToken](#neo.fs.v2.acl.BearerToken)||`BearerToken` with eACL overrides for the request |
189
210
| origin |[RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader)||`RequestMetaHeader` of the origin request |
190
211
| magic_number |[uint64](#uint64)|| NeoFS network magic. Must match the value for the network that the server belongs to. |
@@ -234,6 +255,19 @@ Verification info for the response signed by all intermediate nodes
234
255
| origin |[ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader)|| Chain of previous hops signatures |
235
256
236
257
258
+
<aname="neo.fs.v2.session.SessionContextV2"></a>
259
+
260
+
### Message SessionContextV2
261
+
SessionContextV2 carries unified context for both ObjectService and ContainerService requests.
262
+
263
+
264
+
| Field | Type | Label | Description |
265
+
| ----- | ---- | ----- | ----------- |
266
+
| container |[neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID)|| Container where operation is allowed. For container operations, this is the container being operated on. For object operations, this is the container holding the objects. |
267
+
| objects |[neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID)| repeated | Specific objects where operation is allowed. Only relevant for object operations. Empty list means all objects in the container. |
268
+
| verbs |[Verb](#neo.fs.v2.session.Verb)| repeated | Operations authorized for this context. |
269
+
270
+
237
271
<aname="neo.fs.v2.session.SessionToken"></a>
238
272
239
273
### Message SessionToken
@@ -256,23 +290,65 @@ Session Token body
256
290
| ----- | ---- | ----- | ----------- |
257
291
| id |[bytes](#bytes)|| Token identifier is a valid UUIDv4 in binary form |
258
292
| owner_id |[neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID)|| Identifier of the session initiator |
259
-
| lifetime |[SessionToken.Body.TokenLifetime](#neo.fs.v2.session.SessionToken.Body.TokenLifetime)|| Lifetime of the session |
293
+
| lifetime |[TokenLifetime](#neo.fs.v2.session.TokenLifetime)|| Lifetime of the session |
260
294
| session_key |[bytes](#bytes)|| Public key used in session |
| id |[bytes](#bytes)|| Token identifier (UUIDv4 in binary form). |
321
+
| issuer |[Target](#neo.fs.v2.session.Target)|| Account that issued this token (who signed it). |
322
+
| subjects |[Target](#neo.fs.v2.session.Target)| repeated | Accounts authorized by this token (who can use it). |
323
+
| lifetime |[TokenLifetime](#neo.fs.v2.session.TokenLifetime)|| Lifetime of this token. |
324
+
| contexts |[SessionContextV2](#neo.fs.v2.session.SessionContextV2)| repeated | Unified session contexts for both object and container operations. Multiple contexts allow authorization for different combinations. |
325
+
| delegation_chain |[DelegationInfo](#neo.fs.v2.session.DelegationInfo)| repeated | Full history of authority delegation (chain of trust). |
326
+
327
+
328
+
<aname="neo.fs.v2.session.Target"></a>
329
+
330
+
### Message Target
331
+
Target account for SessionTokenV2.
332
+
It can be either direct (OwnerID) or indirect (NNS domain).
333
+
334
+
335
+
| Field | Type | Label | Description |
336
+
| ----- | ---- | ----- | ----------- |
337
+
| owner_id |[neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID)|| Direct account reference via OwnerID (hash of verification script). |
338
+
| nns_name |[string](#string)|| Indirect account reference via NeoFS Name Service. NNS name is a domain name that resolves to an OwnerID through the 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. |
339
+
340
+
341
+
<aname="neo.fs.v2.session.TokenLifetime"></a>
342
+
343
+
### Message TokenLifetime
268
344
Lifetime parameters of the token. Field names taken from rfc7519.
269
345
270
346
271
347
| Field | Type | Label | Description |
272
348
| ----- | ---- | ----- | ----------- |
273
349
| exp |[uint64](#uint64)|| Expiration epoch, the last epoch when token is valid. |
274
350
| nbf |[uint64](#uint64)|| Not valid before epoch, the first epoch when token is valid. |
0 commit comments