Skip to content

feat: Add type restrictions to JSON syntax#7

Merged
rhamzeh merged 13 commits intomainfrom
feat/add-type-restrictions-to-json-syntax
Dec 12, 2022
Merged

feat: Add type restrictions to JSON syntax#7
rhamzeh merged 13 commits intomainfrom
feat/add-type-restrictions-to-json-syntax

Conversation

@rhamzeh
Copy link
Copy Markdown
Member

@rhamzeh rhamzeh commented Sep 8, 2022

Description

This RFC introduces support for type restrictions on relations. This enables restricting what types of users can be assigned to specific relations.

Rendered Version

Click here to view the RFC as a rendered preview.

References

See #8 for additional DSL syntax changes.

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

@rhamzeh rhamzeh added the enhancement New feature or request label Sep 8, 2022
@rhamzeh rhamzeh self-assigned this Sep 8, 2022
@rhamzeh rhamzeh force-pushed the feat/add-type-restrictions-to-json-syntax branch 3 times, most recently from d2f0cd3 to 1f56665 Compare September 8, 2022 13:29
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
@rhamzeh rhamzeh force-pushed the feat/add-type-restrictions-to-json-syntax branch from 1f56665 to 0e2c2dc Compare September 8, 2022 18:28
Comment thread 20220831-add-type-restrictions-to-json-syntax.md
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
@rhamzeh rhamzeh force-pushed the feat/add-type-restrictions-to-json-syntax branch 5 times, most recently from 1564ab2 to bca4aa3 Compare September 9, 2022 14:42
Comment thread 20220831-add-type-restrictions-to-json-syntax.md
@rhamzeh rhamzeh force-pushed the feat/add-type-restrictions-to-json-syntax branch from bca4aa3 to 2a0cca7 Compare September 9, 2022 16:14
@rhamzeh rhamzeh force-pushed the feat/add-type-restrictions-to-json-syntax branch from 2a0cca7 to 0dd0c37 Compare September 9, 2022 16:24
@rhamzeh rhamzeh force-pushed the feat/add-type-restrictions-to-json-syntax branch from d46006b to b719b5a Compare September 9, 2022 20:27
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
@rhamzeh rhamzeh marked this pull request as ready for review September 12, 2022 17:06
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
@rhamzeh rhamzeh force-pushed the feat/add-type-restrictions-to-json-syntax branch from abfa9ca to bd95762 Compare September 12, 2022 22:00
Copy link
Copy Markdown

@craigpastro craigpastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
@rhamzeh
Copy link
Copy Markdown
Member Author

rhamzeh commented Sep 13, 2022

I don't see the RFC mention restrictions on specific relations of an object type.

e.g. group#member

Can we please include this in the scope of the RFC?

@jon-whit can you elaborate please? This is definitely mentioned in the RFC

Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
Comment thread 20220831-add-type-restrictions-to-json-syntax.md
Comment thread 20220831-add-type-restrictions-to-json-syntax.md
We are retaining our current implemetation where `*` is allowed, and it
will mean all users that can be related, are related.

A later RFC can re-introduce a restriction on `*` if needed.
Copy link
Copy Markdown

@craigpastro craigpastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread 20220831-add-type-restrictions-to-json-syntax.md Outdated
@matthewpereira matthewpereira changed the title feat: add type restrictions rfc feat: Add type restrictions to JSON syntax Nov 8, 2022
Copy link
Copy Markdown
Contributor

@jon-whit jon-whit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This RFC needs to be updated to take into account the structure of the existing API changes, namely https://github.com/openfga/api/blob/main/openfga/v1/authzmodel.proto#L70-L80

@rhamzeh rhamzeh merged commit 01172c6 into main Dec 12, 2022
@rhamzeh rhamzeh deleted the feat/add-type-restrictions-to-json-syntax branch December 12, 2022 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants