Documentation ¶
Overview ¶
Package irmaserver is a library that allows IRMA verifiers, issuers or attribute-based signature applications to perform IRMA sessions with irmaclient instances (i.e. the IRMA app). It exposes functions for handling IRMA sessions and a HTTP handler that handles the sessions with the irmaclient.
Index ¶
- func CancelSession(token string) error
- func GetRequest(token string) irma.RequestorRequest
- func GetSessionResult(token string) *server.SessionResult
- func HandlerFunc() http.HandlerFunc
- func Initialize(conf *server.Configuration) (err error)
- func StartSession(request interface{}, handler SessionHandler) (*irma.Qr, string, error)
- func Stop()
- func SubscribeServerSentEvents(w http.ResponseWriter, r *http.Request, token string, requestor bool) error
- type Server
- func (s *Server) CancelSession(token string) error
- func (s *Server) GetRequest(token string) irma.RequestorRequest
- func (s *Server) GetSessionResult(token string) *server.SessionResult
- func (s *Server) HandlerFunc() http.HandlerFunc
- func (s *Server) StartSession(request interface{}, handler SessionHandler) (*irma.Qr, string, error)
- func (s *Server) Stop()
- func (s *Server) SubscribeServerSentEvents(w http.ResponseWriter, r *http.Request, token string, requestor bool) error
- type SessionHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CancelSession ¶
CancelSession cancels the specified IRMA session.
func GetRequest ¶
func GetRequest(token string) irma.RequestorRequest
GetRequest retrieves the request submitted by the requestor that started the specified IRMA session.
func GetSessionResult ¶
func GetSessionResult(token string) *server.SessionResult
GetSessionResult retrieves the result of the specified IRMA session.
func HandlerFunc ¶
func HandlerFunc() http.HandlerFunc
HandlerFunc returns a http.HandlerFunc that handles the IRMA protocol with IRMA apps.
Example usage:
http.HandleFunc("/irma/", irmaserver.HandlerFunc())
The IRMA app can then perform IRMA sessions at https://example.com/irma.
func Initialize ¶
func Initialize(conf *server.Configuration) (err error)
Initialize the default server instance with the specified configuration using New().
func StartSession ¶
func StartSession(request interface{}, handler SessionHandler) (*irma.Qr, string, error)
StartSession starts an IRMA session, running the handler on completion, if specified. The session token (the second return parameter) can be used in GetSessionResult() and CancelSession(). The request parameter can be an irma.RequestorRequest, or an irma.SessionRequest, or a ([]byte or string) JSON representation of one of those (for more details, see server.ParseSessionRequest().)
func SubscribeServerSentEvents ¶
func SubscribeServerSentEvents(w http.ResponseWriter, r *http.Request, token string, requestor bool) error
SubscribeServerSentEvents subscribes the HTTP client to server sent events on status updates of the specified IRMA session.
Types ¶
type Server ¶
type Server struct { *servercore.Server // contains filtered or unexported fields }
Server is an irmaserver instance.
func New ¶
func New(conf *server.Configuration) (*Server, error)
New creates a new Server instance with the specified configuration.
func (*Server) CancelSession ¶
func (*Server) GetRequest ¶
func (*Server) GetSessionResult ¶
func (s *Server) GetSessionResult(token string) *server.SessionResult
func (*Server) HandlerFunc ¶
func (s *Server) HandlerFunc() http.HandlerFunc
func (*Server) StartSession ¶
func (s *Server) StartSession(request interface{}, handler SessionHandler) (*irma.Qr, string, error)
func (*Server) SubscribeServerSentEvents ¶
type SessionHandler ¶
type SessionHandler func(*server.SessionResult)
SessionHandler is a function that can handle a session result once an IRMA session has completed.