We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code panics:
package main import ( "context" "log" "github.com/open-policy-agent/opa/sdk" ) func main() { ctx := context.Background() opa, err := sdk.New(ctx, sdk.Options{}) // Config MUST be provided if err != nil { log.Fatal(err) } result, err := opa.Decision(ctx, sdk.DecisionOptions{}) if err != nil { log.Fatal(err) } log.Println(result) }
We should fix the sdk so that this doesn't cause a panic. All we need to do is check if the Config reader is nil and default to an empty object here: https://github.com/open-policy-agent/opa/blob/main/sdk/options.go#L64 (e.g., set bs to []byte("{}")).
Config
bs
[]byte("{}")
The text was updated successfully, but these errors were encountered:
Is anyone assigned to this issue? I would like to take this on.
Sorry, something went wrong.
@damienjburks 👍
fixing for open-policy-agent#4303
a01c864
Signed-off-by: Damien Burks <[email protected]>
0c14834
damienjburks
No branches or pull requests
The following code panics:
We should fix the sdk so that this doesn't cause a panic. All we need to do is check if the
Config
reader is nil and default to an empty object here: https://github.com/open-policy-agent/opa/blob/main/sdk/options.go#L64 (e.g., setbs
to[]byte("{}")
).The text was updated successfully, but these errors were encountered: