Documentation ¶
Overview ¶
Package api provides primitives to interact the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
Index ¶
- func RegisterHandlers(router runtime.EchoRouter, si ServerInterface)
- type Contract
- type ContractSigningRequest
- type CreateSessionResult
- type DisclosedAttribute
- type DisclosedAttributeIndex
- type ErrorString
- type IrmaQR
- type Language
- type NutsAuthGetContractByTypeParams
- type Proof
- type ProofD
- type ProofP
- type ProofS
- type ProofU
- type RemoteError
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) NutsAuthCreateSession(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) NutsAuthGetContractByType(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) NutsAuthSessionRequestStatus(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) NutsAuthValidateContract(ctx echo.Context) error
- type SessionResult
- type SignedMessage
- type Timestamp
- type Type
- type ValidationRequest
- type ValidationResult
- type Version
- type Wrapper
- func (api *Wrapper) NutsAuthCreateSession(ctx echo.Context) error
- func (api *Wrapper) NutsAuthGetContractByType(ctx echo.Context, contractType string, params NutsAuthGetContractByTypeParams) error
- func (api *Wrapper) NutsAuthSessionRequestStatus(ctx echo.Context, sessionID string) error
- func (api *Wrapper) NutsAuthValidateContract(ctx echo.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(router runtime.EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
Types ¶
type Contract ¶
type Contract struct { Language Language `json:"language"` SignerAttributes []string `json:"signer_attributes,omitempty"` Template *string `json:"template,omitempty"` TemplateAttributes []string `json:"template_attributes,omitempty"` Type Type `json:"type"` Version Version `json:"version"` }
Contract defines component schema for Contract.
type ContractSigningRequest ¶
type ContractSigningRequest struct { Language Language `json:"language"` Type Type `json:"type"` ValidFrom *time.Time `json:"valid_from,omitempty"` ValidTo *time.Time `json:"valid_to,omitempty"` Version Version `json:"version"` }
ContractSigningRequest defines component schema for ContractSigningRequest.
type CreateSessionResult ¶
type CreateSessionResult struct { QrCodeInfo IrmaQR `json:"qr_code_info"` SessionId string `json:"session_id"` }
CreateSessionResult defines component schema for CreateSessionResult.
type DisclosedAttribute ¶
type DisclosedAttribute struct { Identifier string `json:"identifier"` Rawvalue *string `json:"rawvalue,omitempty"` Status string `json:"status"` Value map[string]interface{} `json:"value"` }
DisclosedAttribute defines component schema for DisclosedAttribute.
type DisclosedAttributeIndex ¶
type DisclosedAttributeIndex struct { Attr *int32 `json:"attr,omitempty"` Cred *int32 `json:"cred,omitempty"` }
DisclosedAttributeIndex defines component schema for DisclosedAttributeIndex.
type NutsAuthGetContractByTypeParams ¶
type NutsAuthGetContractByTypeParams struct { Version *string `json:"version,omitempty"` Language *string `json:"language,omitempty"` }
NutsAuthGetContractByTypeParams defines parameters for NutsAuthGetContractByType.
type ProofD ¶
type ProofD struct { A *float32 `json:"A,omitempty"` ADisclosed *map[string]interface{} `json:"a_disclosed,omitempty"` AResponses *map[string]interface{} `json:"a_responses,omitempty"` C *float32 `json:"c,omitempty"` EResponse *float32 `json:"e_response,omitempty"` VResponse *float32 `json:"v_response,omitempty"` }
ProofD defines component schema for ProofD.
type ProofP ¶
type ProofP struct { P *float32 `json:"P,omitempty"` C *float32 `json:"c,omitempty"` SResponse *float32 `json:"s_response,omitempty"` }
ProofP defines component schema for ProofP.
type ProofS ¶
type ProofS struct { C *float32 `json:"c,omitempty"` EResponse *float32 `json:"e_response,omitempty"` }
ProofS defines component schema for ProofS.
type ProofU ¶
type ProofU struct { U *float32 `json:"U,omitempty"` C *float32 `json:"c,omitempty"` SResponse *float32 `json:"s_response,omitempty"` VPrimeResponse *float32 `json:"v_prime_response,omitempty"` }
ProofU defines component schema for ProofU.
type RemoteError ¶
type RemoteError struct { Description *string `json:"description,omitempty"` Error *string `json:"error,omitempty"` Message *string `json:"message,omitempty"` Stacktrace *string `json:"stacktrace,omitempty"` Status *int32 `json:"status,omitempty"` }
RemoteError defines component schema for RemoteError.
type ServerInterface ¶
type ServerInterface interface { // CreateSessionHandler Initiates an IRMA signing session with the correct contract. (POST /auth/contract/session) NutsAuthCreateSession(ctx echo.Context) error // returns the result of the contract request (GET /auth/contract/session/{id}) NutsAuthSessionRequestStatus(ctx echo.Context, id string) error // Validate a Nuts Security Contract (POST /auth/contract/validate) NutsAuthValidateContract(ctx echo.Context) error // Get a contract by type and version (GET /auth/contract/{contractType}) NutsAuthGetContractByType(ctx echo.Context, contractType string, params NutsAuthGetContractByTypeParams) error }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) NutsAuthCreateSession ¶
func (w *ServerInterfaceWrapper) NutsAuthCreateSession(ctx echo.Context) error
NutsAuthCreateSession converts echo context to params.
func (*ServerInterfaceWrapper) NutsAuthGetContractByType ¶
func (w *ServerInterfaceWrapper) NutsAuthGetContractByType(ctx echo.Context) error
NutsAuthGetContractByType converts echo context to params.
func (*ServerInterfaceWrapper) NutsAuthSessionRequestStatus ¶
func (w *ServerInterfaceWrapper) NutsAuthSessionRequestStatus(ctx echo.Context) error
NutsAuthSessionRequestStatus converts echo context to params.
func (*ServerInterfaceWrapper) NutsAuthValidateContract ¶
func (w *ServerInterfaceWrapper) NutsAuthValidateContract(ctx echo.Context) error
NutsAuthValidateContract converts echo context to params.
type SessionResult ¶
type SessionResult struct { Disclosed []DisclosedAttribute `json:"disclosed,omitempty"` Error *RemoteError `json:"error,omitempty"` NutsAuthToken *string `json:"nuts_auth_token,omitempty"` ProofStatus *string `json:"proofStatus,omitempty"` Signature *SignedMessage `json:"signature,omitempty"` Status string `json:"status"` Token string `json:"token"` Type string `json:"type"` }
SessionResult defines component schema for SessionResult.
type SignedMessage ¶
type SignedMessage struct { Context *float32 `json:"context,omitempty"` Indices [][]DisclosedAttributeIndex `json:"indices,omitempty"` Message *string `json:"message,omitempty"` Nonce *float32 `json:"nonce,omitempty"` Signature []interface{} `json:"signature,omitempty"` Timestamp *Timestamp `json:"timestamp,omitempty"` }
SignedMessage defines component schema for SignedMessage.
type Timestamp ¶
type Timestamp struct {
Time *int64 `json:"time,omitempty"`
}
Timestamp defines component schema for Timestamp.
type ValidationRequest ¶
type ValidationRequest struct { ActingPartyCn string `json:"acting_party_cn"` ContractFormat string `json:"contract_format"` ContractString string `json:"contract_string"` }
ValidationRequest defines component schema for ValidationRequest.
type ValidationResult ¶
type ValidationResult struct { ContractFormat string `json:"contract_format"` SignerAttributes map[string]interface{} `json:"signer_attributes"` ValidationResult string `json:"validation_result"` }
ValidationResult defines component schema for ValidationResult.
type Wrapper ¶
type Wrapper struct {
Auth pkg.AuthClient
}
Wrapper bridges the generated api types and http logic to the internal types and logic
func (*Wrapper) NutsAuthCreateSession ¶
NutsAuthCreateSession translates http params to internal format, creates a IRMA signing session and returns the session pointer to the HTTP stack.
func (*Wrapper) NutsAuthGetContractByType ¶
func (api *Wrapper) NutsAuthGetContractByType(ctx echo.Context, contractType string, params NutsAuthGetContractByTypeParams) error
NutsAuthGetContractByType calls the engines GetContractByType and translate the answer to the API format and returns the the answer back to the HTTP stack
func (*Wrapper) NutsAuthSessionRequestStatus ¶
NutsAuthSessionRequestStatus gets the current status or the IRMA signing session, it translates the result to the api format and returns it to the HTTP stack If the session is not found it returns a 404
func (*Wrapper) NutsAuthValidateContract ¶
NutsAuthValidateContract translates the request params to an internal format, it calls the engine's validator and translates the results to the API format and returns the answer to the HTTP stack