Versions in this module Expand all Collapse all v1 v1.0.0 Jul 29, 2025 Changes in this version + var ErrAuthRequestNotFound = errors.New("auth request not found") + var ErrDecodePEMBlock = errors.New("failed to decode PEM block containing certificate") + var ErrEntityNotFound = errors.New("entity not found") + var ErrInvalidAuthRequestType = errors.New("invalid auth request type") + var ErrInvalidCertificate = errors.New("invalid certificate data") + var ErrLogoutContextNotFound = errors.New("logout context not found") + var ErrNoMetadataURL = errors.New("no metadata URL configured for SP") + var ErrNoSPSSODescriptor = errors.New("no SPSSODescriptor found in metadata") + var ErrNoSigningCertificate = errors.New("no signing certificate found in metadata") + var ErrNoSingleLogoutService = errors.New("no SingleLogoutService found in metadata") + var ErrPrivateKeyIsNil = errors.New("private key is nil") + var ErrPrivateKeyNotRSA = errors.New("private key is not an RSA key") + var ErrPrivateKeyNotRSAKey = errors.New("private key is not an RSA key") + var ErrSPNotInAllowedList = errors.New("SP not found in allowed list") + func FetchMetadataWithRetry(ctx context.Context, client *http.Client, metadataURL url.URL, ...) (*saml.EntityDescriptor, error) + func GenerateTestCertificate(t *testing.T) (string, string) + func GetSPSigningCertificateFromMetadata(ctx context.Context, cfg config.Config, spEntityID string, ...) (*x509.Certificate, error) + func LoadCertificate(certPath, keyPath string) (tls.Certificate, error) + func ReadMetadataFromURLWithRetry(ctx context.Context, client *http.Client, metadataURL string, ...) ([]byte, error) + type AuthRequest struct + AccessConsumerServiceURL string + ApplicationID string + Assertion *saml.Assertion + AuthRequestID string + BindingType string + CompletedAt time.Time + Destination string + ID string + IsDone bool + Issuer string + RelayState string + UserID string + func (a *AuthRequest) Done() bool + func (a *AuthRequest) GetAccessConsumerServiceURL() string + func (a *AuthRequest) GetApplicationID() string + func (a *AuthRequest) GetAuthRequestID() string + func (a *AuthRequest) GetBindingType() string + func (a *AuthRequest) GetDestination() string + func (a *AuthRequest) GetID() string + func (a *AuthRequest) GetIssuer() string + func (a *AuthRequest) GetRelayState() string + func (a *AuthRequest) GetUserID() string + type IDP struct + EntityID string + IDP *provider.Provider + IDPStorage *Storage + func CreateProxyIDP(cfg config.Config) (*IDP, error) + func (i *IDP) GetProvider() *provider.Provider + func (i *IDP) GetStorage() *Storage + type LogoutContext struct + CreatedAt time.Time + ID string + LogoutRequestID string + OriginID string + OriginType string + ProcessedRequests map[string]bool + RelayState string + TargetID string + type SPCertificateCache struct + func NewSPCertificateCache() *SPCertificateCache + func (c *SPCertificateCache) Get(entityID string) (*x509.Certificate, bool) + func (c *SPCertificateCache) Set(entityID string, cert *x509.Certificate) + type ServiceProvider struct + ID string + Middleware *samlsp.Middleware + type ServiceProviders struct + Default *ServiceProvider + Providers map[string]*ServiceProvider + func CreateServiceProviders(ctx context.Context, cfg config.Config) (*ServiceProviders, error) + func (s *ServiceProviders) GetProvider(id string) *ServiceProvider + type SingleLogoutService struct + Binding string + Location string + ResponseLocation string + type Storage struct + func NewStorage(cfg config.Config) (*Storage, error) + func (s *Storage) AddAuthRequestForTesting(authRequest *AuthRequest) + func (s *Storage) AuthRequestByID(_ context.Context, id string) (models.AuthRequestInt, error) + func (s *Storage) CheckAndMarkLogoutRequestProcessed(contextID, requestID string) (bool, error) + func (s *Storage) CleanupCompletedAuthRequests(maxAge time.Duration) int + func (s *Storage) CreateAuthRequest(_ context.Context, authnRequest *samlp.AuthnRequestType, ...) (models.AuthRequestInt, error) + func (s *Storage) CreateLogoutContext(originType, originID, targetID, relayState string) *LogoutContext + func (s *Storage) DeleteLogoutContext(id string) + func (s *Storage) GetAllowedSPs() []config.SPConfig + func (s *Storage) GetCA(_ context.Context) (*key.CertificateAndKey, error) + func (s *Storage) GetConfig() config.Config + func (s *Storage) GetEntityByID(ctx context.Context, entityID string) (*serviceprovider.ServiceProvider, error) + func (s *Storage) GetEntityIDByAppID(_ context.Context, appID string) (string, error) + func (s *Storage) GetLogoutContext(id string) (*LogoutContext, error) + func (s *Storage) GetMetadataSigningKey(_ context.Context) (*key.CertificateAndKey, error) + func (s *Storage) GetResponseSigningKey(_ context.Context) (*key.CertificateAndKey, error) + func (s *Storage) GetSPCertificateCache() *SPCertificateCache + func (s *Storage) GetSingleLogoutServiceFromSP(ctx context.Context, entityID string) (*SingleLogoutService, error) + func (s *Storage) Health(_ context.Context) error + func (s *Storage) SetEntityIDMapping(appID, entityID string) + func (s *Storage) SetUserinfoWithLoginName(_ context.Context, userinfo models.AttributeSetter, loginName string, _ []int) error + func (s *Storage) SetUserinfoWithUserID(ctx context.Context, authRequestID string, userinfo models.AttributeSetter, ...) error