Skip to content

Commit

Permalink
Merge pull request #1281 from openziti/fix-1279
Browse files Browse the repository at this point in the history
Require config types to have a root type of object. Fixes #1279
  • Loading branch information
plorenz authored Dec 29, 2022
2 parents f48e523 + 7152476 commit 85e5619
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controller/model/config_type_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ func (entity *ConfigType) toBoltEntity() (boltz.Entity, error) {
if _, err := entity.GetCompiledSchema(); err != nil {
return nil, errorz.NewFieldError(fmt.Sprintf("invalid schema %v", err), "schema", entity.Schema)
}
if entity.Schema["type"] != "object" {
return nil, errorz.NewFieldError("invalid config type schema, root type must be object", "schema", entity.Schema)
}
}
return &persistence.ConfigType{
BaseExtEntity: *boltz.NewExtEntity(entity.Id, entity.Tags),
Expand Down

0 comments on commit 85e5619

Please sign in to comment.