google

package
v0.0.0-...-d0ed98c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2022 License: Apache-2.0, MPL-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignString

func SignString(toSign []byte, cfg *jwt.Config) ([]byte, error)

SignString calculates the SHA256 signature of the input string

Types

type UrlData

type UrlData struct {
	JwtConfig   *jwt.Config
	ContentMd5  string
	ContentType string
	HttpMethod  string
	Expires     int
	HttpHeaders map[string]string
	Path        string
}

UrlData stores the values required to create a Signed Url

func (*UrlData) EncodedSignature

func (u *UrlData) EncodedSignature() (string, error)

EncodedSignature returns the Signature() after base64 encoding and url escaping

func (*UrlData) Signature

func (u *UrlData) Signature() ([]byte, error)

func (*UrlData) SignedUrl

func (u *UrlData) SignedUrl() (string, error)

SignedUrl constructs the final signed URL a client can use to retrieve storage object

func (*UrlData) SigningString

func (u *UrlData) SigningString() []byte

SigningString creates a string representation of the UrlData in a form ready for signing: see https://cloud.google.com/storage/docs/access-control/create-signed-urls-program Example output: ------------------- GET

1388534400 bucket/objectname -------------------

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL