-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2123 from authzed/disallow-circular-imports
Handle circular and duplicate imports
- Loading branch information
Showing
13 changed files
with
161 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
pkg/composableschemadsl/compiler/importer-test/circular-import/expected.zed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
definition user {} | ||
|
||
definition persona {} | ||
|
||
definition resource { | ||
relation viewer: user | ||
permission view = viewer | ||
} |
6 changes: 6 additions & 0 deletions
6
pkg/composableschemadsl/compiler/importer-test/circular-import/root.zed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from .subjects import user | ||
|
||
definition resource { | ||
relation viewer: user | ||
permission view = viewer | ||
} |
3 changes: 3 additions & 0 deletions
3
pkg/composableschemadsl/compiler/importer-test/circular-import/subjects.zed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .user import user | ||
|
||
definition persona {} |
3 changes: 3 additions & 0 deletions
3
pkg/composableschemadsl/compiler/importer-test/circular-import/user.zed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .subjects import persona | ||
|
||
definition user {} |
8 changes: 8 additions & 0 deletions
8
pkg/composableschemadsl/compiler/importer-test/diamond-shaped/expected.zed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
definition user {} | ||
|
||
definition persona {} | ||
|
||
definition resource { | ||
relation viewer: user | ||
permission view = viewer | ||
} |
1 change: 1 addition & 0 deletions
1
pkg/composableschemadsl/compiler/importer-test/diamond-shaped/left.zed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .subjects import user |
1 change: 1 addition & 0 deletions
1
pkg/composableschemadsl/compiler/importer-test/diamond-shaped/right.zed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .subjects import persona |
7 changes: 7 additions & 0 deletions
7
pkg/composableschemadsl/compiler/importer-test/diamond-shaped/root.zed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from .left import user | ||
from .right import persona | ||
|
||
definition resource { | ||
relation viewer: user | ||
permission view = viewer | ||
} |
2 changes: 2 additions & 0 deletions
2
pkg/composableschemadsl/compiler/importer-test/diamond-shaped/subjects.zed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
definition user {} | ||
definition persona {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters