-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthorization_code.go
More file actions
133 lines (103 loc) · 3.43 KB
/
Copy pathauthorization_code.go
File metadata and controls
133 lines (103 loc) · 3.43 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
package sql
import (
"time"
"github.com/alkeyio/authkit/models"
"github.com/alkeyio/authkit/types"
)
// Compile-time check that *AuthorizationCode implements models.ExtendableAuthorizationCode.
var _ models.ExtendableAuthorizationCode = (*AuthorizationCode)(nil)
type AuthorizationCode struct {
Code string `json:"code"`
ClientID string `json:"client_id"`
UserID string `json:"user_id"`
RedirectURI string `json:"redirect_uri"`
ResponseType string `json:"response_type"`
Scopes []string `json:"scopes"`
Nonce string `json:"nonce"`
State string `json:"state"`
AuthTime time.Time `json:"auth_time"`
ExpiresIn time.Duration `json:"expires_in"`
CodeChallenge string `json:"code_challenge"`
CodeChallengeMethod string `json:"code_challenge_method"`
Data map[string]interface{} `json:"data"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (c *AuthorizationCode) GetCode() string {
return c.Code
}
func (c *AuthorizationCode) SetCode(code string) {
c.Code = code
}
func (c *AuthorizationCode) GetClientID() string {
return c.ClientID
}
func (c *AuthorizationCode) SetClientID(clientID string) {
c.ClientID = clientID
}
func (c *AuthorizationCode) GetUserID() string {
return c.UserID
}
func (c *AuthorizationCode) SetUserID(userID string) {
c.UserID = userID
}
func (c *AuthorizationCode) GetRedirectURI() string {
return c.RedirectURI
}
func (c *AuthorizationCode) SetRedirectURI(redirectURI string) {
c.RedirectURI = redirectURI
}
func (c *AuthorizationCode) GetResponseType() types.ResponseType {
return types.NewResponseType(c.ResponseType)
}
func (c *AuthorizationCode) SetResponseType(rt types.ResponseType) {
c.ResponseType = rt.String()
}
func (c *AuthorizationCode) GetScopes() types.Scopes {
return types.NewScopes(c.Scopes)
}
func (c *AuthorizationCode) SetScopes(s types.Scopes) {
c.Scopes = s.String()
}
func (c *AuthorizationCode) GetNonce() string {
return c.Nonce
}
func (c *AuthorizationCode) SetNonce(nonce string) {
c.Nonce = nonce
}
func (c *AuthorizationCode) GetState() string {
return c.State
}
func (c *AuthorizationCode) SetState(state string) {
c.State = state
}
func (c *AuthorizationCode) GetAuthTime() time.Time {
return c.AuthTime
}
func (c *AuthorizationCode) SetAuthTime(authTime time.Time) {
c.AuthTime = authTime
}
func (c *AuthorizationCode) GetExpiresIn() time.Duration {
return c.ExpiresIn
}
func (c *AuthorizationCode) SetExpiresIn(expiresIn time.Duration) {
c.ExpiresIn = expiresIn
}
func (c *AuthorizationCode) GetCodeChallenge() string {
return c.CodeChallenge
}
func (c *AuthorizationCode) SetCodeChallenge(codeChallenge string) {
c.CodeChallenge = codeChallenge
}
func (c *AuthorizationCode) GetCodeChallengeMethod() types.CodeChallengeMethod {
return types.NewCodeChallengeMethod(c.CodeChallengeMethod)
}
func (c *AuthorizationCode) SetCodeChallengeMethod(m types.CodeChallengeMethod) {
c.CodeChallengeMethod = m.String()
}
func (c *AuthorizationCode) GetExtraData() map[string]interface{} {
return c.Data
}
func (c *AuthorizationCode) SetExtraData(data map[string]interface{}) {
c.Data = data
}