Skip to content

Commit

Permalink
Add config validation for service types
Browse files Browse the repository at this point in the history
  • Loading branch information
carabasdaniel committed Aug 2, 2023
1 parent 47cd3e0 commit afdde54
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/app/authorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ func (e *Authorizer) ConfigServices() error {
if err != nil {
return err
}
e.Services["edge"] = edgeDir

for key := range e.Configuration.Services {
if !(contains(edgeDir.AvailableServices(), key) || key == authorizerService) {
return errors.Errorf("unknown service type %s", key)
}
}

e.Services = make(map[string]ServiceTypes)

Expand All @@ -105,7 +112,6 @@ func (e *Authorizer) ConfigServices() error {
unary, stream := middlewareList.AsGRPCOptions()
opts = append(opts, unary, stream)

e.Services["edge"] = edgeDir
if contains(serviceConfig.registeredServices, "authorizer") {
topaz, err := NewTopaz(serviceConfig.API, &e.Configuration.Common, opts, e.Logger)
if err != nil {
Expand Down

0 comments on commit afdde54

Please sign in to comment.