Documentation
¶
Index ¶
- type DB
- func (db *DB) AddServiceProvider(service *samlidp.Service) error
- func (db *DB) AddSession(session *saml.Session) error
- func (db *DB) DeleteServiceProvider(serviceID string) error
- func (db *DB) DeleteSession(sessionID string) error
- func (db *DB) GetServiceProvider(r *http.Request, serviceProviderID string) (*saml.EntityDescriptor, error)
- func (db *DB) GetServiceProviders() (*[]samlidp.Service, error)
- func (db *DB) GetSession(w http.ResponseWriter, r *http.Request, req *saml.IdpAuthnRequest) (*saml.Session, error)
- func (db *DB) GetSessions() (*[]saml.Session, error)
- type FakeDB
- type IDPStore
- func (s *IDPStore) AddServiceProvider(service *samlidp.Service) error
- func (s *IDPStore) AddSession(session *saml.Session) error
- func (s *IDPStore) DeleteServiceProvider(serviceID string) error
- func (s *IDPStore) DeleteSession(sessionID string) error
- func (s *IDPStore) GetServiceProvider(r *http.Request, serviceProviderID string) (*saml.EntityDescriptor, error)
- func (s *IDPStore) GetServiceProviders() (*[]samlidp.Service, error)
- func (s *IDPStore) GetSession(w http.ResponseWriter, r *http.Request, req *saml.IdpAuthnRequest) (*saml.Session, error)
- func (s *IDPStore) GetSessions() (*[]saml.Session, error)
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
DB emulates a database driver using in-memory data structures.
func (*DB) AddServiceProvider ¶
AddServiceProvider adds metadata of the SP
func (*DB) AddSession ¶
AddSession adds new sessions
func (*DB) DeleteServiceProvider ¶
DeleteServiceProvider deletes metadata for the given serviceID
func (*DB) DeleteSession ¶
DeleteSession deletes session
func (*DB) GetServiceProvider ¶
func (db *DB) GetServiceProvider(r *http.Request, serviceProviderID string) (*saml.EntityDescriptor, error)
GetServiceProvider returns spMetadata for given serviceProviderID which is entityID
func (*DB) GetServiceProviders ¶
GetServiceProviders lists all SP
func (*DB) GetSession ¶
func (db *DB) GetSession(w http.ResponseWriter, r *http.Request, req *saml.IdpAuthnRequest) (*saml.Session, error)
GetSession return saml Session
type IDPStore ¶
type IDPStore struct {
Services backends.Repository
Sessions backends.Repository
}
IDPStore represents the IDP store containing the Services and Sessions repositories
func (*IDPStore) AddServiceProvider ¶
AddServiceProvider register new service provider, update if already exists.
func (*IDPStore) AddSession ¶
AddSession adds new session in DB
func (*IDPStore) DeleteServiceProvider ¶
DeleteServiceProvider deletes the service by serviceID which is EntityID
func (*IDPStore) DeleteSession ¶
DeleteSession deletes session by sessionID which is cookie value
func (*IDPStore) GetServiceProvider ¶
func (s *IDPStore) GetServiceProvider(r *http.Request, serviceProviderID string) (*saml.EntityDescriptor, error)
GetServiceProvider returns the Service Provider metadata for the service provider ID, which is typically the service provider's metadata URL. If an appropriate service provider cannot be found then the returned error must be os.ErrNotExist.
func (*IDPStore) GetServiceProviders ¶
GetServiceProviders returns all SP
func (*IDPStore) GetSession ¶
func (s *IDPStore) GetSession(w http.ResponseWriter, r *http.Request, req *saml.IdpAuthnRequest) (*saml.Session, error)
GetSession returns the *Session for this request. If a session cookie already exists and represents a valid session, then the session is returned
type Repository ¶
type Repository interface {
// AddSession adds new session in DB
AddSession(session *saml.Session) error
// GetSession looks up a Sessions by the session ID.
GetSession(w http.ResponseWriter, r *http.Request, req *saml.IdpAuthnRequest) (*saml.Session, error)
// DeleteSession deletes session by sessionID which is cookie value
DeleteSession(sessionID string) error
// GetSessions returns all sessions
GetSessions() (*[]saml.Session, error)
// AddServiceProvider register new service provider
AddServiceProvider(service *samlidp.Service) error
// GetServiceProvider returns the Service Provider metadata for the service provider IDs
GetServiceProvider(r *http.Request, serviceProviderID string) (*saml.EntityDescriptor, error)
// DeleteServiceProvider deletes the service by serviceID which is EntityID
DeleteServiceProvider(serviceID string) error
// GetServiceProviders returns all SP
GetServiceProviders() (*[]samlidp.Service, error)
}
Repository defines interface for accessing DB
func NewIDPStore ¶
func NewIDPStore(cfg *config.DBConfig) (store Repository, cleanup func(), err error)
NewIDPStore creates IDP's repositories