Documentation ¶
Index ¶
- Variables
- type PrefixStore
- type Server
- func (s *Server) CreateSession(w http.ResponseWriter, r *http.Request, assertion *saml.Assertion) error
- func (s *Server) DeleteSession(w http.ResponseWriter, r *http.Request) error
- func (s *Server) GetSession(r *http.Request) (samlsp.Session, error)
- func (s *Server) GetTrackedRequest(r *http.Request, index string) (*samlsp.TrackedRequest, error)
- func (s *Server) GetTrackedRequests(r *http.Request) []samlsp.TrackedRequest
- func (s *Server) LambdaHandler(ctx context.Context, req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
- func (s *Server) ListenAndServe() error
- func (s *Server) StartLambdaHandler()
- func (s *Server) StopTrackingRequest(w http.ResponseWriter, r *http.Request, index string) error
- func (s *Server) TrackRequest(w http.ResponseWriter, r *http.Request, samlRequestID string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ErrNoTrackedRequest = errors.New("saml: tracked request not present")
ErrNoTrackedRequest is returned for invalid and expired relay states
Functions ¶
This section is empty.
Types ¶
type PrefixStore ¶
type PrefixStore struct {
// contains filtered or unexported fields
}
PrefixStore enables multiple sessions to be stored in a single session store by automatically pre-pending a prefix to tokens.
func NewPrefixStore ¶
func NewPrefixStore(prefix string, store scs.Store) *PrefixStore
NewPrefixStore wraps a session store so it can be shared.
func (*PrefixStore) Delete ¶
func (s *PrefixStore) Delete(token string) (err error)
Delete removes the session token and data from the store.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides an HTTP server.
func (*Server) CreateSession ¶
func (s *Server) CreateSession(w http.ResponseWriter, r *http.Request, assertion *saml.Assertion) error
CreateSession is called when we have received a valid SAML assertion and should create a new session and modify the http response accordingly, e.g. by setting a cookie.
func (*Server) DeleteSession ¶
DeleteSession is called to modify the response such that it removed the current session, e.g. by deleting a cookie.
func (*Server) GetSession ¶
GetSession returns the current samlsp.Session associated with the request, or ErrNoSession if there is no valid session.
func (*Server) GetTrackedRequest ¶
GetTrackedRequest returns a pending tracked request.
func (*Server) GetTrackedRequests ¶
func (s *Server) GetTrackedRequests(r *http.Request) []samlsp.TrackedRequest
GetTrackedRequests returns all the pending tracked requests
func (*Server) LambdaHandler ¶
func (s *Server) LambdaHandler(ctx context.Context, req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
LambdaHandler processes a single Lambda event.
func (*Server) ListenAndServe ¶
ListenAndServe starts the server waiting for network connections.
func (*Server) StartLambdaHandler ¶
func (s *Server) StartLambdaHandler()
StartLambdaHandler starts the server waiting for events from AWS Lambda.
func (*Server) StopTrackingRequest ¶
StopTrackingRequest stops tracking the SAML request given by index, which is a string previously returned from TrackRequest
func (*Server) TrackRequest ¶
func (s *Server) TrackRequest(w http.ResponseWriter, r *http.Request, samlRequestID string) (string, error)
TrackRequest starts tracking the SAML request with the given ID. It returns an `index` that should be used as the RelayState in the SAMl request flow.