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: Annotations doc should provide reference to Rego functions for accessing metadata #4937

Closed
anderseknert opened this issue Jul 25, 2022 · 5 comments

Comments

@anderseknert
Copy link
Member

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.

@stale
Copy link

stale bot commented Aug 30, 2022

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

@stale stale bot added the inactive label Aug 30, 2022
@Parsifal-M
Copy link
Contributor

Hey @anderseknert 👋 !

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 👍 even I understood it 😄 but if you had something else in mind please let me know?

Looking forward to your feedback!

@stale stale bot removed the inactive label Sep 25, 2022
@anderseknert
Copy link
Member Author

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 :)

@Parsifal-M
Copy link
Contributor

Hey @anderseknert 👋

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

What do you think? 😃

@anderseknert
Copy link
Member Author

Looks great! 👍

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