auth

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const CacheExpiration = 600 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func NewAuth

func NewAuth(config config.Config) (*Auth, error)

func NewAuthWithoutCache

func NewAuthWithoutCache(config config.Config) *Auth

func (*Auth) Ensure

func (this *Auth) Ensure() (token AuthToken, err error)

func (*Auth) GenerateInternalUserToken

func (this *Auth) GenerateInternalUserToken(userid string) (token AuthToken, err error)

func (*Auth) GetUserToken

func (this *Auth) GetUserToken(userid string) (token AuthToken, err error)

type AuthToken

type AuthToken string

func (*AuthToken) Get

func (this *AuthToken) Get(url string) (resp *http.Response, err error)

func (*AuthToken) GetJSON

func (this *AuthToken) GetJSON(url string, result interface{}) (err error)

func (AuthToken) UseInRequest

func (this AuthToken) UseInRequest(req *http.Request)

type OpenidToken

type OpenidToken struct {
	AccessToken      string    `json:"access_token"`
	ExpiresIn        float64   `json:"expires_in"`
	RefreshExpiresIn float64   `json:"refresh_expires_in"`
	RefreshToken     string    `json:"refresh_token"`
	TokenType        string    `json:"token_type"`
	RequestTime      time.Time `json:"-"`
}

Jump to

Keyboard shortcuts

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