oauth2mixed

package
v0.0.0-...-b5ea810 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCreateHttpToken error = errors.New("Error creating token http request")
View Source
var ErrFetchingHttpToken error = errors.New("Error fetching token")
View Source
var ErrParsingToken error = errors.New("Error parsing token")
View Source
var ErrorDuplicateFile = errors.New("Error duplicate file")
View Source
var ErrorUnauthorized = errors.New("Unauthorized access attempt")

Functions

func MkCookieId

func MkCookieId() string

func RandReader

func RandReader() io.Reader

Types

type BearerT

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

type ClientCredentialsProfiler

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

func (ClientCredentialsProfiler) Avatar

func (pf ClientCredentialsProfiler) Avatar() string

func (ClientCredentialsProfiler) Email

func (pf ClientCredentialsProfiler) Email() string

func (ClientCredentialsProfiler) Id

func (ClientCredentialsProfiler) Init

func (pf ClientCredentialsProfiler) Init(data map[string]interface{}) ClientCredentialsProfiler

func (ClientCredentialsProfiler) Login

func (pf ClientCredentialsProfiler) Login() string

func (ClientCredentialsProfiler) Name

func (ClientCredentialsProfiler) New

func (ClientCredentialsProfiler) Nick

func (ClientCredentialsProfiler) SurName

func (pf ClientCredentialsProfiler) SurName() string

type MinimalProfiler

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

func (MinimalProfiler) Avatar

func (pf MinimalProfiler) Avatar() string

func (MinimalProfiler) Email

func (pf MinimalProfiler) Email() string

func (MinimalProfiler) Id

func (pf MinimalProfiler) Id() string

func (MinimalProfiler) Init

func (pf MinimalProfiler) Init(data map[string]interface{}) MinimalProfiler

func (MinimalProfiler) Login

func (pf MinimalProfiler) Login() string

func (MinimalProfiler) Name

func (pf MinimalProfiler) Name() string

func (MinimalProfiler) New

func (pf MinimalProfiler) New() Profiler

func (MinimalProfiler) Nick

func (pf MinimalProfiler) Nick() string

func (MinimalProfiler) SurName

func (pf MinimalProfiler) SurName() string

type Oauth2G

type Oauth2G struct {
	Auth goose.Alert `json:"Auth"`
}
var Goose Oauth2G

type Oauth2T

type Oauth2T struct {
	CertKit            stonelizard.AuthT                 `json:"CertKit"`
	RegEndPoint        string                            `json:"RegEndPoint"`
	TokInfEndPoint     string                            `json:"TokInfEndPoint"`
	UsrInfEndPoint     string                            `json:"UsrInfEndPoint"`
	OIDMetaEndPoint    string                            `json:"OIDMetaEndPoint"`
	RevokeEndPoint     string                            `json:"RevokeEndPoint"`
	IntrospectEndPoint string                            `json:"IntrospectEndPoint"`
	JSONWKSEndPoint    string                            `json:"JSONWKSEndPoint"`
	Config             *oauth2.Config                    `json:"Config"`
	UserProfileModel   Profiler                          `json:"-"`
	Session            map[string]map[string]interface{} `json:"-"`
	SavePending        func(cert *x509.Certificate, parms ...interface{}) error
	Secure             bool     `json:"secure"`
	ClientCredScope    []string `json:"client_credentials_scope"`
}

func New

func New(cliId, cliSec, authURL, tokURL, Introspect string, opt ...OptionsT) (*Oauth2T, error)

func (*Oauth2T) AddUserData

func (o *Oauth2T) AddUserData(usrKey string, ClientCert *x509.Certificate) error

func (*Oauth2T) Authorize

func (o *Oauth2T) Authorize(path string, parms map[string]interface{}, RemoteAddr string, TLS *tls.ConnectionState, SavePending func(interface{}) error) (httpstat int, data interface{}, err error)

func (*Oauth2T) Configure

func (oa *Oauth2T) Configure(key string, setter map[string]func(interface{}))

func (*Oauth2T) Delete

func (o *Oauth2T) Delete(tree, id string) error

func (*Oauth2T) Drop

func (o *Oauth2T) Drop(id string) error

func (*Oauth2T) ExtAuthorize

