internal

package
v0.0.0-...-34983fa Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxIssueDelay = time.Minute * 10

Functions

This section is empty.

Types

type Assertion

type Assertion struct {
	XMLName            xml.Name
	ID                 string    `xml:"ID,attr"`
	Version            string    `xml:"Version,attr"`
	XSI                string    `xml:"xmlns:xsi,attr"`
	XS                 string    `xml:"xmlns:xs,attr"`
	SAML               string    `xml:"xmlns:saml,attr"`
	IssueInstant       string    `xml:"IssueInstant,attr"`
	Issuer             Issuer    `xml:"Issuer"`
	Signature          Signature `xml:"Signature"`
	Subject            Subject
	Conditions         Conditions
	AuthnStatement     AuthnStatement `xml:"AuthnStatement,omitempty"`
	AttributeStatement AttributeStatement
}

type AssertionConsumerService

type AssertionConsumerService struct {
	XMLName  xml.Name
	Binding  string `xml:"Binding,attr"`
	Location string `xml:"Location,attr"`
	Index    string `xml:"index,attr"`
}

type Attribute

type Attribute struct {
	XMLName         xml.Name
	Name            string         `xml:",attr"`
	FriendlyName    string         `xml:",attr,omitempty"`
	NameFormat      string         `xml:",attr"`
	AttributeValues AttributeValue `xml:"AttributeValue"`
}

type AttributeStatement

type AttributeStatement struct {
	XMLName    xml.Name
	Attributes []Attribute `xml:"Attribute"`
}

type AttributeValue

type AttributeValue struct {
	XMLName xml.Name
	XS      string `xml:"xmlns:xs,attr"`
	XSI     string `xml:"xmlns:xsi,attr"`
	Type    string `xml:"xsi:type,attr"`
	Value   string `xml:",innerxml"`
}

type Audience

type Audience struct {
	XMLName xml.Name
	Value   string `xml:",innerxml"`
}

type AudienceRestriction

type AudienceRestriction struct {
	XMLName   xml.Name
	Audiences []Audience `xml:"Audience"`
}

type AuthnContext

type AuthnContext struct {
	XMLName              xml.Name
	AuthnContextClassRef AuthnContextClassRef `xml:"AuthnContextClassRef"`
}

type AuthnContextClassRef

type AuthnContextClassRef struct {
	XMLName   xml.Name
	SAML      string `xml:"xmlns:saml,attr,omitempty"`
	Transport string `xml:",innerxml"`
}

type AuthnRequest

type AuthnRequest struct {
	XMLName                        xml.Name
	SAMLP                          string                `xml:"xmlns:samlp,attr"`
	SAML                           string                `xml:"xmlns:saml,attr"`
	ID                             string                `xml:"ID,attr"`
	Version                        string                `xml:"Version,attr"`
	ProtocolBinding                string                `xml:"ProtocolBinding,attr"`
	AssertionConsumerServiceURL    string                `xml:"AssertionConsumerServiceURL,attr"`
	Destination                    string                `xml:"Destination,attr"`
	IssueInstant                   time.Time             `xml:"IssueInstant,attr"`
	AssertionConsumerServiceIndex  int                   `xml:"AssertionConsumerServiceIndex,attr"`
	AttributeConsumingServiceIndex int                   `xml:"AttributeConsumingServiceIndex,attr"`
	Issuer                         Issuer                `xml:"Issuer"`
	NameIDPolicy                   NameIDPolicy          `xml:"NameIDPolicy"`
	RequestedAuthnContext          RequestedAuthnContext `xml:"RequestedAuthnContext"`
	Signature                      *Signature            `xml:"Signature,omitempty"`
	ForceAuthn                     string                `xml:"ForceAuthn"`
	IsPassive                      string                `xml:"IsPassive"`
	ProviderName                   string                `xml:"ProviderName"`
}

func (*AuthnRequest) Validate

func (a *AuthnRequest) Validate() error

type AuthnStatement

type AuthnStatement struct {
	XMLName             xml.Name
	AuthnInstant        string       `xml:",attr"`
	SessionNotOnOrAfter string       `xml:",attr,omitempty"`
	SessionIndex        string       `xml:",attr,omitempty"`
	AuthnContext        AuthnContext `xml:"AuthnContext"`
}

