idprovider

package
v0.0.0-...-b4bec84 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrIdentityProviderNotFound error in not found identity provider.
	ErrIdentityProviderNotFound = errors.New("identity provider not found")
)

tenantID:provider.

Functions

func RegisterIdentityProvider

func RegisterIdentityProvider(key string, provider Provider)

RegisterIdentityProvider register Provider with key.

func RegisterProviderFactory

func RegisterProviderFactory(factory ProviderFactory)

RegisterProviderFactory registers ProviderFactory with the specified type.

Types

type Identity

type Identity interface {
	// Identifier for the End-User.
	GetUserID() string
	// User's tenant info at needed.
	GetTenantID() string
	// The username which the End-User wishes to be referred to panda.
	GetUsername() string
	// Email user's email info at needed.
	GetEmail() string
	// External idprovider unique user id.
	GetExternalID() string
	// Other extensions.
	GetExtra() map[string]any
}

Identity represents the account mapped to this system.

type Provider

type Provider interface {
	// Type unique type of the provider.
	Type() string
	// AuthenticateCode authenticate identity with code from remote server.
	AuthenticateCode(code string) (Identity, error)
	// Authenticate basic authn username password.
	Authenticate(username string, password string) (Identity, error)
	AuthCodeURL(state, nonce string) string
}

func GetIdentityProvider

func GetIdentityProvider(key string) (Provider, error)

GetIdentityProvider returns identity Provider with key.

type ProviderFactory

type ProviderFactory interface {
	// Type unique type of the provider.
	Type() string
	// Apply the  options from external identity provider config.
	Create(options map[string]any) (Provider, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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