Skip to content

Commit 3a6933e

Browse files
committed
fix: enforce encryption of client secret
1 parent ad78318 commit 3a6933e

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

internal/models/custom_oauth_provider.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,10 @@ func (p CustomOAuthProvider) TableName() string {
7979
}
8080

8181
// SetClientSecret encrypts and stores the client secret using the configured
82-
// database encryption settings. If encryption is disabled, the secret is
83-
// stored in plaintext (temporary fallback for now)
82+
// database encryption settings. Encryption must be enabled to store client secrets.
8483
func (p *CustomOAuthProvider) SetClientSecret(secret string, dbEncryption conf.DatabaseEncryptionConfiguration) error {
8584
if !dbEncryption.Encrypt {
86-
// Fallback: store in plaintext when encryption is not enabled.
87-
p.ClientSecret = secret
88-
return nil
85+
return errors.New("database encryption must be enabled to store custom OAuth provider client secrets")
8986
}
9087

9188
if dbEncryption.EncryptionKeyID == "" || dbEncryption.EncryptionKey == "" {

0 commit comments

Comments
 (0)