Documentation
¶
Index ¶
- Variables
- func BasicAuthToken(username, password string) (*oauth2.Token, error)
- func NewClientAccessToken(accessToken string) *http.Client
- func NewClientAuthCode(conf oauth2.Config, authCode string) (*http.Client, error)
- func NewClientPasswordConf(conf oauth2.Config, username, password string) (*http.Client, error)
- func NewClientTLSToken(ctx context.Context, tlsConfig *tls.Config, token *oauth2.Token) *http.Client
- func NewClientWebTokenStore(ctx context.Context, conf *oauth2.Config, tStore *TokenStoreFile, ...) (*http.Client, error)
- func NewTokenFromWeb(cfg *oauth2.Config) (*oauth2.Token, error)
- func RFC7617UserPass(userid, password string) (string, error)
- func ReadTokenFile(fpath string) (*oauth2.Token, error)
- func UserCredentialsDir() (string, error)
- func UserCredentialsDirMk(perm os.FileMode) (string, error)
- func WriteTokenFile(fpath string, tok *oauth2.Token) error
- type AppCredentials
- type AppCredentialsWrapper
- type ApplicationCredentials
- type OAuth2Util
- type TokenStoreFile
- type UserCredentials
Constants ¶
This section is empty.
Variables ¶
View Source
var (
RelCredentialsDir = ".credentials"
)
Functions ¶
func BasicAuthToken ¶
BasicAuthToken provides Basic Authentication support via an oauth2.Token.
func NewClientAccessToken ¶ added in v0.1.0
func NewClientAuthCode ¶
func NewClientPasswordConf ¶
func NewClientTLSToken ¶
func NewClientWebTokenStore ¶
func RFC7617UserPass ¶
RFC7617UserPass base64 encodes a user-id and password per: https://tools.ietf.org/html/rfc7617#section-2
func ReadTokenFile ¶
ReadTokenFile retrieves a Token from a given filepath.
func UserCredentialsDir ¶
Types ¶
type AppCredentials ¶
type AppCredentials struct { Service string `json:"service,omitempty"` ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` RedirectURIs []string `json:"redirect_uris"` AuthURI string `json:"auth_uri"` TokenURI string `json:"token_uri"` Scopes []string `json:"scopes"` }
func (*AppCredentials) Config ¶
func (c *AppCredentials) Config() *oauth2.Config
func (*AppCredentials) Defaultify ¶
func (ac *AppCredentials) Defaultify()
type AppCredentialsWrapper ¶
type AppCredentialsWrapper struct { Web *AppCredentials `json:"web"` Installed *AppCredentials `json:"installed"` }
func NewAppCredentialsWrapperFromBytes ¶
func NewAppCredentialsWrapperFromBytes(data []byte) (AppCredentialsWrapper, error)
type ApplicationCredentials ¶
type ApplicationCredentials struct { ServerURL string ClientID string ClientSecret string Endpoint oauth2.Endpoint }
ApplicationCredentials represents information for an app.
type OAuth2Util ¶
type TokenStoreFile ¶
func NewTokenStoreFile ¶
func NewTokenStoreFile(file string) *TokenStoreFile
func (*TokenStoreFile) NewTokenFromWeb ¶
func (*TokenStoreFile) Read ¶
func (ts *TokenStoreFile) Read() error
func (*TokenStoreFile) Write ¶
func (ts *TokenStoreFile) Write() error
type UserCredentials ¶
UserCredentials represents a user's credentials.
Click to show internal directories.
Click to hide internal directories.