saml

package
v0.0.0-...-09efcc3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ConfigureLoginFinishRoute

func ConfigureLoginFinishRoute(route httproute.Route) httproute.Route

func ConfigureLoginRoute

func ConfigureLoginRoute(route httproute.Route) httproute.Route

func ConfigureLogoutRoute

func ConfigureLogoutRoute(route httproute.Route) httproute.Route

func ConfigureMetadataRoute

func ConfigureMetadataRoute(route httproute.Route) httproute.Route

Types

type BindingHTTPPostWriter

type BindingHTTPPostWriter interface {
	WriteResponse(
		rw http.ResponseWriter,
		r *http.Request,
		callbackURL string,
		responseElement *etree.Element,
		relayState string) error
	WriteRequest(
		rw http.ResponseWriter,
		r *http.Request,
		callbackURL string,
		requestElement *etree.Element,
		relayState string) error
}

type BindingHTTPRedirectWriter

type BindingHTTPRedirectWriter interface {
	WriteResponse(
		rw http.ResponseWriter,
		r *http.Request,
		callbackURL string,
		responseElement *etree.Element,
		relayState string) error
	WriteRequest(
		rw http.ResponseWriter,
		r *http.Request,
		callbackURL string,
		requestElement *etree.Element,
		relayState string) error
}

type Endpoints

type Endpoints interface {
	LogoutEndpointURL() *url.URL
}

type HandlerSAMLService

type HandlerSAMLService interface {
	IdpEntityID() string
	IdpMetadata(serviceProviderId string) (*samlprotocol.Metadata, error)
	ValidateAuthnRequest(serviceProviderId string, authnRequest *samlprotocol.AuthnRequest) error
	IssueLoginSuccessResponse(
		ctx context.Context,
		callbackURL string,
		serviceProviderId string,
		authInfo authenticationinfo.T,
		inResponseToAuthnRequest *samlprotocol.AuthnRequest,
	) (*samlprotocol.Response, error)
	VerifyEmbeddedSignature(
		sp *config.SAMLServiceProviderConfig,
		samlRequestXML string) error
	VerifyExternalSignature(
		sp *config.SAMLServiceProviderConfig,
		element *saml.SAMLElementSigned,
		sigAlg string,
		relayState string,
		signature string) error
	IssueLogoutResponse(
		callbackURL string,
		inResponseToLogoutRequest *samlprotocol.LogoutRequest,
		isPartialLogout bool,
	) (*samlprotocol.LogoutResponse, error)
	IssueLogoutRequest(
		ctx context.Context,
		sp *config.SAMLServiceProviderConfig,
		sloSession *samlslosession.SAMLSLOSession,
	) (*samlprotocol.LogoutRequest, error)
}

type LoginFinishHandler

type LoginFinishHandler struct {
	Logger                     *LoginFinishHandlerLogger
	Clock                      clock.Clock
	SAMLService                HandlerSAMLService
	SAMLSessionService         SAMLSessionService
	AuthenticationInfoResolver SAMLAuthenticationInfoResolver
	AuthenticationInfoService  SAMLAuthenticationInfoService

	LoginResultHandler LoginResultHandler

	BindingHTTPPostWriter BindingHTTPPostWriter
}

func (*LoginFinishHandler) ServeHTTP