type CanonicalizationMethod

type CanonicalizationMethod struct {
	XMLName   xml.Name
	Algorithm string `xml:"Algorithm,attr"`
}

type Conditions

type Conditions struct {
	XMLName             xml.Name
	NotBefore           string              `xml:",attr"`
	NotOnOrAfter        string              `xml:",attr"`
	AudienceRestriction AudienceRestriction `xml:"AudienceRestriction,omitempty"`
}

type ContactPerson

type ContactPerson struct {
	ContactType  string `xml:"contactType,attr"`
	GivenName    string `xml:"GivenName"`
	SurName      string `xml:"SurName"`
	EmailAddress string `xml:"EmailAddress"`
}

type DigestMethod

type DigestMethod struct {
	XMLName   xml.Name
	Algorithm string `xml:"Algorithm,attr"`
}

type DigestValue

type DigestValue struct {
	XMLName xml.Name
}

type EntityAttributes

type EntityAttributes struct {
	XMLName xml.Name
	SAML    string `xml:"xmlns:saml,attr"`

	EntityAttributes []Attribute `xml:"Attribute"` // should be array??
}

type EntityDescriptor

type EntityDescriptor struct {
	XMLName  xml.Name
	DS       string `xml:"xmlns:ds,attr"`
	XMLNS    string `xml:"xmlns,attr"`
	MD       string `xml:"xmlns:md,attr"`
	EntityId string `xml:"entityID,attr"`

	Extensions      Extensions      `xml:"Extensions"`
	SPSSODescriptor SPSSODescriptor `xml:"SPSSODescriptor"`
}

type Extensions

type Extensions struct {
	XMLName xml.Name
	Alg     string `xml:"xmlns:alg,attr"`
	MDAttr  string `xml:"xmlns:mdattr,attr"`
	MDRPI   string `xml:"xmlns:mdrpi,attr"`

	EntityAttributes string `xml:"EntityAttributes"`
}

type IDPEntityDescriptor

type IDPEntityDescriptor struct {
	XMLName          xml.Name
	DS               string           `xml:"xmlns:ds,attr"`
	XMLNS            string           `xml:"xmlns,attr"`
	ASSERTION        string           `xml:"xmlns:assertion,attr"`
	EntityId         string           `xml:"entityID,attr"`
	IDPSSODescriptor IDPSSODescriptor `xml:"IDPSSODescriptor"`
	Organization     *Organization    `xml:"Organization"`
	ContactPerson    *[]ContactPerson `xml:"ContactPerson"`
}

func GetIdpEntityDescriptor

func GetIdpEntityDescriptor() *IDPEntityDescriptor

type IDPSSODescriptor

type IDPSSODescriptor struct {
	XMLName                    xml.Name
	WantAuthnRequestsSigned    string `xml:"WantAuthnRequestsSigned,attr"`
	ProtocolSupportEnumeration string `xml:"protocolSupportEnumeration,attr"`
	SigningKeyDescriptor       KeyDescriptor
	SingleSignOnService        []SingleSignOnService `xml:"SingleSignOnService"`
	SingleLogoutService        []SingleLogoutService `xml:"SingleLogoutService"`
}

type Issuer

type Issuer struct {
	XMLName xml.Name
	SAML    string `xml:"xmlns:saml,attr,omitempty"`
	Url     string `xml:",innerxml"`
}

type KeyDescriptor

type KeyDescriptor struct {
	XMLName xml.Name
	Use     string  `xml:"use,attr"`
	KeyInfo KeyInfo `xml:"KeyInfo"`
}

type KeyInfo

type KeyInfo struct {
	XMLName  xml.Name
	X509Data X509Data `xml:",innerxml"`
}

type LogoutRequest

type LogoutRequest struct {
	XMLName      xml.Name
	XMLNS        string       `xml:"xmlns:samlp,attr"`
	ID           string       `xml:"ID,attr"`
	Version      string       `xml:"Version,attr"`
	IssueInstant string       `xml:"IssueInstant,attr"`
	NotOnOrAfter string       `xml:"NotOnOrAfter,attr"`
	Destination  string       `xml:"Destination,attr"`
	Issuer       Issuer       `xml:"Issuer"`
	Signature    *Signature   `xml:"Signature,omitempty"`
	NameID       NameID       `xml:"NameID"`
	SessionIndex SessionIndex `xml:"SessionIndex"`
}

