mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-15 04:18:03 +00:00
fixup! fixup! fixup! Move towards the self-provided Redis connection pool and RESP protocol implementation. Official redis client library won't work with yaegi.
This commit is contained in:
@@ -602,7 +602,7 @@ This approach allows you to manage all settings through Traefik's configuration
|
|||||||
|-----------|-------------|---------|---------|
|
|-----------|-------------|---------|---------|
|
||||||
| `enabled` | Enable Redis caching | `false` | `true` |
|
| `enabled` | Enable Redis caching | `false` | `true` |
|
||||||
| `address` | Redis server address | - | `redis:6379` |
|
| `address` | Redis server address | - | `redis:6379` |
|
||||||
| `password` | Redis password | - | `secret` |
|
| `password` | Redis password | - | `YOUR_PASSWORD` |
|
||||||
| `db` | Database number | `0` | `1` |
|
| `db` | Database number | `0` | `1` |
|
||||||
| `keyPrefix` | Key prefix for namespacing | `traefikoidc:` | `myapp:` |
|
| `keyPrefix` | Key prefix for namespacing | `traefikoidc:` | `myapp:` |
|
||||||
| `cacheMode` | Cache mode: `redis`, `hybrid`, `memory` | `redis` | `hybrid` |
|
| `cacheMode` | Cache mode: `redis`, `hybrid`, `memory` | `redis` | `hybrid` |
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ http:
|
|||||||
redis:
|
redis:
|
||||||
enabled: true
|
enabled: true
|
||||||
address: "redis-master.redis-namespace.svc.cluster.local:6379"
|
address: "redis-master.redis-namespace.svc.cluster.local:6379"
|
||||||
password: "strong-redis-password"
|
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD"
|
||||||
db: 0
|
db: 0
|
||||||
keyPrefix: "traefikoidc:prod:"
|
keyPrefix: "traefikoidc:prod:"
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ http:
|
|||||||
redis:
|
redis:
|
||||||
enabled: true
|
enabled: true
|
||||||
address: "redis.example.com:6380"
|
address: "redis.example.com:6380"
|
||||||
password: "secure-redis-password"
|
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD"
|
||||||
enableTLS: true
|
enableTLS: true
|
||||||
tlsSkipVerify: false # Verify certificates in production
|
tlsSkipVerify: false # Verify certificates in production
|
||||||
cacheMode: "redis"
|
cacheMode: "redis"
|
||||||
@@ -165,7 +165,7 @@ http:
|
|||||||
redis:
|
redis:
|
||||||
enabled: true
|
enabled: true
|
||||||
address: "redis:6379"
|
address: "redis:6379"
|
||||||
password: "redis-password"
|
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD"
|
||||||
cacheMode: "hybrid"
|
cacheMode: "hybrid"
|
||||||
|
|
||||||
# Hybrid mode L1 cache settings
|
# Hybrid mode L1 cache settings
|
||||||
@@ -375,7 +375,7 @@ metadata:
|
|||||||
namespace: traefik
|
namespace: traefik
|
||||||
type: Opaque
|
type: Opaque
|
||||||
stringData:
|
stringData:
|
||||||
password: "your-secure-redis-password"
|
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD"
|
||||||
---
|
---
|
||||||
# OIDC Middleware with Redis
|
# OIDC Middleware with Redis
|
||||||
apiVersion: traefik.io/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
@@ -397,7 +397,7 @@ spec:
|
|||||||
redis:
|
redis:
|
||||||
enabled: true
|
enabled: true
|
||||||
address: "redis.traefik.svc.cluster.local:6379"
|
address: "redis.traefik.svc.cluster.local:6379"
|
||||||
password: "your-secure-redis-password"
|
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD"
|
||||||
db: 0
|
db: 0
|
||||||
keyPrefix: "traefikoidc:k8s:"
|
keyPrefix: "traefikoidc:k8s:"
|
||||||
cacheMode: "hybrid"
|
cacheMode: "hybrid"
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ http:
|
|||||||
redis:
|
redis:
|
||||||
enabled: true
|
enabled: true
|
||||||
address: "redis:6379"
|
address: "redis:6379"
|
||||||
password: "strong-password"
|
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD" # Example placeholder - use your actual password
|
||||||
db: 1
|
db: 1
|
||||||
keyPrefix: "myapp:"
|
keyPrefix: "myapp:"
|
||||||
poolSize: 20
|
poolSize: 20
|
||||||
@@ -76,7 +76,7 @@ http:
|
|||||||
redis:
|
redis:
|
||||||
enabled: true
|
enabled: true
|
||||||
address: "redis.example.com:6380"
|
address: "redis.example.com:6380"
|
||||||
password: "secure-password"
|
password: "REPLACE_WITH_YOUR_REDIS_PASSWORD" # Example placeholder
|
||||||
enableTLS: true
|
enableTLS: true
|
||||||
tlsSkipVerify: false # Set to true only for testing
|
tlsSkipVerify: false # Set to true only for testing
|
||||||
cacheMode: "redis"
|
cacheMode: "redis"
|
||||||
|
|||||||
+6
-1
@@ -247,7 +247,12 @@ func (c *RedisConn) Do(command string, args ...string) (interface{}, error) {
|
|||||||
defer c.mu.Unlock()
|
defer c.mu.Unlock()
|
||||||
|
|
||||||
// Build command arguments
|
// Build command arguments
|
||||||
cmdArgs := make([]string, 0, len(args)+1)
|
// Check for overflow: ensure len(args)+1 doesn't overflow int
|
||||||
|
argsLen := len(args)
|
||||||
|
if argsLen < 0 || argsLen > (1<<31)-2 {
|
||||||
|
return nil, errors.New("too many arguments")
|
||||||
|
}
|
||||||
|
cmdArgs := make([]string, 0, argsLen+1)
|
||||||
cmdArgs = append(cmdArgs, command)
|
cmdArgs = append(cmdArgs, command)
|
||||||
cmdArgs = append(cmdArgs, args...)
|
cmdArgs = append(cmdArgs, args...)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user