signing

package
v0.0.0-...-4a248c4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	GetAwsSigningKeyPath() string
	GetAwsSigningKeyID() string
	GetAzureSigningKey() string
}

Config for Signer

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

Signer capable of producing signed urls for various services

func NewSigner

func NewSigner(config Config) (*Signer, error)

NewSigner with all secret material configured

func (Signer) SignAzureURL

func (s Signer) SignAzureURL(url *url.URL, encryptionKeyID string) (string, error)

SignAzureURL with a token as the query param The token is valid for 6 hours. The URL remains unchanged otherwise

func (Signer) SignCloudfrontURL

func (s Signer) SignCloudfrontURL(path string, domain string, duration time.Duration) (string, error)

SignCloudfrontURL takes the path and the domain and returns a string with the following properties:

  • HTTPS
  • Unchanged path
  • QueryParameter "EncodedPolicy" with a url encoded string representing full signature parameters, needed for signed urls. The URL specified in the canned policy is truncated to the first 2 folders after the /out/v1/ part

For example: https://CLOUDFLARE-CDN.com/out/v1/2da6f0ab51344ff4a1048741da66d6df/1b5a8f5803a4459eb1bb430f8a79e524/2e0c61ef235f4945813fc7490745c8ff/index.m3u8?EncodedPolicy=<URL ENCODED POLICY>

func (Signer) SignWithPolicy

func (s Signer) SignWithPolicy(url string, policy *sign.Policy) (string, error)

SignWithPolicy is a wrapper for cloudfrontSigner.SignWithPolicy

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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