1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
8 "git.curoverse.com/arvados.git/sdk/go/keepclient"
12 // SignLocator takes a blobLocator, an apiToken and an expiry time, and
13 // returns a signed locator string.
14 func SignLocator(blobLocator, apiToken string, expiry time.Time) string {
15 return keepclient.SignLocator(blobLocator, apiToken, expiry, theConfig.BlobSignatureTTL.Duration(), theConfig.blobSigningKey)
18 // VerifySignature returns nil if the signature on the signedLocator
19 // can be verified using the given apiToken. Otherwise it returns
20 // either ExpiredError (if the timestamp has expired, which is
21 // something the client could have figured out independently) or
23 func VerifySignature(signedLocator, apiToken string) error {
24 err := keepclient.VerifySignature(signedLocator, apiToken, theConfig.BlobSignatureTTL.Duration(), theConfig.blobSigningKey)
25 if err == keepclient.ErrSignatureExpired {
27 } else if err != nil {
28 return PermissionError