From 663bc7c8a879bb24a3ad97ac1645cd7fb6cccb26 Mon Sep 17 00:00:00 2001 From: kyy Date: Tue, 3 Feb 2026 09:28:38 +0900 Subject: [PATCH] =?UTF-8?q?=ED=81=B4=EB=9D=BC=EC=9D=B4=EC=96=B8=ED=8A=B8?= =?UTF-8?q?=20=EC=8B=9C=ED=81=AC=EB=A6=BF=20DB=20=EB=AA=A8=EB=8D=B8=20?= =?UTF-8?q?=EC=A0=95=EC=9D=98=20=EB=B0=8F=20=EC=B4=88=EA=B8=B0=20=EC=9D=B8?= =?UTF-8?q?=ED=94=84=EB=9D=BC=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/bootstrap/bootstrap.go | 1 + backend/internal/domain/client_secret.go | 21 +++++++++++++++++++++ compose.infra.yaml | 9 +++++++++ 3 files changed, 31 insertions(+) create mode 100644 backend/internal/domain/client_secret.go diff --git a/backend/internal/bootstrap/bootstrap.go b/backend/internal/bootstrap/bootstrap.go index 8acb7e32..2a4ab92a 100644 --- a/backend/internal/bootstrap/bootstrap.go +++ b/backend/internal/bootstrap/bootstrap.go @@ -36,6 +36,7 @@ func migrateSchemas(db *gorm.DB) error { &domain.User{}, &domain.ApiKey{}, &domain.IdentityProviderConfig{}, + &domain.ClientSecret{}, &domain.RelyingParty{}, // &domain.UserConsent{}, // TODO: Uncomment when model is ready ) diff --git a/backend/internal/domain/client_secret.go b/backend/internal/domain/client_secret.go new file mode 100644 index 00000000..704ac1a0 --- /dev/null +++ b/backend/internal/domain/client_secret.go @@ -0,0 +1,21 @@ +package domain + +import ( + "context" + "time" +) + +// ClientSecret represents the stored client secret for OIDC clients. +// Since Hydra only returns the secret once during creation, we store it here. +type ClientSecret struct { + ClientID string `gorm:"primaryKey;column:client_id"` + ClientSecret string `gorm:"column:client_secret;not null"` + CreatedAt time.Time `gorm:"column:created_at"` + UpdatedAt time.Time `gorm:"column:updated_at"` +} + +type ClientSecretRepository interface { + Upsert(ctx context.Context, clientID, secret string) error + GetByID(ctx context.Context, clientID string) (string, error) + Delete(ctx context.Context, clientID string) error +} diff --git a/compose.infra.yaml b/compose.infra.yaml index 368b8911..259bd68f 100644 --- a/compose.infra.yaml +++ b/compose.infra.yaml @@ -66,6 +66,15 @@ services: retries: 3 start_period: 10s + adminer: + image: adminer + container_name: baron_adminer + restart: always + ports: + - "8080:8080" + networks: + - baron_net + volumes: postgres_data: clickhouse_data: