identityprovider

package
v0.0.0-...-b5015ec Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterGenericProvider

func RegisterGenericProvider(factory GenericProviderFactory)

RegisterGenericProvider registers 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 kubesphere-config
	Create(options options.DynamicOptions) (GenericProvider, error)
}

type Identity

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

Identity represents the account mapped to kubesphere

type OAuthProvider

type OAuthProvider interface {
	// IdentityExchangeCallback handle oauth callback, exchange identity from remote server
	IdentityExchangeCallback(req *http.Request) (Identity, error)
}

func GetOAuthProvider

func GetOAuthProvider(providerName string) (OAuthProvider, error)

GetOAuthProvider returns OAuthProvider with given name

type OAuthProviderFactory

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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