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

feat(import): allow to use tuples and tuple_file together #369

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DanielBertocci
Copy link

@DanielBertocci DanielBertocci commented Jul 29, 2024

Description

The current implementation on fga store import supports a configuration file with tuples and tuple_file fields.
When tuple_file field is defined, all the tuples defined are ignored.

In this PR, I propose to join the tuples defined in the configuration file with the ones stored in the file set in tuple_file.

Allowing this, enables composition scenarios in which it is possible to share tuples between different store definitions.

Example

store_environment_a.yaml

name: Store Environment A
model_file: ./model.fga
tuple_file: ./shared.tuples.yaml
tuples:
  - user: user:alice
    relation: member
    object: org:org_A

store_environment_b.yaml

name: Store Environment B
model_file: ./model.fga
tuple_file: ./shared.tuples.yaml
tuples:
  - user: user:bob
    relation: member
    object: org:org_B

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

@DanielBertocci DanielBertocci requested a review from a team as a code owner July 29, 2024 08:58
Copy link

linux-foundation-easycla bot commented Jul 29, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@DanielBertocci DanielBertocci force-pushed the feat/store-import-combine-tuples branch 5 times, most recently from 32cdebc to 5110b2f Compare July 29, 2024 13:50
@DanielBertocci DanielBertocci force-pushed the feat/store-import-combine-tuples branch from 5110b2f to 1e6fda5 Compare July 29, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant