forked from ory/fosite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pushed_authorize_response.go
58 lines (47 loc) · 1.3 KB
/
pushed_authorize_response.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
package fosite
import "net/http"
// PushedAuthorizeResponse is the response object for PAR
type PushedAuthorizeResponse struct {
RequestURI string `json:"request_uri"`
ExpiresIn int `json:"expires_in"`
Header http.Header
Extra map[string]interface{}
}
// GetRequestURI gets
func (a *PushedAuthorizeResponse) GetRequestURI() string {
return a.RequestURI
}
// SetRequestURI sets
func (a *PushedAuthorizeResponse) SetRequestURI(requestURI string) {
a.RequestURI = requestURI
}
// GetExpiresIn gets
func (a *PushedAuthorizeResponse) GetExpiresIn() int {
return a.ExpiresIn
}
// SetExpiresIn sets
func (a *PushedAuthorizeResponse) SetExpiresIn(seconds int) {
a.ExpiresIn = seconds
}
// GetHeader gets
func (a *PushedAuthorizeResponse) GetHeader() http.Header {
return a.Header
}
// AddHeader adds
func (a *PushedAuthorizeResponse) AddHeader(key, value string) {
a.Header.Add(key, value)
}
// SetExtra sets
func (a *PushedAuthorizeResponse) SetExtra(key string, value interface{}) {
a.Extra[key] = value
}
// GetExtra gets
func (a *PushedAuthorizeResponse) GetExtra(key string) interface{} {
return a.Extra[key]
}
// ToMap converts to a map
func (a *PushedAuthorizeResponse) ToMap() map[string]interface{} {
a.Extra["request_uri"] = a.RequestURI
a.Extra["expires_in"] = a.ExpiresIn
return a.Extra
}