From afdc2d8340bbe9e38ff36b6185187a15400b3c23 Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Wed, 13 Nov 2024 10:41:25 +0300 Subject: [PATCH] [#297] bearer: Update module docstring Module top level docstring was referencing outdated APIs which do not exist anymore. Signed-off-by: Vitaliy Potyarkin --- bearer/doc.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/bearer/doc.go b/bearer/doc.go index c97ab483..256fae23 100644 --- a/bearer/doc.go +++ b/bearer/doc.go @@ -1,19 +1,19 @@ /* Package bearer provides bearer token definition. -Bearer token is attached to the object service requests, and it overwrites -extended ACL of the container. Mainly it is used to provide access of private +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, 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. var bearerToken bearer.Token - bearerToken.SetExpiration(500) - bearerToken.SetIssuedAt(10) - bearerToken.SetNotBefore(10) - bearerToken.SetEACL(eaclTable) - bearerToken.SetOwner(ownerID) + 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. @@ -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" - var headParams sdkClient.PrmObjectHead - headParams.WithBearerToken(bearerToken) - response, err := client.ObjectHead(ctx, headParams) + response, err := client.ObjectHead(ctx, sdkClient.PrmObjectHead{BearerToken: bearerToken}) */ package bearer