Merge commit from fork

This commit is contained in:
Livio Spring
2025-03-31 12:45:11 +02:00
committed by GitHub
parent 14de8ecac2
commit 315503beab
3 changed files with 17 additions and 5 deletions

View File

@@ -21,7 +21,9 @@ import (
)
func TestServer_JWTProfile(t *testing.T) {
user, name, keyData, err := Instance.CreateOIDCJWTProfileClient(CTX)
user, name, keyData, err := Instance.CreateOIDCJWTProfileClient(CTX, time.Hour)
require.NoError(t, err)
_, _, keyDataExpired, err := Instance.CreateOIDCJWTProfileClient(CTX, 10*time.Second)
require.NoError(t, err)
type claims struct {
@@ -104,6 +106,12 @@ func TestServer_JWTProfile(t *testing.T) {
resourceOwnerPrimaryDomain: Instance.DefaultOrg.PrimaryDomain,
},
},
{
name: "key expired",
keyData: keyDataExpired,
scope: []string{oidc.ScopeOpenID},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@@ -123,6 +131,9 @@ func TestServer_JWTProfile(t *testing.T) {
},
time.Minute, time.Second,
)
if tt.wantErr {
return
}
provider, err := rp.NewRelyingPartyOIDC(CTX, Instance.OIDCIssuer(), "", "", redirectURI, tt.scope)
require.NoError(t, err)