frostfs-sdk-go/session/doc.go
Pavel Pogodaev 6ce73790ea [#276] Merge repo with frostfs-api-go
Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
2024-10-22 14:05:12 +00:00

50 lines
1.3 KiB
Go

/*
Package session collects functionality of the FrostFS sessions.
Sessions are used in FrostFS as a mechanism for transferring the power of attorney
of actions to another network member.
Session tokens represent proof of trust. Each session has a limited lifetime and
scope related to some FrostFS service: Object, Container, etc.
Both parties agree on a secret (private session key), the possession of which
will be authenticated by a trusted person. The principal confirms his trust by
signing the public part of the secret (public session key).
var tok Container
tok.ForVerb(VerbContainerDelete)
tok.SetAuthKey(trustedKey)
// ...
err := tok.Sign(principalKey)
// ...
// transfer the token to a trusted party
The trusted member can perform operations on behalf of the trustee.
Instances can be also used to process FrostFS API V2 protocol messages
(see neo.fs.v2.accounting package in https://git.frostfs.info/TrueCloudLab/frostfs-api).
On client side:
import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session"
var msg session.Token
tok.WriteToV2(&msg)
// send msg
On server side:
// recv msg
var tok session.Container
tok.ReadFromV2(msg)
// process cnr
Using package types in an application is recommended to potentially work with
different protocol versions with which these types are compatible.
*/
package session