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 +153,21 @@ Context information for Session Tokens related to ContainerService requests.
147
153
| 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
154
149
155
156
+
<aname="neo.fs.v2.session.DelegationInfo"></a>
157
+
158
+
### Message DelegationInfo
159
+
DelegationInfo represents a single delegation in a chain of trust.
160
+
161
+
162
+
| Field | Type | Label | Description |
163
+
| ----- | ---- | ----- | ----------- |
164
+
| issuer |[Target](#neo.fs.v2.session.Target)|| Account that performed this delegation. |
165
+
| subject |[Target](#neo.fs.v2.session.Target)|| Account that received the delegation. |
166
+
| timestamp |[int64](#int64)|| Unix timestamp when this delegation was created. |
167
+
| verbs |[string](#string)| repeated | List of verbs authorized by this delegation. |
168
+
| 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 |
209
+
| 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
210
| bearer_token |[neo.fs.v2.acl.BearerToken](#neo.fs.v2.acl.BearerToken)||`BearerToken` with eACL overrides for the request |
189
211
| origin |[RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader)||`RequestMetaHeader` of the origin request |
190
212
| magic_number |[uint64](#uint64)|| NeoFS network magic. Must match the value for the network that the server belongs to. |
@@ -234,6 +256,30 @@ Verification info for the response signed by all intermediate nodes
234
256
| origin |[ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader)|| Chain of previous hops signatures |
235
257
236
258
259
+
<aname="neo.fs.v2.session.SessionContextV2"></a>
260
+
261
+
### Message SessionContextV2
262
+
SessionContextV2 carries unified context for both ObjectService and ContainerService requests.
| 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. |
280
+
| 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. |
281
+
282
+
237
283
<aname="neo.fs.v2.session.SessionToken"></a>
238
284
239
285
### Message SessionToken
@@ -256,23 +302,65 @@ Session Token body
256
302
| ----- | ---- | ----- | ----------- |
257
303
| id |[bytes](#bytes)|| Token identifier is a valid UUIDv4 in binary form |
258
304
| 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 |
305
+
| lifetime |[TokenLifetime](#neo.fs.v2.session.TokenLifetime)|| Lifetime of the session |
260
306
| session_key |[bytes](#bytes)|| Public key used in session |
| id |[bytes](#bytes)|| Token identifier (UUIDv4 in binary form). |
333
+
| issuer |[Target](#neo.fs.v2.session.Target)|| Account that issued this token (who signed it). |
334
+
| subjects |[Target](#neo.fs.v2.session.Target)| repeated | Accounts authorized by this token (who can use it). |
335
+
| lifetime |[TokenLifetime](#neo.fs.v2.session.TokenLifetime)|| Lifetime of this token. |
336
+
| context |[SessionContextV2](#neo.fs.v2.session.SessionContextV2)|| Unified session context for both object and container operations. |
337
+
| delegation_chain |[DelegationInfo](#neo.fs.v2.session.DelegationInfo)| repeated | Full history of authority delegation (chain of trust). |
338
+
339
+
340
+
<aname="neo.fs.v2.session.Target"></a>
341
+
342
+
### Message Target
343
+
Target account for SessionTokenV2.
344
+
It can be either direct (OwnerID) or indirect (NNS domain).
345
+
346
+
347
+
| Field | Type | Label | Description |
348
+
| ----- | ---- | ----- | ----------- |
349
+
| owner_id |[neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID)|| Direct account reference via OwnerID (hash of verification script). |
350
+
| 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. |
351
+
352
+
353
+
<aname="neo.fs.v2.session.TokenLifetime"></a>
354
+
355
+
### Message TokenLifetime
268
356
Lifetime parameters of the token. Field names taken from rfc7519.
269
357
270
358
271
359
| Field | Type | Label | Description |
272
360
| ----- | ---- | ----- | ----------- |
273
361
| exp |[uint64](#uint64)|| Expiration epoch, the last epoch when token is valid. |
274
362
| nbf |[uint64](#uint64)|| Not valid before epoch, the first epoch when token is valid. |
0 commit comments