Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
Do not allow API KEY to be the same as MASTER_KEY
Browse files Browse the repository at this point in the history
refs #373
  • Loading branch information
cheungpat authored and rickmak committed Jun 5, 2017
1 parent c8d9646 commit 7f7ed0c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/server/skyconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ func (config *Configuration) Validate() error {
if config.App.MasterKey == "" {
return errors.New("MASTER_KEY is not set")
}
if config.App.APIKey == config.App.MasterKey {
return errors.New("MASTER_KEY cannot be the same as API_KEY")
}
if !regexp.MustCompile("^[A-Za-z0-9_]+$").MatchString(config.App.Name) {
return fmt.Errorf("APP_NAME '%s' contains invalid characters other than alphanumerics or underscores", config.App.Name)
}
Expand Down

0 comments on commit 7f7ed0c

Please sign in to comment.