auth

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNonce

func GenerateNonce() string

Generate a random string of 8 chars, needed for OAuth1 signatures.

func GenerateOAuth1Signature

func GenerateOAuth1Signature(key string, base string) string

Generate an OAuth1 "signature" for API requests.

func GenerateOAuth1SigningBaseString

func GenerateOAuth1SigningBaseString(http_method string, endpoint *url.URL, args *url.Values) string

Generate an OAuth1 "base string" for generating request signatures.

Types

type AccessToken

type AccessToken interface {
	// A permanent access token associatin an application to a user account.
	Token() string
	// A permanent secret key for an access token.
	Secret() string
}

Common interface for authentication access tokens

func UnmarshalOAuth1AccessToken

func UnmarshalOAuth1AccessToken(str_q string) (AccessToken, error)

Unmarshal an OAuth1 query-encoded access token response in to an AccessToken instance.

type AuthorizationToken

type AuthorizationToken interface {
	// A temporary authentication authorization token
	Token() string
	// A temporary authentication authorization verification string. This is used to exchange an authorization	token for an access token.
	Verifier() string
}

Common interface for authentication authorization tokens

func UnmarshalOAuth1AuthorizationToken

func UnmarshalOAuth1AuthorizationToken(str_q string) (AuthorizationToken, error)

Unmarshal an OAuth1 query-encoded authorization token response in to an AuthorizationToken instance.

type OAuth1AccessToken

type OAuth1AccessToken struct {
	AccessToken      `json:",omitempty"`
	OAuthToken       string `json:"oauth_token"`
	OAuthTokenSecret string `json:"oauth_token_secret"`
}

OAuth1 implmentation of the AccessToken interface.

func (*OAuth1AccessToken) Secret

func (t *OAuth1AccessToken) Secret() string

Return a Flickr API OAuth1 secret associated with an access token.

func (*OAuth1AccessToken) Token

func (t *OAuth1AccessToken) Token() string

Return a Flickr API OAuth1 token associated with an access token.

type OAuth1AuthorizationToken

type OAuth1AuthorizationToken struct {
	AuthorizationToken `json:",omitempty"`
	OAuthToken         string `json:"oath_token"`
	OAuthVerifier      string `json:"oath_verifier"`
}

OAuth1 implmentation of the AuthorizationToken interface.

func (*OAuth1AuthorizationToken) Token

func (t *OAuth1AuthorizationToken) Token() string

Return a Flickr API OAuth1 token associated with a authorization response.

func (*OAuth1AuthorizationToken) Verifier

func (t *OAuth1AuthorizationToken) Verifier() string

Return a Flickr API OAuth1 verification string associated with a authorization response.

type OAuth1RequestToken

type OAuth1RequestToken struct {
	RequestToken     `json:",omitempty"`
	OAuthToken       string `json:"oath_token"`
	OAuthTokenSecret string `json:"oauth_token_secret"`
}

OAuth1 implmentation of the RequestToken interface.

func (*OAuth1RequestToken) Secret

func (t *OAuth1RequestToken) Secret() string

Return a Flickr API OAuth1 secret associated with a authorization request.

func (*OAuth1RequestToken) Token

func (t *OAuth1RequestToken) Token() string

Return a Flickr API OAuth1 token associated with a authorization request.

type RequestToken

type RequestToken interface {
	// A temporary authentication request token. This is used to create an authorization token request.
	Token() string
	// A temporary authentication request secret. This is used to exchange an authorization token for an access token.
	Secret() string
}

Common interface for authentication request tokens

func UnmarshalOAuth1RequestToken

func UnmarshalOAuth1RequestToken(str_q string) (RequestToken, error)

Unmarshal an OAuth1 query-encoded request token response in to an RequestToken instance.

Jump to

Keyboard shortcuts

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