Documentation
¶
Index ¶
Constants ¶
const ( // APIHostBase is the production endpoint APIHostBase = "https://api.zignsec.com/v2/eid" // APIHostBaseTest is the test endpoint APIHostBaseTest = "https://test.zignsec.com/v2/eid" )
const ( // CollectProgressStatusOutstanding ... CollectProgressStatusOutstanding = "OUTSTANDING_TRANSACTION" // CollectProgressStatusNoClient ... CollectProgressStatusNoClient = "NO_CLIENT" // CollectProgressStatusStarted ... CollectProgressStatusStarted = "STARTED" // CollectProgressStatusUserSign ... CollectProgressStatusUserSign = "USER_SIGN" // CollectProgressStatusComplete ... CollectProgressStatusComplete = "COMPLETE" )
const ( // CollectErrorInvalidParameters ... CollectErrorInvalidParameters = "INVALID_PARAMETERS" // CollectErrorReqPrecond ... CollectErrorReqPrecond = "REQ_PRECOND" // CollectErrorReqError ... CollectErrorReqError = "REQ_ERROR" // CollectErrorReqBlocked ... CollectErrorReqBlocked = "REQ_BLOCKED" // CollectErrorInternalError ... CollectErrorInternalError = "INTERNAL_ERROR" // CollectErrorRetry ... CollectErrorRetry = "RETRY" // CollectErrorAccessDeniedRP ... CollectErrorAccessDeniedRP = "ACCESS_DENIED_RP" // CollectErrorClientErr ... CollectErrorClientErr = "CLIENT_ERR" // CollectErrorExpiredTransaction ... CollectErrorExpiredTransaction = "EXPIRED_TRANSACTION" // CollectErrorCertificateErr ... CollectErrorCertificateErr = "CERTIFICATE_ERR" // CollectErrorUSerCancel ... CollectErrorUSerCancel = "USER_CANCEL" // CollectErrorCancelled ... CollectErrorCancelled = "CANCELLED" // CollectErrorStartFailed ... CollectErrorStartFailed = "START_FAILED" // CollectErrorAleadyCollected ... CollectErrorAleadyCollected = "ALREADY_COLLECTED" )
const ( // S2SURL is the production endpoint S2SURL = "https://api.zignsec.com/v2/BankIDSE" // S2SURLTest is the test endpoint S2SURLTest = "https://test.zignsec.com/v2/BankIDSE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a Zignsec web-based client.
func (*Client) Initiate ¶
func (c *Client) Initiate(method string, config ZWInitConfig) (*ZWInitRespBody, error)
Initiate a login or sign request
type S2SClient ¶
type S2SClient struct {
// contains filtered or unexported fields
}
S2SClient is a Zignsec server to server client
func NewS2SClient ¶
NewS2SClient create a new server to server client. Key is the Zignsec Authorization.
func (*S2SClient) Cancel ¶
func (c *S2SClient) Cancel(orderRef string) (*ZSCancelResponse, error)
Cancel a login or signature
func (*S2SClient) Collect ¶
func (c *S2SClient) Collect(orderRef string) (*ZSCollectResponse, error)
Collect the state of an authenticate or sign request. Order is from the Init() response. The guidelines recommend polling for results every 2 seconds. When the response Status is COMPLETE, then further use of Collect() will receive an error.
func (*S2SClient) Init ¶
func (c *S2SClient) Init(method string, config ZSInitConfig) (*ZSInitResponse, error)
Init a authenticate or sign request. Use Collect() to get the answer afterwards.
type ZSCancelBody ¶
type ZSCancelBody struct {
OrderRef string `json:"orderRef"`
}
ZSCancelBody is used when canceling a pending auth/sign request
type ZSCancelResponse ¶
type ZSCancelResponse struct {
ID string `json:"id"`
Errors []struct {
Code string `json:"code"`
Description string `json:"description"`
} `json:"errors"`
}
ZSCancelResponse defines the response Body of S2S Cancel()
type ZSCollectResponse ¶ added in v0.2.0
type ZSCollectResponse struct {
ID string `json:"id"`
Errors []struct {
Code string `json:"code"`
Description string `json:"description"`
} `json:"errors"`
ProgressStatus string `json:"progressStatus"`
Signature string `json:"signature"`
OCSPResponse string `json:"ocspResponse"`
UserInfo struct {
PersonalNumber string `json:"personalNumber"`
GivenName string `json:"givenName"`
Surname string `json:"surname"`
Name string `json:"name"`
NotBefore string `json:"notBefore"`
NotAfter string `json:"notAfter"`
IPAddress string `json:"ipAddress"`
} `json:"userInfo"`
RelayState string `json:"relayState"`
}
ZSCollectResponse defines the response Body of S2S Collect()
type ZSInitConfig ¶
type ZSInitConfig struct {
Personalnumber *string `json:"personalnumber,omitempty"`
EndUserInfo *string `json:"endUserInfo,omitempty"`
UserVisibleData *string `json:"userVisibleData,omitempty"`
UserNonVisibleData *string `json:"userNonVisibleData,omitempty"`
LookupPersonAddress *string `json:"lookupPersonAddress,omitempty"`
Relaystate *string `json:"relaystate,omitempty"`
Webhook *string `json:"webhook,omitempty"`
Requirement *struct {
AutoStartTokenRequired string `json:"AutoStartTokenRequired"`
} `json:"requirement,omitempty"`
EndUserIp string `json:"endUserIp,omitempty"`
}
ZSInitConfig defines the configuration which are sent along with s2s Initiate(). UserNonVisibleData is signed, if present. UserVisibleData is then only for user guidance. Both must be base64 encoded. If decoded UserVisibleData contains certain bytes (integer value > 127?), Init() will fail with INVALID_PARAMETERS.
type ZSInitResponse ¶ added in v0.2.0
type ZSInitResponse struct {
ID string `json:"id"`
Errors []struct {
Code string `json:"code"`
Description string `json:"description"`
} `json:"errors"`
OrderRef string `json:"orderRef"`
AutoStartToken string `json:"autoStartToken"`
QRCodeLink *string `json:"qrCodeLink,omitempty"`
}
InitResponse defines the response Body of S2S Init()
type ZWInitConfig ¶ added in v0.2.0
type ZWInitConfig struct {
Personalnumber string `json:"personalnumber,omitempty"`
UserVisibleData string `json:"userVisibleData,omitempty"`
UserNonVisibleData string `json:"userNonVisibleData,omitempty"`
Relaystate string `json:"relaystate,omitempty"`
Configid string `json:"configid,omitempty"`
Target string `json:"target,omitempty"`
}
ZWInitConfig defines the configuration which are sent along with web-based Initiate(). UserNonVisibleData is signed, if present. UserVisibleData is then only for user guidance. Both must be base64 encoded. If decoded UserVisibleData contains certain bytes (integer value > 127?), Init() will fail with INVALID_PARAMETERS.
type ZWInitRespBody ¶ added in v0.2.0
type ZWInitRespBody struct {
ID string `json:"id"`
Errors []struct {
Code string `json:"code"`
Description string `json:"description"`
} `json:"errors"`
RedirectURL string `json:"redirect_url"`
}
ZWInitRespBody defines the response Body of Initiate()
type ZWVerifyRespBody ¶ added in v0.2.0
type ZWVerifyRespBody struct {
ID string `json:"id"`
Errors []string `json:"errors"`
Result struct {
Identity struct {
State string `json:"state"`
} `json:"identity"`
}
Identity struct {
CountryCode string `json:"CountryCode"`
FirstName string `json:"FirstName"`
LastName string `json:"LastName"`
PersonalNumber string `json:"PersonalNumber"`
DateOfBirth string `json:"DateOfBirth"`
Age int `json:"Age"`
} `json:"identity"`
Signature string `json:"signature"`
}
ZWVerifyRespBody defines the response Body of Verify()