Skip to content

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
  • Loading branch information
cheungpat committed Jun 5, 2017
1 parent c8d9646 commit d9320ad
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 d9320ad

Please sign in to comment.