Skip to content
New issue

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

Extend rego package to let caller set random seed #3560

Closed
tsandall opened this issue Jun 15, 2021 · 0 comments · Fixed by #3561
Closed

Extend rego package to let caller set random seed #3560

tsandall opened this issue Jun 15, 2021 · 0 comments · Fixed by #3561

Comments

@tsandall
Copy link
Member

The topdown package exposes a random seed parameter however it's not plumbed into the rego package which means that callers can't control it.

We should extend the rego package to let users set the seed:

https://pkg.go.dev/github.com/open-policy-agent/opa/topdown#Query.WithSeed

The changes required in the rego package a minimal:

  • Add new parameters (one for rego.New() and another for prepared queries) to provide the seed reader
  • Pass the seed reader into topdown

The changes in rego.go from this which added support for setting the wallclock time are a good model to follow.

tsandall added a commit to tsandall/opa that referenced this issue Jun 15, 2021
Fixes open-policy-agent#3560

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
tsandall added a commit that referenced this issue Jun 15, 2021
Fixes #3560

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant