oauth2

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResponseTypeCode  = "code"
	ResponseTypeToken = "token"
)
View Source
const (
	GrantAuthorizationCode = "authorization_code"
	GrantClientCredentials = "client_credentials"
	GrantRefreshToken      = "refresh_token"
)
View Source
const (
	Name = "oauth2"
)

Variables

This section is empty.

Functions

func Create

func Create(id, name string, conf *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)

func NewFactory

func NewFactory() eosc.IExtenderDriverFactory

func Register

func Register(register eosc.IExtenderDriverRegister)

Types

type Config

type Config struct {
	AcceptHttpIfAlreadyTerminated bool `json:"accept_http_if_already_terminated"`
	//Anonymous                     interface{} `json:"anonymous"`
	EnableAuthorizationCode bool `json:"enable_authorization_code"`
	EnableClientCredentials bool `json:"enable_client_credentials"`
	EnableImplicitGrant     bool `json:"enable_implicit_grant"`
	//EnablePasswordGrant           bool        `json:"enable_password_grant"`
	MandatoryScope         bool `json:"mandatory_scope"`
	PersistentRefreshToken bool `json:"persistent_refresh_token"`
	//Pkce                   string      `json:"pkce"`
	ProvisionKey      string   `json:"provision_key"`
	RefreshTokenTtl   int      `json:"refresh_token_ttl"`
	ReuseRefreshToken bool     `json:"reuse_refresh_token"`
	Scopes            []string `json:"scopes"`
	TokenExpiration   int      `json:"token_expiration"`
}

type Token

type Token struct {
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	AccessToken  string `json:"access_token,omitempty"`
	RefreshToken string `json:"refresh_token,omitempty"`
	Scope        string `json:"scope,omitempty"`
}

type TokenData

type TokenData struct {
	AuthenticatedUserid interface{} `json:"authenticated_userid"`
	Credential          struct {
		Id string `json:"id"`
	} `json:"credential"`
	AccessToken  string      `json:"access_token"`
	Service      interface{} `json:"service"`
	CreatedAt    int64       `json:"created_at"`
	RefreshToken interface{} `json:"refresh_token"`
	Scope        interface{} `json:"scope"`
	Ttl          int         `json:"ttl"`
	TokenType    string      `json:"token_type"`
	ExpiresIn    int         `json:"expires_in"`
	ClientID     string      `json:"client_id"`
}

type TokenHandler

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

func NewTokenHandler

func NewTokenHandler() *TokenHandler

func (*TokenHandler) ServeHTTP

func (t *TokenHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type TokenResponse

type TokenResponse struct {
	Total int          `json:"total"`
	Data  []*TokenData `json:"data"`
}

Jump to

Keyboard shortcuts

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