identityprovider

package
v0.0.310 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2020 The KubeSphere Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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 kubesphere-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 kubesphere.
	GetUsername() string
	// optional
	GetEmail() string
}

Identity represents the account mapped to kubesphere

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 kubesphere-config
	Create(options oauth.DynamicOptions) (OAuthProvider, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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