-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.go
39 lines (32 loc) · 1001 Bytes
/
model.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
package keycloakmiddleware
import "github.com/cristalhq/jwt/v3"
// Set all model to private
type claims struct {
jwt.StandardClaims
Authorization authorization `json:"authorization,omitempty"`
Username string `json:"preferred_username,omitempty"`
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
}
type authorization struct {
Permissions []permission `json:"permissions,omitempty"`
}
type permission struct {
RsID string `json:"rsid,omitempty"`
RsName string `json:"rsname,omitempty"`
Scopes []string `json:"scopes,omitempty"`
}
type keycloakJWKDetail struct {
Key string `json:"kty"`
Kid string `json:"kid"`
Use string `json:"sig"`
Alg string `json:"alg"`
N string `json:"n"`
E string `json:"e"`
X5c []string `json:"x5c"`
X5t string `json:"x5t"`
X5tS256 string `json:"x5t#S256"`
}
type keycloakJWK struct {
Keys []keycloakJWKDetail `json:"keys"`
}