-
Notifications
You must be signed in to change notification settings - Fork 3
/
auth.go
117 lines (101 loc) · 3.79 KB
/
auth.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
package model
import "time"
type IdentifierType string
const (
ONIP IdentifierType = "onip"
NIP = "nip"
PESEL = "pesel"
)
type ContextIdentifier struct {
Type IdentifierType `json:"type"`
Identifier string `json:"identifier"`
}
type AuthorisationChallengeRequest struct {
ContextIdentifier ContextIdentifier `json:"contextIdentifier"`
}
type AuthorisationChallengeResponse struct {
Timestamp time.Time `json:"timestamp"` // time format is time.RFC3339
Challenge string `json:"challenge"`
}
type AuthorisationToken struct {
Timestamp string `json:"timestamp"`
ReferenceNumber string `json:"referenceNumber"`
ProcessingCode string `json:"processingCode"`
ProcessingDescription string `json:"processingDescription"`
ElementReferenceNumber string `json:"elementReferenceNumber"`
AuthorisationToken string `json:"authorisationToken"`
}
type InitSignedResponse struct {
Timestamp string `json:"timestamp"`
ReferenceNumber string `json:"referenceNumber"`
SessionToken SessionToken `json:"sessionToken"`
}
type SessionToken struct {
Token string `json:"token"`
}
type TokenResponse struct {
Timestamp time.Time `json:"timestamp"`
ReferenceNumber string `json:"referenceNumber"`
SessionToken struct {
Token string `json:"token"`
Context struct {
ContextIdentifier struct {
Type string `json:"type"`
Identifier string `json:"identifier"`
} `json:"contextIdentifier"`
ContextName struct {
Type string `json:"type"`
TradeName interface{} `json:"tradeName"`
FullName string `json:"fullName"`
} `json:"contextName"`
CredentialsRoleList []struct {
Type string `json:"type"`
RoleType string `json:"roleType"`
RoleDescription string `json:"roleDescription"`
} `json:"credentialsRoleList"`
} `json:"context"`
} `json:"sessionToken"`
}
type Context struct {
ContextIdentifier ContextIdentifier `json:"contextIdentifier"`
ContextName ContextName `json:"contextName"`
CredentialsRoleList []CredentialsRole `json:"credentialsRoleList"`
}
type ContextName struct {
Type string `json:"type"`
TradeName string `json:"tradeName"`
FullName string `json:"fullName"`
}
type CredentialsRole struct {
Type string `json:"type"`
RoleType string `json:"roleType"`
RoleDescription string `json:"roleDescription"`
RoleGrantorIdentifier RoleGrantorIdentifier `json:"roleGrantorIdentifier"`
}
type RoleGrantorIdentifier struct {
Type string `json:"type"`
Identifier string `json:"identifier"`
}
type SessionStatusResponse struct {
Timestamp time.Time `json:"timestamp"`
ReferenceNumber string `json:"referenceNumber"`
NumberOfElements int `json:"numberOfElements"`
PageSize int `json:"pageSize"`
PageOffset int `json:"pageOffset"`
ProcessingCode int `json:"processingCode"`
ProcessingDescription string `json:"processingDescription"`
InvoiceStatusList []struct {
ProcessingCode int `json:"processingCode"`
ProcessingDescription string `json:"processingDescription"`
ElementReferenceNumber string `json:"elementReferenceNumber"`
InvoiceNumber string `json:"invoiceNumber"`
KsefReferenceNumber string `json:"ksefReferenceNumber"`
AcquisitionTimestamp time.Time `json:"acquisitionTimestamp"`
} `json:"invoiceStatusList"`
}
type TerminateSessionResponse struct {
Timestamp time.Time `json:"timestamp"`
ReferenceNumber string `json:"referenceNumber"`
ProcessingCode int `json:"processingCode"`
ProcessingDescription string `json:"processingDescription"`
}