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

Add ability to create an Entity with tags in Entity::new() #1374

Closed
2 tasks
a0js opened this issue Dec 13, 2024 · 3 comments · Fixed by #1402
Closed
2 tasks

Add ability to create an Entity with tags in Entity::new() #1374

a0js opened this issue Dec 13, 2024 · 3 comments · Fixed by #1402
Labels
feature-request This issue requets a substantial new feature pending-review A Cedar maintainer has looked at this, but believes it needs review by more of the core team

Comments

@a0js
Copy link

a0js commented Dec 13, 2024

Category

User level API features/changes

Describe the feature you'd like to request

The entity creation function has no way to create an entity with tags. I'd like to see tags added as an optional parameter to the Entity::new() function, and have them be used in authorization calculations. Additionally, a tag function that behaves similarly to the attr function, might be warranted.

Describe alternatives you've considered

Another option would be to add an update_tags function, however that seems to go against the pattern of immutability I see in the current API for Entity.

Additional context

The only way, currently, to include tags on the entity is to parse it from JSON.

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
@a0js a0js 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 Dec 13, 2024
@john-h-kastner-aws
Copy link
Contributor

john-h-kastner-aws commented Dec 13, 2024

Thanks for opening this! We definitely should support this in the API. We unfortunately can't add a new parameter to new without a breaking change for existing callers and I agree that the mutable update_tags alternative isn't what we'd want to offer. This probably means adding a new_with_tags function in the next minor version release, and possibly updating new whenever we want to release API version 5.0. LMK if you can think of a fourth alternative that might be better.

@john-h-kastner-aws john-h-kastner-aws 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 Dec 13, 2024
@a0js
Copy link
Author

a0js commented Dec 17, 2024

new_with_tags seems appropriate to me. How frequently are minor versions released? I hope to be able to use such functionality sooner rather than later. I'm super new to rust, but I can try to make a PR.

@john-h-kastner-aws
Copy link
Contributor

We don't have a specific cadence for releases, but we're looking at a minor release sometime in January

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 pending-review A Cedar maintainer has looked at this, but believes it needs review by more of the core team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants