Checkpoint: cfd28dfcf51a

Entire-Session: 65af23f9-7507-4dae-8f76-dd52adca273b
Entire-Strategy: manual-commit
Entire-Agent: Claude Code
Ephemeral-branch: entire/8d09ded-e3b0c4
This commit is contained in:
braginini
2026-03-31 17:36:08 +02:00
parent 4406119a37
commit 19fab7993d
6 changed files with 423 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
# Session Context
## User Prompts
### Prompt 1
given the func (v *Validator) refreshKeys(ctx context.Context) {
v.lock.Lock()
defer v.lock.Unlock()
refreshedKeys, err := getPemKeys(v.keysLocation)
if err != nil {
log.WithContext(ctx).Debugf("cannot get JSONWebKey: %v, falling back to old keys", err)
return
}
log.WithContext(ctx).Debugf("keys refreshed, new UTC expiration time: %s", refreshedKeys.expiresInTime.UTC())
v.keys = refreshedKeys
} I want to have another function specifically made for th...
### Prompt 2
make sure the verification of the keys from db is done according to the original function. e.g., expiration checks etc
### Prompt 3
use the same code as in dex itself
### Prompt 4
[Request interrupted by user for tool use]
### Prompt 5
just use ../dexidp folder
### Prompt 6
what is jwks.ExpiresInTime = time.Now().Add(1 * time.Hour)
### Prompt 7
how is it done in the original function?
### Prompt 8
create a short summary of changes for a pr. I will submit it myself
### Prompt 9
Verify each finding against the current code and only fix it if needed.
In `@shared/auth/jwt/validator.go` around lines 95 - 109,
NewValidatorWithKeyFetcher currently assigns whatever the keyFetcher returns,
which can leave Validator.keys nil and later cause panics at
refreshedKeys.ExpiresInTime.UTC() or v.keys.stillValid(); change the constructor
to ensure Validator.keys is always non-nil by replacing nil returns with a
default &Jwks{} when err != nil or keys == nil, log the error as before, a...