Add validated ID token claims to the oidctypes.Token structure.
This is just a more convenient copy of these values which are already stored inside the ID token. This will save us from having to pass them around seprately or re-parse them later. Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
parent
7b088d611d
commit
014d760f3d
@ -38,6 +38,13 @@ var validSession = sessionCache{
|
||||
IDToken: &oidctypes.IDToken{
|
||||
Token: "test-id-token",
|
||||
Expiry: metav1.NewTime(time.Date(2020, 10, 20, 19, 42, 07, 0, time.UTC).Local()),
|
||||
Claims: map[string]interface{}{
|
||||
"foo": "bar",
|
||||
"nested": map[string]interface{}{
|
||||
"key1": "value1",
|
||||
"key2": "value2",
|
||||
},
|
||||
},
|
||||
},
|
||||
RefreshToken: &oidctypes.RefreshToken{
|
||||
Token: "test-refresh-token",
|
||||
|
@ -20,5 +20,10 @@ sessions:
|
||||
id:
|
||||
expiryTimestamp: "2020-10-20T19:42:07Z"
|
||||
token: test-id-token
|
||||
claims:
|
||||
foo: bar
|
||||
nested:
|
||||
key1: value1
|
||||
key2: value2
|
||||
refresh:
|
||||
token: test-refresh-token
|
||||
|
@ -31,6 +31,9 @@ type IDToken struct {
|
||||
|
||||
// Expiry is the optional expiration time of the ID token.
|
||||
Expiry v1.Time `json:"expiryTimestamp,omitempty"`
|
||||
|
||||
// Claims are the claims expressed by the Token.
|
||||
Claims map[string]interface{} `json:"claims,omitempty"`
|
||||
}
|
||||
|
||||
// Token contains the elements of an OIDC session.
|
||||
|
Loading…
Reference in New Issue
Block a user