oauthmodel

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authentication

type Authentication struct {
	AccessToken string
	ExpiryTime  time.Time
	ExpiresIn   int64 // ExpiresIn is the number of seconds before access token expires
}

Authentication is generated open successful authentication

type Claims

type Claims struct {
	Owners map[string]string `json:"owners,omitempty"`
	Scopes string            `json:"scopes"`
}

Claims custom to DPhoto used for authorisation

type Config

type Config struct {
	TrustedIssuers   map[string]IssuerOAuth2Config // TrustedIssuers is the list of accepted 'iss', and their public key
	Issuer           string                        // Issuer is user in the generated JWT for both 'iss' and 'aud'
	ValidityDuration string                        // ValidityDuration uses time.ParseDuration format (ex: '8h')
	SecretJwtKey     []byte                        // SecretJwtKey is the key used to sign and validate DPhoto JWT
}

type Identity

type Identity struct {
	Email   string
	Name    string
	Picture string
}

type IssuerOAuth2Config

type IssuerOAuth2Config struct {
	ConfigSource     string
	PublicKeysLookup func(method TokenMethod) (interface{}, error)
}

func (*IssuerOAuth2Config) String

func (i *IssuerOAuth2Config) String() string

type TokenMethod

type TokenMethod struct {
	Algorithm string
	Kid       string
}

func (*TokenMethod) String

func (t *TokenMethod) String() string

type UserRepository

type UserRepository interface {
	FindUserRoles(email string) (*UserRoles, error)
}

type UserRoles

type UserRoles struct {
	IsUserManager bool
	Owners        map[string]string
}

Jump to

Keyboard shortcuts

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