oauth2

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OAuth2Transport

type OAuth2Transport struct {
	Domain       string
	Audience     string
	ClientID     string
	ClientSecret string
	Scope        []string
	Transport    http.RoundTripper
	Logger       logger.Logger
	Expiry       time.Time
	Token        string
	// contains filtered or unexported fields
}

based on https://pkg.go.dev/golang.org/x/oauth2/clientcredentials

func (*OAuth2Transport) GetToken

func (t *OAuth2Transport) GetToken(ctx context.Context) (string, error)

func (*OAuth2Transport) RefreshToken

func (t *OAuth2Transport) RefreshToken(ctx context.Context) error

func (*OAuth2Transport) RoundTrip

func (t *OAuth2Transport) RoundTrip(r *http.Request) (*http.Response, error)

type TokenExchangeResponse

type TokenExchangeResponse struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int64  `json:"expires_in"`
	Scope       string `json:"scope"`
	TokenType   string `json:"token_type"`
}

Jump to

Keyboard shortcuts

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