auth

package
v1.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const XAuthTokenHeader = "X-Auth-Token"

XAuthTokenHeader is Scaleway standard auth header

Variables

This section is empty.

Functions

func HideSecretKey

func HideSecretKey(k string) string

func NewNoAuth

func NewNoAuth() *noAuth

NewNoAuth return an auth with no authentication method

Types

type Auth

type Auth interface {
	// Headers returns headers that must be add to the http request
	Headers() http.Header

	// AnonymizedHeaders returns an anonymised version of Headers()
	// This method could be use for logging purpose.
	AnonymizedHeaders() http.Header
}

Auth implement methods required for authentication. Valid authentication are currently a token or no auth.

type Token

type Token struct {
	AccessKey string
	SecretKey string
}

Token is the pair accessKey + secretKey. This type is public because it's an internal package.

func NewToken

func NewToken(accessKey, secretKey string) *Token

NewToken create a token authentication from an access key and a secret key

func (*Token) AnonymizedHeaders

func (t *Token) AnonymizedHeaders() http.Header

AnonymizedHeaders returns an anonymized version of Headers() This method could be use for logging purpose.

func (*Token) Headers

func (t *Token) Headers() http.Header

Headers returns headers that must be add to the http request

Jump to

Keyboard shortcuts

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