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(requestorToken irma.RequestorToken) error
- func GetRequest(token irma.RequestorToken) irma.RequestorRequest
- func GetSessionResult(requestorToken irma.RequestorToken) *server.SessionResult
- func HandlerFunc() http.HandlerFunc
- func Initialize(conf *server.Configuration) (err error)
- func PairingCompleted(requestorToken irma.RequestorToken) error
- func Revoke(credid irma.CredentialTypeIdentifier, key string, issued time.Time) error
- func SessionStatus(requestorToken irma.RequestorToken) (chan irma.ServerStatus, error)
- func SetFrontendOptions(requestorToken irma.RequestorToken, request *irma.FrontendOptionsRequest) (*irma.SessionOptions, error)
- func StartSession(request interface{}, handler server.SessionHandler) (*irma.Qr, irma.RequestorToken, *irma.FrontendSessionRequest, error)
- func Stop()
- func SubscribeServerSentEvents(w http.ResponseWriter, r *http.Request, token string, requestor bool) error
- type Server
- func (s *Server) CancelSession(requestorToken irma.RequestorToken) error
- func (s *Server) GetRequest(requestorToken irma.RequestorToken) irma.RequestorRequest
- func (s *Server) GetSessionResult(requestorToken irma.RequestorToken) *server.SessionResult
- func (s *Server) HandlerFunc() http.HandlerFunc
- func (s *Server) PairingCompleted(requestorToken irma.RequestorToken) error
- func (s *Server) Revoke(credid irma.CredentialTypeIdentifier, key string, issued time.Time) error
- func (s *Server) SessionStatus(requestorToken irma.RequestorToken) (chan irma.ServerStatus, error)
- func (s *Server) SetFrontendOptions(requestorToken irma.RequestorToken, request *irma.FrontendOptionsRequest) (*irma.SessionOptions, error)
- func (s *Server) StartSession(req interface{}, handler server.SessionHandler) (*irma.Qr, irma.RequestorToken, *irma.FrontendSessionRequest, error)
- func (s *Server) Stop()
- func (s *Server) SubscribeServerSentEvents(w http.ResponseWriter, r *http.Request, token string, requestor bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CancelSession ¶
func CancelSession(requestorToken irma.RequestorToken) error
CancelSession cancels the specified IRMA session.
func GetRequest ¶
func GetRequest(token irma.RequestorToken) irma.RequestorRequest
GetRequest retrieves the request submitted by the requestor that started the specified IRMA session.
func GetSessionResult ¶
func GetSessionResult(requestorToken irma.RequestorToken) *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 PairingCompleted ¶ added in v0.8.0
func PairingCompleted(requestorToken irma.RequestorToken) error
Complete pairing between the irma client and the frontend. Returns an error when no client is actually connected.
func Revoke ¶ added in v0.5.0
Revoke revokes the earlier issued credential specified by key. (Can only be used if this server is the revocation server for the specified credential type and if the corresponding issuer private key is present in the server configuration.)
func SessionStatus ¶ added in v0.8.0
func SessionStatus(requestorToken irma.RequestorToken) (chan irma.ServerStatus, error)
SessionStatus retrieves a channel on which the current session status of the specified IRMA session can be retrieved.
func SetFrontendOptions ¶ added in v0.8.0
func SetFrontendOptions(requestorToken irma.RequestorToken, request *irma.FrontendOptionsRequest) (*irma.SessionOptions, error)
Requests a change of the session frontend options at the server. Returns the updated session options struct. Frontend options can only be changed when the client is not connected yet. Otherwise an error is returned. Options that are not specified in the request, keep their old value.
func StartSession ¶
func StartSession(request interface{}, handler server.SessionHandler, ) (*irma.Qr, irma.RequestorToken, *irma.FrontendSessionRequest, error)
StartSession starts an IRMA session, running the handler on completion, if specified. The session requestorToken (the second return parameter) can be used in GetSessionResult() and CancelSession(). The session's frontendAuth (the third return parameter) is needed by frontend clients (i.e. browser libraries) to POST to the '/frontend' endpoints of the IRMA protocol. 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 {
// contains filtered or unexported fields
}
func (*Server) CancelSession ¶
func (s *Server) CancelSession(requestorToken irma.RequestorToken) error
func (*Server) GetRequest ¶
func (s *Server) GetRequest(requestorToken irma.RequestorToken) irma.RequestorRequest
func (*Server) GetSessionResult ¶
func (s *Server) GetSessionResult(requestorToken irma.RequestorToken) *server.SessionResult
func (*Server) HandlerFunc ¶
func (s *Server) HandlerFunc() http.HandlerFunc
func (*Server) PairingCompleted ¶ added in v0.8.0
func (s *Server) PairingCompleted(requestorToken irma.RequestorToken) error
func (*Server) SessionStatus ¶ added in v0.8.0
func (s *Server) SessionStatus(requestorToken irma.RequestorToken) (chan irma.ServerStatus, error)
func (*Server) SetFrontendOptions ¶ added in v0.8.0
func (s *Server) SetFrontendOptions(requestorToken irma.RequestorToken, request *irma.FrontendOptionsRequest) (*irma.SessionOptions, error)
func (*Server) StartSession ¶
func (s *Server) StartSession(req interface{}, handler server.SessionHandler, ) (*irma.Qr, irma.RequestorToken, *irma.FrontendSessionRequest, error)