Documentation
¶
Index ¶
- Constants
- func CreateRouter(p *Provider, interceptors ...HttpInterceptor) *mux.Router
- func NewID() string
- func Readiness(w http.ResponseWriter, r *http.Request, probes ...ProbesFn)
- type Attributes
- func (a *Attributes) GetNameID() *saml.NameIDType
- func (a *Attributes) GetSAML() []*saml.AttributeType
- func (a *Attributes) SetEmail(value string)
- func (a *Attributes) SetFullName(value string)
- func (a *Attributes) SetGivenName(value string)
- func (a *Attributes) SetSurname(value string)
- func (a *Attributes) SetUserID(value string)
- func (a *Attributes) SetUsername(value string)
- type AuthRequestForm
- type AuthResponseForm
- type AuthStorage
- type Certificate
- type Config
- type ContactPerson
- type Endpoint
- type EndpointConfig
- type EntityStorage
- type HttpInterceptor
- type IDPStorage
- type IdentityProvider
- type IdentityProviderConfig
- type IdentityProviderStorage
- type LogoutRequestForm
- type LogoutResponse
- type LogoutResponseForm
- type MetadataConfig
- type MetadataIDPConfig
- type Option
- type Organisation
- type ProbesFn
- type Provider
- type Response
- type Route
- type Storage
- type UserStorage
Constants ¶
View Source
const ( AttributeEmail int = iota AttributeFullName AttributeGivenName AttributeSurname AttributeUsername AttributeUserID )
View Source
const ( PostBinding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" RedirectBinding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" SOAPBinding = "urn:oasis:names:tc:SAML:2.0:bindings:SOAP" )
View Source
const ( DefaultTimeFormat = "2006-01-02T15:04:05.999999Z" StatusCodeSuccess = "urn:oasis:names:tc:SAML:2.0:status:Success" StatusCodeVersionMissmatch = "urn:oasis:names:tc:SAML:2.0:status:VersionMismatch" StatusCodeAuthNFailed = "urn:oasis:names:tc:SAML:2.0:status:AuthnFailed" StatusCodeInvalidAttrNameOrValue = "urn:oasis:names:tc:SAML:2.0:status:InvalidAttrNameOrValue" StatusCodeInvalidNameIDPolicy = "urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy" StatusCodeRequestDenied = "urn:oasis:names:tc:SAML:2.0:status:RequestDenied" StatusCodeRequestUnsupported = "urn:oasis:names:tc:SAML:2.0:status:RequestUnsupported" StatusCodeUnsupportedBinding = "urn:oasis:names:tc:SAML:2.0:status:UnsupportedBinding" StatusCodeResponder = "urn:oasis:names:tc:SAML:2.0:status:Responder" StatusCodePartialLogout = "urn:oasis:names:tc:SAML:2.0:status:PartialLogout" )
Variables ¶
This section is empty.
Functions ¶
func CreateRouter ¶
func CreateRouter(p *Provider, interceptors ...HttpInterceptor) *mux.Router
Types ¶
type Attributes ¶
type Attributes struct {
// contains filtered or unexported fields
}
func (*Attributes) GetNameID ¶
func (a *Attributes) GetNameID() *saml.NameIDType
func (*Attributes) GetSAML ¶
func (a *Attributes) GetSAML() []*saml.AttributeType
func (*Attributes) SetEmail ¶
func (a *Attributes) SetEmail(value string)
func (*Attributes) SetFullName ¶
func (a *Attributes) SetFullName(value string)
func (*Attributes) SetGivenName ¶
func (a *Attributes) SetGivenName(value string)
func (*Attributes) SetSurname ¶
func (a *Attributes) SetSurname(value string)
func (*Attributes) SetUserID ¶
func (a *Attributes) SetUserID(value string)
func (*Attributes) SetUsername ¶
func (a *Attributes) SetUsername(value string)
type AuthRequestForm ¶
type AuthResponseForm ¶
type AuthStorage ¶
type Certificate ¶
type Config ¶
type Config struct {
MetadataEndpoint *op.Endpoint
MetadataConfig *MetadataConfig
IDPConfig *IdentityProviderConfig
Organisation *Organisation
ContactPerson *ContactPerson
}
type ContactPerson ¶
type EndpointConfig ¶
type EndpointConfig struct {
Certificate Endpoint `yaml:"Certificate"`
Callback Endpoint `yaml:"Callback"`
SingleSignOn Endpoint `yaml:"SingleSignOn"`
SingleLogOut Endpoint `yaml:"SingleLogOut"`
Artifact Endpoint `yaml:"Artifact"`
SLOArtifact Endpoint `yaml:"SLOArtifact"`
NameIDMapping Endpoint `yaml:"NameIDMapping"`
Attribute Endpoint `yaml:"Attribute"`
}
type EntityStorage ¶
type EntityStorage interface {
GetCA(context.Context, chan<- key.CertificateAndKey)
GetMetadataSigningKey(context.Context, chan<- key.CertificateAndKey)
}
type IDPStorage ¶
type IDPStorage interface {
AuthStorage
IdentityProviderStorage
UserStorage
Health(context.Context) error
}
type IdentityProvider ¶
type IdentityProvider struct {
EntityID string
Metadata *md.IDPSSODescriptorType
AAMetadata *md.AttributeAuthorityDescriptorType
CertificateEndpoint op.Endpoint
CallbackEndpoint op.Endpoint
SingleSignOnEndpoint op.Endpoint
SingleLogoutEndpoint op.Endpoint
ArtifactResulationEndpoint op.Endpoint
SLOArtifactResulationEndpoint op.Endpoint
NameIDMappingEndpoint op.Endpoint
AttributeEndpoint op.Endpoint
// contains filtered or unexported fields
}
func NewIdentityProvider ¶
func NewIdentityProvider(metadataEndpoint *op.Endpoint, conf *IdentityProviderConfig, storage IDPStorage) (*IdentityProvider, error)
func (*IdentityProvider) DeleteServiceProvider ¶
func (p *IdentityProvider) DeleteServiceProvider(entityID string) error
func (*IdentityProvider) GetRoutes ¶
func (p *IdentityProvider) GetRoutes() []*Route
func (*IdentityProvider) GetServiceProvider ¶
func (p *IdentityProvider) GetServiceProvider(ctx context.Context, entityID string) (*serviceprovider.ServiceProvider, error)
type IdentityProviderConfig ¶
type IdentityProviderConfig struct {
MetadataIDPConfig *MetadataIDPConfig
SignatureAlgorithm string
DigestAlgorithm string
EncryptionAlgorithm string
WantAuthRequestsSigned string
Endpoints *EndpointConfig `yaml:"Endpoints"`
}
type IdentityProviderStorage ¶
type IdentityProviderStorage interface {
GetEntityByID(ctx context.Context, entityID string) (*serviceprovider.ServiceProvider, error)
GetEntityIDByAppID(ctx context.Context, entityID string) (string, error)
GetResponseSigningKey(context.Context, chan<- key.CertificateAndKey)
}
type LogoutRequestForm ¶
type LogoutResponse ¶
type LogoutResponseForm ¶
type MetadataConfig ¶
type MetadataIDPConfig ¶
type Option ¶
func WithHttpInterceptors ¶
func WithHttpInterceptors(interceptors ...HttpInterceptor) Option
type Organisation ¶
type ProbesFn ¶
func ReadyStorage ¶
type Provider ¶
type Provider struct {
MetadataEndpoint *op.Endpoint
Metadata *md.EntityDescriptorType
IdentityProvider *IdentityProvider
// contains filtered or unexported fields
}
func NewProvider ¶
func (*Provider) GetMetadata ¶
func (p *Provider) GetMetadata() (*md.EntityDescriptorType, error)
func (*Provider) HttpHandler ¶
type Route ¶
type Route struct {
Endpoint string
HandleFunc http.HandlerFunc
}
type Storage ¶
type Storage interface {
EntityStorage
AuthStorage
IdentityProviderStorage
UserStorage
Health(context.Context) error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.