Documentation ¶
Index ¶
- func CreateOAuthTokenSource(source oauth2.TokenSource) *oAuthTokenSource
- type ITokenSource
- func ApiKeyTokenSource(secret string) (ITokenSource, error)
- func BasicAuthTokenSource(clientId string, secret string) (ITokenSource, error)
- func CreateTokenFromOAuthFlow(l logger.Logger, grantType string, clientId string, secret string, ...) (ITokenSource, error)
- func CreateTokenSource(l logger.Logger, schema discovery.SecuritySchema, clientId string, ...) (ITokenSource, error)
- func CreateTokenSourceFromSchemas(l logger.Logger, schemas []discovery.SecuritySchema, clientId string, ...) (ITokenSource, error)
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOAuthTokenSource ¶
func CreateOAuthTokenSource(source oauth2.TokenSource) *oAuthTokenSource
CreateOAuthTokenSource creates an oAuthTokenSource from a ITokenSource from the oauth2 library
Types ¶
type ITokenSource ¶
ITokenSource interface for creating new auth tokens
func ApiKeyTokenSource ¶
func ApiKeyTokenSource(secret string) (ITokenSource, error)
ApiKeyTokenSource creates a new apiKeyTokenSource for API key authentication
func BasicAuthTokenSource ¶
func BasicAuthTokenSource(clientId string, secret string) (ITokenSource, error)
BasicAuthTokenSource creates a new basicAuthTokenSource for basic authentication
func CreateTokenFromOAuthFlow ¶
func CreateTokenFromOAuthFlow(l logger.Logger, grantType string, clientId string, secret string, flow discovery.OAuthFlow) (ITokenSource, error)
CreateTokenFromOAuthFlow creates a ITokenSource for a OAuthFlow
func CreateTokenSource ¶
func CreateTokenSource(l logger.Logger, schema discovery.SecuritySchema, clientId string, secret string) (ITokenSource, error)
CreateTokenSource creates a new ITokenSource Uses the schema type (BasicSecSchemaType) to create a ITokenSource for the proper auth source
func CreateTokenSourceFromSchemas ¶
func CreateTokenSourceFromSchemas(l logger.Logger, schemas []discovery.SecuritySchema, clientId string, secret string) (ITokenSource, error)
CreateTokenSourceFromSchemas creates a new ITokenSource from the first schema in the slice
type Token ¶
Token object holding token information
func (*Token) CreateAuthHeader ¶
CreateAuthHeader returns a http Header holding the Authorization header from this token
func (*Token) CreateAuthHeaderValue ¶
CreateAuthHeaderValue creates the value for the Authorization header from this token
func (*Token) SetAuthHeader ¶
SetAuthHeader set the authorization header in a http Request using this token