Documentation ¶
Index ¶
- Constants
- func AnonymizeHeaders(headers http.Header) http.Header
- func AnonymizeJWTHeaders(headers http.Header) http.Header
- func AnonymizeTokenHeaders(headers http.Header) http.Header
- func HideJWT(token string) string
- func HideSecretKey(k string) string
- type AccessKeyOnly
- type Auth
- type JWT
- type NoAuth
- type Token
Constants ¶
View Source
const XAuthTokenHeader = "X-Auth-Token" // #nosec G101
XAuthTokenHeader is Scaleway standard auth header
View Source
const XSessionTokenHeader = "x-session-token" // #nosec G101
XSessionTokenHeader is Scaleway auth header for browser
Variables ¶
This section is empty.
Functions ¶
func HideSecretKey ¶
Types ¶
type AccessKeyOnly ¶
type AccessKeyOnly struct { // auth config may contain an access key without being authenticated AccessKey string }
func NewAccessKeyOnly ¶
func NewAccessKeyOnly(accessKey string) *AccessKeyOnly
NewNoAuth return an auth with no authentication method
func (*AccessKeyOnly) AnonymizedHeaders ¶
func (t *AccessKeyOnly) AnonymizedHeaders() http.Header
func (*AccessKeyOnly) Headers ¶
func (t *AccessKeyOnly) Headers() http.Header
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 JWT ¶
type JWT struct {
Token string
}
JWT is the session token used in browser.
func (*JWT) AnonymizedHeaders ¶
AnonymizedHeaders returns an anonymized version of Headers() This method could be used for logging purpose.
type Token ¶
Token is the pair accessKey + secretKey. This type is public because it's an internal package.
func (*Token) AnonymizedHeaders ¶
AnonymizedHeaders returns an anonymized version of Headers() This method could be use for logging purpose.
Click to show internal directories.
Click to hide internal directories.