Skip to content

Commit

Permalink
fix(golang-filter): rename config flag to opa_enforce
Browse files Browse the repository at this point in the history
  • Loading branch information
qlonik committed Feb 29, 2024
1 parent b3ea61e commit 95ff2df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions privacy-profile-composer/pkg/envoyfilter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ func (p *ConfigParser) Parse(any *anypb.Any, callbacks api.ConfigCallbackHandler
}

// decide whether to drop requests after a violation or not
if val, ok := configStruct["opa_enable"]; !ok {
if val, ok := configStruct["opa_enforce"]; !ok {
conf.opaEnforce = false // by default, don't drop requests (i.e. dev mode)
} else if opaEnable, ok := val.(bool); !ok {
return nil, fmt.Errorf("opa_enable: expect bool while got %T", opaEnable)
} else if opaEnforce, ok := val.(bool); !ok {
return nil, fmt.Errorf("opa_enforce: expect bool while got %T", opaEnforce)
} else {
conf.opaEnforce = opaEnable
conf.opaEnforce = opaEnforce
}

// opa_config should be a YAML inline string,
Expand Down

0 comments on commit 95ff2df

Please sign in to comment.