func NewLogoutRequest

func NewLogoutRequest() *LogoutRequest

func (*LogoutRequest) SignedXml

func (r *LogoutRequest) SignedXml(idpPrivateKey *rsa.PrivateKey) (string, error)

func (*LogoutRequest) String

func (r *LogoutRequest) String() (string, error)

func (*LogoutRequest) Validate

func (r *LogoutRequest) Validate() error

type LogoutResponse

type LogoutResponse struct {
	XMLName      xml.Name
	XMLNSP       string     `xml:"xmlns:samlp,attr"`
	XMLNSL       string     `xml:"xmlns:saml,attr"`
	ID           string     `xml:"ID,attr"`
	Version      string     `xml:"Version,attr"`
	IssueInstant string     `xml:"IssueInstant,attr"`
	Destination  string     `xml:"Destination,attr"`
	InResponseTo string     `xml:"InResponseTo,attr,omitempty"`
	Issuer       Issuer     `xml:"Issuer"`
	Signature    *Signature `xml:"Signature,omitempty"`
	Status       Status     `xml:"Status"`
}

func NewLogoutResponse

func NewLogoutResponse() *LogoutResponse

func (*LogoutResponse) SetDigestAlgorithm

func (r *LogoutResponse) SetDigestAlgorithm(alg string)

func (*LogoutResponse) SetInResponseTo

func (r *LogoutResponse) SetInResponseTo(inResponseTo string)

func (*LogoutResponse) SetSignatureAlgorithm

func (r *LogoutResponse) SetSignatureAlgorithm(alg string)

func (*LogoutResponse) SignedXml

func (r *LogoutResponse) SignedXml(idpPrivateKey interface{}) (string, error)

func (*LogoutResponse) String

func (r *LogoutResponse) String() (string, error)

type NameID

type NameID struct {
	XMLName         xml.Name
	XMLNS           string `xml:"xmlns:saml,attr,omitempty"`
	Format          string `xml:",attr"`
	SPNameQualifier string `xml:",attr,omitempty"`
	Value           string `xml:",innerxml"`
}

type NameIDPolicy

type NameIDPolicy struct {
	XMLName     xml.Name
	AllowCreate bool   `xml:"AllowCreate,attr"`
	Format      string `xml:"Format,attr"`
}

type Organization

type Organization struct {
	OrganizationName        string `xml:"OrganizationName"`
	OrganizationDisplayName string `xml:"OrganizationDisplayName"`
	OrganizationURL         string `xml:"OrganizationURL"`
}

type RequestedAuthnContext

type RequestedAuthnContext struct {
	XMLName              xml.Name
	SAMLP                string               `xml:"xmlns:samlp,attr"`
	Comparison           string               `xml:"Comparison,attr"`
	AuthnContextClassRef AuthnContextClassRef `xml:"AuthnContextClassRef"`
}

type Response

type Response struct {
	XMLName      xml.Name
	SAMLP        string    `xml:"xmlns:samlp,attr"`
	SAML         string    `xml:"xmlns:saml,attr"`
	Destination  string    `xml:"Destination,attr"`
	ID           string    `xml:"ID,attr"`
	Version      string    `xml:"Version,attr"`
	IssueInstant string    `xml:"IssueInstant,attr"`
	InResponseTo string    `xml:"InResponseTo,attr,omitempty"`
	Issuer       Issuer    `xml:"Issuer"`
	Status       Status    `xml:"Status"`
	Assertion    Assertion `xml:"Assertion"`
}

func NewResponse

func NewResponse() *Response

func (*Response) AddAttributes

func (r *Response) AddAttributes(attributes []map[string]string)

func (*Response) AddAudience

func (r *Response) AddAudience(audiences []string)

func (*Response) SetDestination

func (r *Response) SetDestination(destination string)

func (*Response) SetDigestAlgorithm

func (r *Response) SetDigestAlgorithm(alg string)

func (*Response) SetIdpCertificate

func (r *Response) SetIdpCertificate(certPem string)

