Skip to content

Commit f0913ec

Browse files
committed
fixes
Signed-off-by: Grant Linville <grant@acorn.io>
1 parent a49e263 commit f0913ec

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

pkg/apis/options/options.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ func NewFlagSet() *pflag.FlagSet {
160160
flagSet.Int("postgres-max-idle-conns", 10, "Maximum number of idle connections to postgres")
161161
flagSet.Int("postgres-max-open-conns", 100, "Maximum number of open connections to postgres")
162162
flagSet.Int("postgres-conn-max-lifetime", 3600, "Maximum lifetime of a connection to postgres in seconds")
163+
flagSet.String("postgres-table-name-prefix", "", "Prefix for postgres table names")
163164
flagSet.String("signature-key", "", "GAP-Signature request signature key (algorithm:secretkey)")
164165
flagSet.Bool("gcp-healthchecks", false, "Enable GCP/GKE healthcheck endpoints")
165166

pkg/sessions/postgres/lock.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ type SessionLock struct {
1818
UpdatedAt time.Time
1919
}
2020

21-
// Lock implements the sessions.Lock interface using a custom table.
22-
// This implementation uses a dedicated table to track locks with expiration times.
23-
//
24-
// Important notes about this implementation:
25-
// 1. Locks have built-in expiration functionality
26-
// 2. Locks are automatically cleaned up when they expire
27-
// 3. The lock key is stored directly in the table
28-
// 4. If the database connection is lost, the lock will be automatically released
2921
type Lock struct {
3022
db *gorm.DB
3123
key string

pkg/sessions/postgres/postgres_store_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ var _ = Describe("PostgreSQL SessionStore Tests", func() {
9292

9393
BeforeEach(func() {
9494
store = &SessionStore{db: db, tableNamePrefix: "oauth2_proxy_test"}
95+
db.Table("oauth2_proxy_test_sessions").AutoMigrate(&Session{})
96+
db.Table("oauth2_proxy_test_session_locks").AutoMigrate(&SessionLock{})
9597
})
9698

9799
It("obtains and releases locks", func() {

0 commit comments

Comments
 (0)