func (h *LoginFinishHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type LoginFinishHandlerLogger

type LoginFinishHandlerLogger struct{ *log.Logger }

func NewLoginFinishHandlerLogger

func NewLoginFinishHandlerLogger(lf *log.Factory) *LoginFinishHandlerLogger

type LoginHandler

type LoginHandler struct {
	Logger             *LoginHandlerLogger
	Clock              clock.Clock
	Database           *appdb.Handle
	SAMLConfig         *config.SAMLConfig
	SAMLService        HandlerSAMLService
	SAMLSessionService SAMLSessionService
	SAMLUIService      SAMLUIService

	UserFacade SAMLUserFacade

	LoginResultHandler    LoginResultHandler
	BindingHTTPPostWriter BindingHTTPPostWriter
}

func (*LoginHandler) ServeHTTP

func (h *LoginHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type LoginHandlerLogger

type LoginHandlerLogger struct{ *log.Logger }

func NewLoginHandlerLogger

func NewLoginHandlerLogger(lf *log.Factory) *LoginHandlerLogger

type LoginResultHandler

type LoginResultHandler struct {
	Clock       clock.Clock
	Database    *appdb.Handle
	SAMLService HandlerSAMLService
}

type LogoutHandler

type LogoutHandler struct {
	Logger                *LogoutHandlerLogger
	Clock                 clock.Clock
	Database              *appdb.Handle
	SAMLConfig            *config.SAMLConfig
	SAMLService           HandlerSAMLService
	SessionManager        SessionManager
	SAMLSLOSessionService SAMLSLOSessionService
	SAMLSLOService        SAMLSLOService
	Endpoints             Endpoints

	BindingHTTPPostWriter     BindingHTTPPostWriter
	BindingHTTPRedirectWriter BindingHTTPRedirectWriter
}

func (*LogoutHandler) ServeHTTP

func (h *LogoutHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type LogoutHandlerLogger

type LogoutHandlerLogger struct{ *log.Logger }

func NewLogoutHandlerLogger

func NewLogoutHandlerLogger(lf *log.Factory) *LogoutHandlerLogger

type MetadataHandler

type MetadataHandler struct {
	SAMLService HandlerSAMLService
}

func (*MetadataHandler) ServeHTTP

func (h *MetadataHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type SAMLAuthenticationInfoResolver

type SAMLAuthenticationInfoResolver interface {
	GetAuthenticationInfoID(req *http.Request) (string, bool)
}

type SAMLAuthenticationInfoService

type SAMLAuthenticationInfoService interface {
	Get(ctx context.Context, entryID string) (*authenticationinfo.Entry, error)
	Delete(ctx context.Context, entryID string) error
}

type SAMLErrorResult

type SAMLErrorResult struct {
	Response samlprotocol.Respondable
	Cause    error
}

func NewSAMLErrorResult

func NewSAMLErrorResult(cause error, response samlprotocol.Respondable) *SAMLErrorResult

func (*SAMLErrorResult) Error

func (s *SAMLErrorResult) Error() string

func (*SAMLErrorResult) Unwrap

func (s *SAMLErrorResult) Unwrap() error

type SAMLSLOService

type SAMLSLOService interface {
	SendSLORequest(
		ctx context.Context,
		rw http.ResponseWriter,
		r *http.Request,
		sloSession *samlslosession.SAMLSLOSession,
		sp *config.SAMLServiceProviderConfig,
	) error
}

type SAMLSLOSessionService

type SAMLSLOSessionService interface {
	Get(ctx context.Context, sessionID string) (entry *samlslosession.SAMLSLOSession, err error)
	Save(ctx context.Context, session *samlslosession.SAMLSLOSession) (err error)
}

type SAMLSessionService

type SAMLSessionService interface {
	Save(ctx context.Context, entry *samlsession.SAMLSession) (err error)
	Get(ctx context.Context, entryID string) (*samlsession.SAMLSession, error)
	Delete(ctx context.Context, entryID string) error
}

type SAMLUIService

type SAMLUIService interface {
	ResolveUIInfo(
		sp *config.SAMLServiceProviderConfig,
		entry *samlsession.SAMLSessionEntry,
	) (info *samlsession.SAMLUIInfo, showUI bool, err error)
	BuildAuthenticationURL(s *samlsession.SAMLSession) (*url.URL, error)
}

type SAMLUserFacade

type SAMLUserFacade interface {
	GetUserIDsByLoginHint(ctx context.Context, hint *oauth.LoginHint) ([]string, error)
}

type SessionManager

type SessionManager interface {
	Get(ctx context.Context, id string) (session.ListableSession, error)
	Logout(ctx context.Context, sessionBase session.SessionBase, w http.ResponseWriter) ([]session.ListableSession, error)
}

Jump to

Keyboard shortcuts

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