func (oa *Oauth2T) ExtAuthorize(ch chan stonelizard.ExtAuthorizeIn, path string, parms map[string]interface{}, resp http.ResponseWriter, req *http.Request, SavePending func(interface{}) error) (int, interface{}, error)

func (*Oauth2T) Get

func (oa *Oauth2T) Get(key string) (interface{}, error)

func (*Oauth2T) GetCACert

func (o *Oauth2T) GetCACert() *x509.Certificate

func (*Oauth2T) GetCAKey

func (o *Oauth2T) GetCAKey() *rsa.PrivateKey

func (*Oauth2T) GetCertPool

func (o *Oauth2T) GetCertPool() *x509.CertPool

func (*Oauth2T) GetDNSNames

func (o *Oauth2T) GetDNSNames() []string

func (*Oauth2T) GetPending

func (o *Oauth2T) GetPending() (map[string]interface{}, error)

func (*Oauth2T) GetServerCert

func (o *Oauth2T) GetServerCert() *x509.Certificate

func (*Oauth2T) GetServerKey

func (o *Oauth2T) GetServerKey() *rsa.PrivateKey

func (*Oauth2T) GetServerX509KeyPair

func (o *Oauth2T) GetServerX509KeyPair() tls.Certificate

func (*Oauth2T) GetTLSConfig

func (ck *Oauth2T) GetTLSConfig(Access uint8) (*tls.Config, error)

func (*Oauth2T) GetTrusted

func (o *Oauth2T) GetTrusted() (map[string]interface{}, error)

func (*Oauth2T) LoadUserData

func (o *Oauth2T) LoadUserData() error

func (*Oauth2T) NewSession

func (oa *Oauth2T) NewSession(hname string, resp http.ResponseWriter)

func (*Oauth2T) ReNewSession

func (oa *Oauth2T) ReNewSession(oid string, hname string, resp http.ResponseWriter)

func (*Oauth2T) ReadCertFromReader

func (o *Oauth2T) ReadCertFromReader(r io.Reader) (*x509.Certificate, []byte, error)

func (*Oauth2T) ReadCertificate

func (o *Oauth2T) ReadCertificate(fname string) (*x509.Certificate, []byte, error)

func (*Oauth2T) ReadDecryptRsaPrivKey

func (o *Oauth2T) ReadDecryptRsaPrivKey(fname string) (*rsa.PrivateKey, []byte, error)

func (*Oauth2T) ReadDecryptRsaPrivKeyFromReader

func (o *Oauth2T) ReadDecryptRsaPrivKeyFromReader(r io.Reader) (*rsa.PrivateKey, []byte, error)

func (*Oauth2T) ReadRsaPrivKey

func (o *Oauth2T) ReadRsaPrivKey(fname string) (*rsa.PrivateKey, []byte, error)

func (*Oauth2T) ReadRsaPrivKeyFromReader

func (o *Oauth2T) ReadRsaPrivKeyFromReader(r io.Reader) (*rsa.PrivateKey, []byte, error)

func (*Oauth2T) Reject

func (o *Oauth2T) Reject(id string) error

func (*Oauth2T) Set

func (oa *Oauth2T) Set(key string, val interface{}) error

func (*Oauth2T) SetCookie

func (oa *Oauth2T) SetCookie(oid string, hname string, resp http.ResponseWriter)

func (*Oauth2T) Setup

func (o *Oauth2T) Setup(udata map[string]interface{}) error

func (*Oauth2T) StartCRLServer

func (o *Oauth2T) StartCRLServer(listenAddress string, listener *stonelizard.StoppableListener) error

func (*Oauth2T) StartExtAuthorizer

func (oa *Oauth2T) StartExtAuthorizer(authReq chan stonelizard.ExtAuthorizeIn)

func (*Oauth2T) Trust

func (o *Oauth2T) Trust(id string) error

type OptionsT

type OptionsT struct {
	Secure bool
}

type Profiler

type Profiler interface {
	New() Profiler
	Id() string
	Email() string
	Nick() string
	Login() string
	Name() string
	SurName() string
	Avatar() string
}

type RandomReader

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

func NewRandReader

func NewRandReader() RandomReader

func (RandomReader) Prob

func (r RandomReader) Prob() float32

func (RandomReader) Read

func (rd RandomReader) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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