opa icon indicating copy to clipboard operation
opa copied to clipboard

docs: Annotations doc should provide reference to Rego functions for accessing metadata

Open anderseknert opened this issue 2 years ago • 1 comments

While there's even a section named "Accessing Annotations", it does not mention, or link to, the Rego reference docs for instructions on how to do this from inside of a policy.

Suggestion: add new sub-heading under "Acessing Annotations" called "Rego", providing a very simple example, and link to the policy reference for those functions.

anderseknert avatar Jul 25 '22 18:07 anderseknert

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

stale[bot] avatar Aug 30 '22 22:08 stale[bot]

Hey @anderseknert :wave: !

Hoping this URL works for you when you check it, I've not used Netlify much in the past so not sure how long it stays up.

Is this something (more or less) you're looking for? https://6330814e08aa9d269457dfc4--parsifal-opa.netlify.app/docs/edge/annotations/#accessing-annotations

You mentioned a very simple example and the one in the Rego reference docs seemed actually quite simple :+1: even I understood it :smile: but if you had something else in mind please let me know?

Looking forward to your feedback!

Parsifal-M avatar Sep 25 '22 16:09 Parsifal-M

This is great! Thanks @Parsifal-M 😃 I'd probably skip the use of a custom function and just have the values used directly in the rule — abstractions might distract rather than help here. But that's a nit really. Please submit a PR :)

anderseknert avatar Sep 25 '22 19:09 anderseknert

Hey @anderseknert :wave:

Updated version as discussed: https://63314f1b746bfd374108e097--parsifal-opa.netlify.app/docs/edge/annotations/#accessing-annotations

What do you think? :smiley:

Parsifal-M avatar Sep 26 '22 07:09 Parsifal-M

Looks great! 👍

anderseknert avatar Sep 26 '22 07:09 anderseknert