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

Ability to specify comments for scopes when going JSON -> Cedar #660

Open
2 tasks
max2me opened this issue Feb 23, 2024 · 3 comments
Open
2 tasks

Ability to specify comments for scopes when going JSON -> Cedar #660

max2me opened this issue Feb 23, 2024 · 3 comments
Labels
feature-request This issue requets a substantial new feature

Comments

@max2me
Copy link

max2me commented Feb 23, 2024

Category

User level API features/changes

Describe the feature you'd like to request

I would like to have ability to provide comments for policy scopes like these:

permit(
    principal in UserGroup::"1234-abcde-fghijkl-5678", // "Finance"
    action,
    resource in Category::"a83b5298-0633-460f-ad0b-311ff23acd2b" // Critical resources
);

Describe alternatives you've considered

  • Including comments like this into annotations (pollutes annotations and leaves valuable info further away from the context)
  • Not including human-friendly names
  • Using human-friendly names instead of unique non-recoverably IDs

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change
@max2me max2me added feature-request This issue requets a substantial new feature pending-triage The cedar maintainers haven't looked at this yet. Automicaly added to all new issues. labels Feb 23, 2024
@khieta khieta added pending-review A Cedar maintainer has looked at this, but believes it needs review by more of the core team and removed pending-triage The cedar maintainers haven't looked at this yet. Automicaly added to all new issues. labels Feb 26, 2024
@john-h-kastner-aws
Copy link
Contributor

Some additional context which I think makes this feature request more compelling.

We explicitly recommend using this sort of unique identifier instead of human readable names. The linked example further recommends using comments to include a human readable alternative in exactly this way. It then seems odd that you can't annotate the policy EST in the same way.

I'm still not convinced we should be adding comments into the EST. You want to associate some additional structured data with entities, so perhaps we should just enable that directly by giving entities a "friendly" identifier in additional to their unique identifier.

@john-h-kastner-aws
Copy link
Contributor

I wrote an RFC for adding doc-comments to Cedar which would support this use case: cedar-policy/rfcs#63

@john-h-kastner-aws john-h-kastner-aws added backlog and removed pending-review A Cedar maintainer has looked at this, but believes it needs review by more of the core team labels Apr 29, 2024
@john-h-kastner-aws
Copy link
Contributor

Noting that with #1233 you could use the entity literal substitution to programmatically replace the uuids with a human readable representation before displaying policies to humans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request This issue requets a substantial new feature
Projects
None yet
Development

No branches or pull requests

3 participants