custom rego in databroker (#1124)

* add support for sub policies

* add support for sub policies

* update authz rego policy to support sub policies
This commit is contained in:
Caleb Doxsey 2020-07-22 10:44:05 -06:00 committed by GitHub
parent 1d82be2c0e
commit 504197d83b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 576 additions and 277 deletions

View file

@ -91,8 +91,8 @@ func (src *ConfigSource) rebuild(firstTime bool) {
// add all the config policies to the list
for _, cfgpb := range src.dbConfigs {
for _, policypb := range cfgpb.GetPolicies() {
policy, err := config.NewPolicyFromProto(policypb)
for _, routepb := range cfgpb.GetRoutes() {
policy, err := config.NewPolicyFromProto(routepb)
if err != nil {
log.Warn().Err(err).Msg("databroker: error converting protobuf into policy")
continue