forked from TrueCloudLab/frostfs-sdk-go
Vitaliy Potyarkin
afdc2d8340
Module top level docstring was referencing outdated APIs which do not exist anymore. Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
29 lines
1,015 B
Go
29 lines
1,015 B
Go
/*
|
|
Package bearer provides bearer token definition.
|
|
|
|
Bearer token is attached to the object service requests, and it can override
|
|
APE policy set on the container. Mainly it is used to provide access to private
|
|
data for specific user. Therefore, it must be signed by owner of the container.
|
|
|
|
Define bearer token by setting correct lifetime, APE policy and owner ID of
|
|
the user that will attach token to its requests.
|
|
|
|
var bearerToken bearer.Token
|
|
bearerToken.SetExp(500)
|
|
bearerToken.SetIat(10)
|
|
bearerToken.SetNbf(10)
|
|
bearerToken.SetAPEOverride(apeOverride)
|
|
bearerToken.ForUser(ownerID)
|
|
|
|
Bearer token must be signed by owner of the container.
|
|
|
|
err := bearerToken.Sign(privateKey)
|
|
|
|
Provide signed token in JSON or binary format to the request sender. Request
|
|
sender can attach this bearer token to the object service requests:
|
|
|
|
import sdkClient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client"
|
|
|
|
response, err := client.ObjectHead(ctx, sdkClient.PrmObjectHead{BearerToken: bearerToken})
|
|
*/
|
|
package bearer
|