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

docs(policy-reference): add more examples for existing built-in functions #3786

Open
srenatus opened this issue Sep 14, 2021 · 3 comments
Open

Comments

@srenatus
Copy link
Contributor

The policy reference contains a list of all the built-in functions; and examples for very few. It would be helpful for getting off the ground if some basic examples showed to to use a built-in.

This issue is broad and not meant to be fixed in a single sweep. Any added examples will be valuable.

@stale
Copy link

stale bot commented Nov 22, 2021

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

@Joffref
Copy link
Contributor

Joffref commented Jul 12, 2022

At this time on-boarding some built-in functions is quite hard such as graph related functions.

I think this a good pick, I would enjoy to participate, is it possible to create a draft PR ?

I there a list (with prioritization) of function that need documentation ?

@srenatus
Copy link
Contributor Author

I've got ideas about how to deal with this, centered around well-annotated example rego files.

So if you'd like to pick a builtin to document, please create a rego file like docs/examples/io.jwt.decode_verify.rego,

package examples.builtins.io.jwt.decode_verify

# METADATA
# description: |
#   When used in a simple case, io.jwt.decode_verify does this and that.
test_simple {
  jwt := "..."
  criteria := { }
  io.jwt.decode_verify(jwt, criteria) == { ... }
}

# METADATA
# description: To check issuer, the `iss` criterium needs to be provided
test_issuer {
  # ...
}

with a few of these in place, we can then worry about hooking them into the website docs automatically, which is a bit of a different story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants