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" // CollectPorgressStatusNoClient ... CollectPorgressStatusNoClient = "NO_CLIENT" // CollectPorgressStatusStarted ... CollectPorgressStatusStarted = "STARTED" // CollectProgressStatusUserSign ... CollectProgressStatusUserSign = "USER_SIGN" // CollectProgressStatusComplete ... CollectProgressStatusComplete = "COMPLETE" )
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 ZSInitConfig) (*ZSInitRespBody, error)
Initiate a login or sign request
type CollectResponse ¶
type CollectResponse struct {
ID string `json:"id"`
Errors []struct {
Code string `json:"code"`
Description string `json:"description"`
} `json:"errors"`
ProgressStatus string `json:"progressStatus"`
UserInfo struct {
GivenName string `json:"givenName"`
Surname string `json:"surname"`
Name string `json:"name"`
PersonalNumber string `json:"personalNumber"`
NotBefore string `json:"notBefore"`
NotAfter string `json:"notAfter"`
IPAddress string `json:"ipAddress"`
} `json:"userInfo"`
Signature string `json:"signature"`
OCSP string `json:"ocspResponse"`
}
CollectResponse defines the response Body of S2S Collect()
type InitResponse ¶
type InitResponse 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"`
}
InitResponse defines the response Body of S2S Init()
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) (*CollectResponse, 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) (*InitResponse, 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 ZSInitConfig ¶
type ZSInitConfig 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"`
}
ZSInitConfig defines the configuration which are sent along with both web-based Initiate() and 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 ZSInitRespBody ¶
type ZSInitRespBody struct {
ID string `json:"id"`
Errors []struct {
Code string `json:"code"`
Description string `json:"description"`
} `json:"errors"`
RedirectURL string `json:"redirect_url"`
}
ZSInitRespBody defines the response Body of Initiate()
type ZSVerifyRespBody ¶
type ZSVerifyRespBody 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"`
}
ZSVerifyRespBody defines the response Body of Verify()