FIX: Use sessionKeysFile for Zot OIDC session encryption

- Change from hashKeyFile/blockKeyFile inside sessionDriver to
  sessionKeysFile at auth config level
- Update ExternalSecret to generate session-keys.json with both
  hashKey and encryptKey in correct JSON format
- Fix securecookie validation error during OIDC callback
This commit is contained in:
2026-01-10 03:09:28 +09:00
parent b7eb527782
commit 1fa6ff5edd
2 changed files with 13 additions and 9 deletions

View File

@@ -100,11 +100,8 @@ persistence:
type: secret type: secret
name: zot-session-keys name: zot-session-keys
globalMounts: globalMounts:
- path: /etc/zot/session-hashkey - path: /etc/zot/session-keys.json
subPath: hashKey subPath: session-keys.json
readOnly: true
- path: /etc/zot/session-blockkey
subPath: blockKey
readOnly: true readOnly: true
configMaps: configMaps:
@@ -146,12 +143,11 @@ configMaps:
} }
} }
}, },
"sessionKeysFile": "/etc/zot/session-keys.json",
"sessionDriver": { "sessionDriver": {
"name": "redis", "name": "redis",
"url": "redis://authelia-redis-master.authelia.svc.cluster.local:6379", "url": "redis://authelia-redis-master.authelia.svc.cluster.local:6379",
"keyprefix": "zot", "keyprefix": "zot"
"hashKeyFile": "/etc/zot/session-hashkey",
"blockKeyFile": "/etc/zot/session-blockkey"
} }
} }
}, },

View File

@@ -61,12 +61,20 @@ spec:
target: target:
name: zot-session-keys name: zot-session-keys
creationPolicy: Owner creationPolicy: Owner
template:
engineVersion: v2
data:
session-keys.json: |
{
"hashKey": "{{ .hashKey }}",
"encryptKey": "{{ .encryptKey }}"
}
data: data:
- secretKey: hashKey - secretKey: hashKey
remoteRef: remoteRef:
key: zot key: zot
property: SESSION_HASH_KEY property: SESSION_HASH_KEY
- secretKey: blockKey - secretKey: encryptKey
remoteRef: remoteRef:
key: zot key: zot
property: SESSION_BLOCK_KEY property: SESSION_BLOCK_KEY