identityprovider

package
v0.0.0-...-03b3356 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterGenericProvider

func RegisterGenericProvider(factory GenericProviderFactory)

RegisterOAuthProvider register GenericProviderFactory with the specified type

func RegisterOAuthProvider

func RegisterOAuthProvider(factory OAuthProviderFactory)

RegisterOAuthProvider register OAuthProviderFactory with the specified type

func SetupWithOptions

func SetupWithOptions(options []oauth.IdentityProviderOptions) error

SetupWithOptions will verify the configuration and initialize the identityProviders

Types

type GenericProvider

type GenericProvider interface {
	// Authenticate from remote server
	Authenticate(username string, password string) (Identity, error)
}

func GetGenericProvider

func GetGenericProvider(providerName string) (GenericProvider, error)

GetGenericProvider returns GenericProvider with given name

type GenericProviderFactory

type GenericProviderFactory interface {
	// Type unique type of the provider
	Type() string
	// Apply the dynamic options from ai-config
	Create(options oauth.DynamicOptions) (GenericProvider, error)
}

type Identity

type Identity interface {
	// required
	// Identifier for the End-User at the Issuer.
	GetUserID() string
	// optional
	// The username which the End-User wishes to be referred to ai.
	GetUsername() string
	// optional
	GetEmail() string
}

Identity represents the account mapped to ai

type OAuthProvider

type OAuthProvider interface {
	// IdentityExchange exchange identity from remote server
	IdentityExchange(code string) (Identity, error)
}

func GetOAuthProvider

func GetOAuthProvider(providerName string) (OAuthProvider, error)

GetGenericProvider returns OAuthProvider with given name

type OAuthProviderFactory

type OAuthProviderFactory interface {
	// Type unique type of the provider
	Type() string
	// Apply the dynamic options from ai-config
	Create(options oauth.DynamicOptions) (OAuthProvider, error)
}

Jump to

Keyboard shortcuts

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