func (*Response) SetInResponseTo

func (r *Response) SetInResponseTo(inResponseTo string)

func (*Response) SetIssuer

func (r *Response) SetIssuer(issuer string)

func (*Response) SetNameId

func (r *Response) SetNameId(format string, value string)

func (*Response) SetSessionIndex

func (r *Response) SetSessionIndex(sessionIndex string)

func (*Response) SetSignatureAlgorithm

func (r *Response) SetSignatureAlgorithm(alg string)

func (*Response) SignedXml

func (r *Response) SignedXml(idpPrivateKey interface{}) (string, error)

func (*Response) String

func (r *Response) String() (string, error)

type SPSSODescriptor

type SPSSODescriptor struct {
	XMLName                    xml.Name
	ProtocolSupportEnumeration string `xml:"protocolSupportEnumeration,attr"`
	SigningKeyDescriptor       KeyDescriptor
	EncryptionKeyDescriptor    KeyDescriptor
	// SingleLogoutService        SingleLogoutService `xml:"SingleLogoutService"`
	AssertionConsumerServices []AssertionConsumerService `xml:"AssertionConsumerServices"`
}

type SPSSODescriptors

type SPSSODescriptors struct {
}

type SamlsigReference

type SamlsigReference struct {
	XMLName      xml.Name
	URI          string       `xml:"URI,attr"`
	Transforms   Transforms   `xml:",innerxml"`
	DigestMethod DigestMethod `xml:",innerxml"`
	DigestValue  DigestValue  `xml:",innerxml"`
}

type SessionIndex

type SessionIndex struct {
	XMLName xml.Name
	Value   string `xml:",innerxml"`
}

type Signature

type Signature struct {
	XMLName        xml.Name
	SAMLSIG        string `xml:"xmlns:ds,attr"`
	SignedInfo     SignedInfo
	SignatureValue SignatureValue
	KeyInfo        KeyInfo
}

type SignatureMethod

type SignatureMethod struct {
	XMLName   xml.Name
	Algorithm string `xml:"Algorithm,attr"`
}

type SignatureValue

type SignatureValue struct {
	XMLName xml.Name
	Value   string `xml:",innerxml"`
}

type SignedInfo

type SignedInfo struct {
	XMLName                xml.Name
	CanonicalizationMethod CanonicalizationMethod
	SignatureMethod        SignatureMethod
	SamlsigReference       SamlsigReference
}

type SingleLogoutService

type SingleLogoutService struct {
	XMLName  xml.Name
	Index    string `xml:"index,attr"`
	Binding  string `xml:"Binding,attr"`
	Location string `xml:"Location,attr"`
}

type SingleSignOnService

type SingleSignOnService struct {
	XMLName  xml.Name
	Index    string `xml:"index,attr"`
	Binding  string `xml:"Binding,attr"`
	Location string `xml:"Location,attr"`
}

type Status

type Status struct {
	XMLName    xml.Name
	StatusCode StatusCode `xml:"StatusCode"`
}

type StatusCode

type StatusCode struct {
	XMLName xml.Name
	Value   string `xml:",attr"`
}

type Subject

type Subject struct {
	XMLName             xml.Name
	NameID              NameID
	SubjectConfirmation SubjectConfirmation
}

type SubjectConfirmation

type SubjectConfirmation struct {
	XMLName                 xml.Name
	Method                  string `xml:",attr"`
	SubjectConfirmationData SubjectConfirmationData
}

type SubjectConfirmationData

type SubjectConfirmationData struct {
	XMLName      xml.Name
	InResponseTo string `xml:",attr,omitempty"`
	NotOnOrAfter string `xml:",attr"`
	Recipient    string `xml:",attr"`
}

type Transform

type Transform struct {
	XMLName   xml.Name
	Algorithm string `xml:"Algorithm,attr"`
}

type Transforms

type Transforms struct {
	XMLName   xml.Name
	Transform []Transform
}

type X509Certificate

type X509Certificate struct {
	XMLName xml.Name
	Cert    string `xml:",innerxml"`
}

type X509Data

type X509Data struct {
	XMLName         xml.Name
	X509Certificate X509Certificate `xml:",innerxml"`
}

Jump to

Keyboard shortcuts

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