Skip to content

Commit 84c559a

Browse files
committed
fix: add API key prefix validation
Add validation to ensure api_key starts with 'fk_' prefix as expected by tests. This fixes the TestConfigValidate/invalid_api_key_prefix test failure.
1 parent 83dc52b commit 84c559a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

config/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ func (c *Config) Validate() error {
128128
return fmt.Errorf("api_key is required")
129129
}
130130

131+
if !strings.HasPrefix(c.APIKey, "fk_") {
132+
return fmt.Errorf("api_key must start with 'fk_'")
133+
}
134+
131135
if c.APIURL == "" {
132136
return fmt.Errorf("API_url is required")
133137
}

0 commit comments

Comments
 (0)