forked from TrueCloudLab/frostfs-sdk-go
[#297] bearer: Update module docstring
Module top level docstring was referencing outdated APIs which do not exist anymore. Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
This commit is contained in:
parent
cb813e27a8
commit
afdc2d8340
1 changed files with 9 additions and 11 deletions
|
@ -1,19 +1,19 @@
|
||||||
/*
|
/*
|
||||||
Package bearer provides bearer token definition.
|
Package bearer provides bearer token definition.
|
||||||
|
|
||||||
Bearer token is attached to the object service requests, and it overwrites
|
Bearer token is attached to the object service requests, and it can override
|
||||||
extended ACL of the container. Mainly it is used to provide access of private
|
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.
|
data for specific user. Therefore, it must be signed by owner of the container.
|
||||||
|
|
||||||
Define bearer token by setting correct lifetime, extended ACL and owner ID of
|
Define bearer token by setting correct lifetime, APE policy and owner ID of
|
||||||
the user that will attach token to its requests.
|
the user that will attach token to its requests.
|
||||||
|
|
||||||
var bearerToken bearer.Token
|
var bearerToken bearer.Token
|
||||||
bearerToken.SetExpiration(500)
|
bearerToken.SetExp(500)
|
||||||
bearerToken.SetIssuedAt(10)
|
bearerToken.SetIat(10)
|
||||||
bearerToken.SetNotBefore(10)
|
bearerToken.SetNbf(10)
|
||||||
bearerToken.SetEACL(eaclTable)
|
bearerToken.SetAPEOverride(apeOverride)
|
||||||
bearerToken.SetOwner(ownerID)
|
bearerToken.ForUser(ownerID)
|
||||||
|
|
||||||
Bearer token must be signed by owner of the container.
|
Bearer token must be signed by owner of the container.
|
||||||
|
|
||||||
|
@ -24,8 +24,6 @@ sender can attach this bearer token to the object service requests:
|
||||||
|
|
||||||
import sdkClient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client"
|
import sdkClient "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client"
|
||||||
|
|
||||||
var headParams sdkClient.PrmObjectHead
|
response, err := client.ObjectHead(ctx, sdkClient.PrmObjectHead{BearerToken: bearerToken})
|
||||||
headParams.WithBearerToken(bearerToken)
|
|
||||||
response, err := client.ObjectHead(ctx, headParams)
|
|
||||||
*/
|
*/
|
||||||
package bearer
|
package bearer
|
||||||
|
|
Loading…
Reference in a new issue