sso

package
v1.0.47 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityDescriptor

type EntityDescriptor struct {
	XMLName  xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:metadata EntityDescriptor"`
	ID       string   `xml:",attr,omitempty"`
	EntityID string   `xml:"entityID,attr"`
}

EntityDescriptor TODO.

type IDPEntityDescriptor

type IDPEntityDescriptor struct {
	*EntityDescriptor
	IDPSSODescriptor *IDPSSODescriptor
}

IDPEntityDescriptor TODO.

type IDPSSODescriptor

type IDPSSODescriptor struct {
	XMLName                    xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:metadata IDPSSODescriptor"`
	WantAuthnRequestsSigned    bool     `xml:",attr"`
	ProtocolSupportEnumeration string   `xml:"protocolSupportEnumeration,attr"`
	KeyDescriptor              KeyDescriptor
	NameIDFormat               string `xml:"NameIDFormat"`
	SingleSignOnService        []SingleSignOnService
}

IDPSSODescriptor TODO.

type KeyDescriptor

type KeyDescriptor struct {
	XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:metadata KeyDescriptor"`
	Use     string   `xml:"use,attr,omitempty"`
	KeyInfo KeyInfo
}

KeyDescriptor TODO.

type KeyInfo

type KeyInfo struct {
	XMLName  xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# KeyInfo"`
	X509Data *X509Data
}

KeyInfo TODO.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider represents sso provider.

func (*Provider) Configure

func (p *Provider) Configure() error

Configure configures sso provider.

func (*Provider) Configured

func (p *Provider) Configured() bool

Configured returns true if the sso provider was configured.

func (*Provider) GetConfig

func (p *Provider) GetConfig() map[string]interface{}

GetConfig returns sso provider configuration.

func (*Provider) GetDriver

func (p *Provider) GetDriver() string

GetDriver returns the name of the driver associated with the provider.

func (*Provider) GetMetadata

func (p *Provider) GetMetadata() ([]byte, error)

GetMetadata returns the contents of metadata.xml.

func (*Provider) GetName

func (p *Provider) GetName() string

GetName return the name associated with sso provider.

type Request

type Request struct {
	ProviderName string      `json:"provider_name,omitempty" xml:"provider_name,omitempty" yaml:"provider_name,omitempty"`
	Kind         RequestKind `json:"kind,omitempty" xml:"kind,omitempty" yaml:"kind,omitempty"`
	Params       string      `json:"params,omitempty" xml:"params,omitempty" yaml:"params,omitempty"`
}

Request represents sso provider request.

func ParseRequestURL

func ParseRequestURL(r *http.Request) (*Request, error)

ParseRequestURL extracts provider name and request type from URL.

type RequestKind

type RequestKind int

RequestKind represents the type of SSO provider request.

const (

	// UnknownRequest represents unspecified request type.
	UnknownRequest RequestKind = iota
	// MetadataRequest represents metadata request type.
	MetadataRequest
	// AssumeRoleRequest represents role assumption request type.
	AssumeRoleRequest
	// MenuRequest represents role selection request type.
	MenuRequest
)

type Service

type Service struct {
	Binding  string `xml:",attr"`
	Location string `xml:",attr"`
}

Service TODO.

type SingleSignOnProvider

type SingleSignOnProvider interface {
	GetName() string
	GetDriver() string
	GetConfig() map[string]interface{}
	Configure() error
	Configured() bool
	GetMetadata() ([]byte, error)
}

SingleSignOnProvider represents sso provider interface.

func NewSingleSignOnProvider

func NewSingleSignOnProvider(cfg *SingleSignOnProviderConfig, logger *zap.Logger) (SingleSignOnProvider, error)

NewSingleSignOnProvider returns SingleSignOnProvider instance.

type SingleSignOnProviderConfig

type SingleSignOnProviderConfig struct {
	Name           string   `json:"name,omitempty" xml:"name,omitempty" yaml:"name,omitempty"`
	Driver         string   `json:"driver,omitempty" xml:"driver,omitempty" yaml:"driver,omitempty"`
	EntityID       string   `json:"entity_id,omitempty" xml:"entity_id,omitempty" yaml:"entity_id,omitempty"`
	Locations      []string `json:"locations,omitempty" xml:"locations,omitempty" yaml:"locations,omitempty"`
	PrivateKeyPath string   `json:"private_key_path,omitempty" xml:"private_key_path,omitempty" yaml:"private_key_path,omitempty"`
	CertPath       string   `json:"cert_path,omitempty" xml:"cert_path,omitempty" yaml:"cert_path,omitempty"`
}

SingleSignOnProviderConfig represents an identity provider configuration.

func NewSingleSignOnProviderConfig

func NewSingleSignOnProviderConfig(data map[string]interface{}) (*SingleSignOnProviderConfig, error)

NewSingleSignOnProviderConfig returns SingleSignOnProviderConfig instance.

func (*SingleSignOnProviderConfig) Validate

func (cfg *SingleSignOnProviderConfig) Validate() error

Validate validates identity provider config.

type SingleSignOnService

type SingleSignOnService struct {
	XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:metadata SingleSignOnService"`
	Service
}

SingleSignOnService TODO.

type X509Data

type X509Data struct {
	XMLName         xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# X509Data"`
	X509Certificate string   `xml:"http://www.w3.org/2000/09/xmldsig# X509Certificate"`
}

X509Data TODO.

Jump to

Keyboard shortcuts

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