git.frostfs.info/TrueCloudLab/frostfs-sdk-go@v0.0.0-20241022124111-5361f0ecebd3/session/doc.go (about)

     1  /*
     2  Package session collects functionality of the FrostFS sessions.
     3  
     4  Sessions are used in FrostFS as a mechanism for transferring the power of attorney
     5  of actions to another network member.
     6  
     7  Session tokens represent proof of trust. Each session has a limited lifetime and
     8  scope related to some FrostFS service: Object, Container, etc.
     9  
    10  Both parties agree on a secret (private session key), the possession of which
    11  will be authenticated by a trusted person. The principal confirms his trust by
    12  signing the public part of the secret (public session key).
    13  
    14  	var tok Container
    15  	tok.ForVerb(VerbContainerDelete)
    16  	tok.SetAuthKey(trustedKey)
    17  	// ...
    18  
    19  	err := tok.Sign(principalKey)
    20  	// ...
    21  
    22  	// transfer the token to a trusted party
    23  
    24  The trusted member can perform operations on behalf of the trustee.
    25  
    26  Instances can be also used to process FrostFS API V2 protocol messages
    27  (see neo.fs.v2.accounting package in https://git.frostfs.info/TrueCloudLab/frostfs-api).
    28  
    29  On client side:
    30  
    31  	import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session"
    32  
    33  	var msg session.Token
    34  	tok.WriteToV2(&msg)
    35  
    36  	// send msg
    37  
    38  On server side:
    39  
    40  	// recv msg
    41  
    42  	var tok session.Container
    43  	tok.ReadFromV2(msg)
    44  
    45  	// process cnr
    46  
    47  Using package types in an application is recommended to potentially work with
    48  different protocol versions with which these types are compatible.
    49  */
    50  package session