-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest_context.go
More file actions
131 lines (122 loc) · 4.17 KB
/
request_context.go
File metadata and controls
131 lines (122 loc) · 4.17 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
package oidcsdk
import (
"net/http"
"net/url"
"time"
)
type (
IClientCredentialContext interface {
GetClientID() string
GetClientSecret() string
SetClient(client IClient)
}
IRequestContext interface {
GetRequestID() string
GetRequestedAt() time.Time
GetState() string
GetRedirectURI() string
GetClientID() string
GetRequestedScopes() Arguments
GetRequestedAudience() Arguments
GetClaims() map[string]interface{}
GetClient() IClient
SetClient(client IClient)
GetProfile() RequestProfile
SetProfile(profile RequestProfile)
GetIssuedTokens() Tokens
IssueAccessToken(token string, signature string, expiry time.Time)
IssueRefreshToken(token string, signature string, expiry time.Time)
IssueIDToken(token string)
GetError() IError
SetError(err IError)
GetForm() *url.Values
}
IAuthenticationRequestContext interface {
IRequestContext
GetUserSession() ISession
SetUserSession(sess ISession)
GetNonce() string
GetResponseMode() string
GetResponseType() Arguments
SetRedirectURI(uri string)
IssueAuthorizationCode(code string, signature string, expiry time.Time)
}
ITokenRequestContext interface {
IRequestContext
GetRefreshToken() string
GetPreviousRequestID() (id string)
SetPreviousRequestID(id string)
GetGrantType() string
GetClientSecret() string
GetAuthorizationCode() string
GetUsername() string
GetPassword() string
}
IRequestContextFactory interface {
BuildTokenRequestContext(request *http.Request) (ITokenRequestContext, IError)
BuildAuthorizationRequestContext(request *http.Request) (IAuthenticationRequestContext, IError)
BuildRevocationRequestContext(request *http.Request) (IRevocationRequestContext, IError)
BuildIntrospectionRequestContext(request *http.Request) (IIntrospectionRequestContext, IError)
BuildUserInfoRequestContext(request *http.Request) (IUserInfoRequestContext, IError)
BuildRPILogoutRequestContext(request *http.Request) (IRPILogoutRequestContext, IError)
}
IErrorWriter interface {
WriteJsonError(pError IError, additionalValues url.Values, w http.ResponseWriter, r *http.Request) error
WriteRedirectError(requestContext IAuthenticationRequestContext, w http.ResponseWriter, r *http.Request) error
WriteBearerError(pError IError, additionalValues url.Values, w http.ResponseWriter, r *http.Request) error
}
IResponseWriter interface {
WriteTokenResponse(requestContext ITokenRequestContext, w http.ResponseWriter, r *http.Request) error
WriteAuthorizationResponse(requestContext IAuthenticationRequestContext, w http.ResponseWriter, r *http.Request) error
WriteIntrospectionResponse(requestContext IIntrospectionRequestContext, w http.ResponseWriter, r *http.Request) error
WriteRevocationResponse(w http.ResponseWriter, r *http.Request) error
WriteUserInfoResponse(requestContext IUserInfoRequestContext, w http.ResponseWriter, r *http.Request) error
WriteRPILogoutResponse(requestContext IRPILogoutRequestContext, w http.ResponseWriter, r *http.Request)
}
IRevocationRequestContext interface {
GetRequestID() string
GetRequestedAt() time.Time
GetClientID() string
GetToken() string
GetTokenTypeHint() string
SetClient(client IClient)
GetClientSecret() string
GetClient() IClient
GetError() IError
SetError(err IError)
GetForm() *url.Values
}
IIntrospectionRequestContext interface {
IRevocationRequestContext
GetProfile() RequestProfile
SetProfile(profile RequestProfile)
IsActive() bool
SetActive(active bool)
GetTokenType() string
SetTokenType(tokenType string)
}
IUserInfoRequestContext interface {
GetBearerToken() string
GetUsername() string
SetUsername(username string)
GetClaims() map[string]interface{}
AddClaim(claimId string, value interface{})
GetApprovedScopes() Arguments
SetApprovedScopes(scopes Arguments)
GetRequestedClaims() []string
SetRequestedClaims(claimIds []string)
}
IRPILogoutRequestContext interface {
GetPostLogoutRedirectUri() string
SetPostLogoutRedirectUri(uri string)
GetIdTokenHint() string
GetClient() IClient
SetClient(id IClient)
SetUsername(username string)
GetUserName() string
GetState() string
GetCSRFToken() string
GetUserSession() ISession
SetUserSession(session ISession)
}
)