Documentation ¶
Overview ¶
Package traefik_oauth_upstream - Traefik plugin to manage upstream OAuth.
Index ¶
- Constants
- func CalcRefreshTimestamp(expiryUnix int64) int64
- func LoadTokenData(persistDir string) (*oauth2.Token, error)
- func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error)
- func Persist(tokenData *oauth2.Token, persistDir string)
- func TokenDataExists(persistDir string) (bool, error)
- type Config
- type OauthUpstream
Constants ¶
View Source
const CALLBACK_PATH = "/_oauth" //nolint:revive,stylecheck
View Source
const TOKEN_DATA_FILENAME = "token_data.json" //nolint:revive,stylecheck,gosec // Filename is hardcoded, but not the contents.
Variables ¶
This section is empty.
Functions ¶
func CalcRefreshTimestamp ¶
CalcRefreshTimestamp - calculate at what point the token should be refreshed.
func LoadTokenData ¶
LoadTokenData - load token info from a file.
func TokenDataExists ¶
TokenDataExists - figures out whether token data exists on disk.
Types ¶
type Config ¶
type Config struct { ClientID string `json:"clientId"` ClientSecret string `json:"clientSecret"` AuthURL string `json:"authUrl"` TokenURL string `json:"tokenUrl"` PersistDir string `json:"persistDir"` Scopes []string `json:"scopes"` }
Config - the plugin configuration.
func CreateConfig ¶
func CreateConfig() *Config
CreateConfig - creates the default plugin configuration.
type OauthUpstream ¶
type OauthUpstream struct {
// contains filtered or unexported fields
}
OauthUpstream - information about upstream OAuth.
func (*OauthUpstream) ServeHTTP ¶
func (a *OauthUpstream) ServeHTTP(rw http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.