Skip to content

Commit e76eb80

Browse files
committed
fix(tlsbridge): reject unrecognized tls_bridge.ca_source in config validation
An unknown ca_source (e.g. typo'd 'vault') previously fell through to the ephemeral CA silently; fail fast so a misconfigured file-CA deployment is a loud startup error rather than silent ephemeral mode. Signed-off-by: Hai Huang <huang195@gmail.com>
1 parent 54a6859 commit e76eb80

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

authbridge/authlib/config/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ func (b *TLSBridgeConfig) Validate() error {
6060
if b.Scope != "" && b.Scope != "external" && b.Scope != "all" {
6161
return fmt.Errorf("tls_bridge.scope must be 'external' or 'all', got %q", b.Scope)
6262
}
63+
if b.CASource != "" && b.CASource != "file" && b.CASource != "ephemeral" {
64+
return fmt.Errorf("tls_bridge.ca_source must be 'file' or 'ephemeral', got %q", b.CASource)
65+
}
6366
if b.CASource == "file" && (b.CACertPath == "" || b.CAKeyPath == "") {
6467
return fmt.Errorf("tls_bridge.ca_source=file requires ca_cert_path and ca_key_path")
6568
}

0 commit comments

Comments
 (0)