provider

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigX509KeyStore

type ConfigX509KeyStore struct {
	InstanceID uuid.UUID
	DB         *storage.Connection
	Conf       conf.SamlProviderConfiguration
}

ConfigX509KeyStore keystore

func (ConfigX509KeyStore) CreateSigningCert

func (ks ConfigX509KeyStore) CreateSigningCert() (*rsa.PrivateKey, []byte, error)

CreateSigningCert creates a new signing pair

func (ConfigX509KeyStore) GetKeyPair

func (ks ConfigX509KeyStore) GetKeyPair() (*rsa.PrivateKey, []byte, error)

GetKeyPair returns the rsa pair

func (ConfigX509KeyStore) SaveConfig

func (ks ConfigX509KeyStore) SaveConfig(cert []byte, key *rsa.PrivateKey) error

SaveConfig stores the keystore config

type OAuthProvider

type OAuthProvider interface {
	AuthCodeURL(string, ...oauth2.AuthCodeOption) string
	GetUserData(context.Context, *oauth2.Token) (*UserProvidedData, error)
	GetOAuthToken(string) (*oauth2.Token, error)
}

OAuthProvider specifies additional methods needed for providers using OAuth

func NewBitbucketProvider

func NewBitbucketProvider(ext conf.OAuthProviderConfiguration) (OAuthProvider, error)

NewBitbucketProvider creates a Bitbucket account provider.

func NewFacebookProvider

func NewFacebookProvider(ext conf.OAuthProviderConfiguration) (OAuthProvider, error)

NewFacebookProvider creates a Facebook account provider.

func NewGithubProvider

func NewGithubProvider(ext conf.OAuthProviderConfiguration) (OAuthProvider, error)

NewGithubProvider creates a Github account provider.

func NewGitlabProvider

func NewGitlabProvider(ext conf.OAuthProviderConfiguration) (OAuthProvider, error)

NewGitlabProvider creates a Gitlab account provider.

func NewGoogleProvider

func NewGoogleProvider(ext conf.OAuthProviderConfiguration) (OAuthProvider, error)

NewGoogleProvider creates a Google account provider.

type Provider

type Provider interface {
	AuthCodeURL(string, ...oauth2.AuthCodeOption) string
}

Provider is an interface for interacting with external account providers

type SamlProvider

type SamlProvider struct {
	ServiceProvider *saml2.SAMLServiceProvider
}

SamlProvider holds the SamlProvider

func NewSamlProvider

func NewSamlProvider(ext conf.SamlProviderConfiguration, db *storage.Connection, instanceID uuid.UUID) (*SamlProvider, error)

NewSamlProvider creates a Saml account provider.

func (SamlProvider) AuthCodeURL

func (p SamlProvider) AuthCodeURL(tokenString string, args ...oauth2.AuthCodeOption) string

AuthCodeURL returns the authCode URL

func (SamlProvider) SPMetadata

func (p SamlProvider) SPMetadata() ([]byte, error)

SPMetadata returns RAW Metadata

type UserProvidedData

type UserProvidedData struct {
	Email    string
	Verified bool
	Metadata map[string]string
}

UserProvidedData stores metadata from external account providers

Jump to

Keyboard shortcuts

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