mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-15 04:18:03 +00:00
Well.. that escalated quickly.
Completely forgot that Traefik uses outdated Yaegi and requires compatibility with 1.20 ( pre-generic Go code ).
This commit is contained in:
+11
-11
@@ -238,7 +238,7 @@ func NewSessionManager(encryptionKey string, forceHTTPS bool, logger *Logger) (*
|
||||
logger: logger,
|
||||
}
|
||||
|
||||
sm.sessionPool.New = func() any {
|
||||
sm.sessionPool.New = func() interface{} {
|
||||
sd := &SessionData{
|
||||
manager: sm,
|
||||
accessTokenChunks: make(map[int]*sessions.Session),
|
||||
@@ -699,7 +699,7 @@ func (sd *SessionData) SetAuthenticated(value bool) error {
|
||||
}
|
||||
|
||||
maxRetries := 5
|
||||
for retry := range maxRetries {
|
||||
for retry := 0; retry < maxRetries; retry++ {
|
||||
if sd.mainSession.ID != id {
|
||||
break
|
||||
}
|
||||
@@ -869,7 +869,7 @@ func (sd *SessionData) getAccessTokenUnsafe() string {
|
||||
totalSize := 0
|
||||
|
||||
// Sequential chunk validation with gap detection
|
||||
for i := range expectedChunkCount {
|
||||
for i := 0; i < expectedChunkCount; i++ {
|
||||
session, ok := sd.accessTokenChunks[i]
|
||||
if !ok {
|
||||
sd.manager.logger.Errorf("CRITICAL: Access token chunk %d missing - gap in sequence detected", i)
|
||||
@@ -1205,7 +1205,7 @@ func (sd *SessionData) GetRefreshToken() string {
|
||||
totalSize := 0
|
||||
|
||||
// Sequential chunk validation with gap detection
|
||||
for i := range expectedChunkCount {
|
||||
for i := 0; i < expectedChunkCount; i++ {
|
||||
session, ok := sd.refreshTokenChunks[i]
|
||||
if !ok {
|
||||
sd.manager.logger.Errorf("CRITICAL: Refresh token chunk %d missing - gap in sequence detected", i)
|
||||
@@ -1460,7 +1460,7 @@ func (sd *SessionData) expireAccessTokenChunksEnhanced(w http.ResponseWriter) {
|
||||
const maxChunkSearchLimit = 50 // Limit search to prevent infinite loops from corrupted state
|
||||
orphanedChunks := 0
|
||||
|
||||
for i := range maxChunkSearchLimit {
|
||||
for i := 0; i < maxChunkSearchLimit; i++ {
|
||||
sessionName := fmt.Sprintf("%s_%d", accessTokenCookie, i)
|
||||
session, err := sd.manager.store.Get(sd.request, sessionName)
|
||||
if err != nil {
|
||||
@@ -1490,7 +1490,7 @@ func (sd *SessionData) expireAccessTokenChunksEnhanced(w http.ResponseWriter) {
|
||||
|
||||
// Expire the chunk regardless of orphan status
|
||||
session.Options.MaxAge = -1
|
||||
session.Values = make(map[any]any)
|
||||
session.Values = make(map[interface{}]interface{})
|
||||
if w != nil {
|
||||
if err := session.Save(sd.request, w); err != nil {
|
||||
sd.manager.logger.Errorf("failed to save expired access token chunk %d: %v", i, err)
|
||||
@@ -1513,7 +1513,7 @@ func (sd *SessionData) expireRefreshTokenChunksEnhanced(w http.ResponseWriter) {
|
||||
const maxChunkSearchLimit = 50 // Limit search to prevent infinite loops from corrupted state
|
||||
orphanedChunks := 0
|
||||
|
||||
for i := range maxChunkSearchLimit {
|
||||
for i := 0; i < maxChunkSearchLimit; i++ {
|
||||
sessionName := fmt.Sprintf("%s_%d", refreshTokenCookie, i)
|
||||
session, err := sd.manager.store.Get(sd.request, sessionName)
|
||||
if err != nil {
|
||||
@@ -1543,7 +1543,7 @@ func (sd *SessionData) expireRefreshTokenChunksEnhanced(w http.ResponseWriter) {
|
||||
|
||||
// Expire the chunk regardless of orphan status
|
||||
session.Options.MaxAge = -1
|
||||
session.Values = make(map[any]any)
|
||||
session.Values = make(map[interface{}]interface{})
|
||||
if w != nil {
|
||||
if err := session.Save(sd.request, w); err != nil {
|
||||
sd.manager.logger.Errorf("failed to save expired refresh token chunk %d: %v", i, err)
|
||||
@@ -1566,7 +1566,7 @@ func (sd *SessionData) expireIDTokenChunksEnhanced(w http.ResponseWriter) {
|
||||
const maxChunkSearchLimit = 50 // Limit search to prevent infinite loops from corrupted state
|
||||
orphanedChunks := 0
|
||||
|
||||
for i := range maxChunkSearchLimit {
|
||||
for i := 0; i < maxChunkSearchLimit; i++ {
|
||||
sessionName := fmt.Sprintf("%s_%d", idTokenCookie, i)
|
||||
session, err := sd.manager.store.Get(sd.request, sessionName)
|
||||
if err != nil {
|
||||
@@ -1596,7 +1596,7 @@ func (sd *SessionData) expireIDTokenChunksEnhanced(w http.ResponseWriter) {
|
||||
|
||||
// Expire the chunk regardless of orphan status
|
||||
session.Options.MaxAge = -1
|
||||
session.Values = make(map[any]any)
|
||||
session.Values = make(map[interface{}]interface{})
|
||||
if w != nil {
|
||||
if err := session.Save(sd.request, w); err != nil {
|
||||
sd.manager.logger.Errorf("failed to save expired ID token chunk %d: %v", i, err)
|
||||
@@ -1896,7 +1896,7 @@ func (sd *SessionData) getIDTokenUnsafe() string {
|
||||
totalSize := 0
|
||||
|
||||
// Sequential chunk validation with gap detection
|
||||
for i := range expectedChunkCount {
|
||||
for i := 0; i < expectedChunkCount; i++ {
|
||||
session, ok := sd.idTokenChunks[i]
|
||||
if !ok {
|
||||
sd.manager.logger.Errorf("CRITICAL: ID token chunk %d missing - gap in sequence detected", i)
|
||||
|
||||
Reference in New Issue
Block a user