-
Notifications
You must be signed in to change notification settings - Fork 13
feat: per-index tiered-access middleware #104
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
Merged
Merged
Changes from all commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
6eb2c5f
feat: per-index tier access middleware
ZakirG 7601534
-
ZakirG 052ebbf
Merge branch 'master' of https://github.com/uc-cdis/guppy into feat/p…
ZakirG e98689c
reorganize code
ZakirG 1d802e0
fix unit tests
ZakirG d862064
fix unit tests
ZakirG 06f2251
fix unit tests
ZakirG 77373b1
draft of new middleware structure
ZakirG c2c6a59
adjust manifest validation
ZakirG 3c4c8c9
breaking type-wide middlewares into field-scoped middlewares
ZakirG a8985db
eslint
ZakirG 12ea6b2
add logs
ZakirG 28a0ebe
switched to index-scope querySchema
ZakirG 944435f
Merge branch 'master' of https://github.com/uc-cdis/guppy into feat/p…
ZakirG dfe7856
eslint
ZakirG e0d6b73
eslint
ZakirG 6a342d6
undo schema changes
ZakirG 6a0c5bb
fix places where i confused ES type with GQL type
ZakirG b6a8b92
enhance auth middleware assertion
ZakirG 14bcb67
adjusting new resolver logics
ZakirG 0609a75
adjusting new resolver logics
ZakirG 461d1e5
eslint
ZakirG af157a3
fixing bug in manifest var logivs
ZakirG 83b897f
clarify manifest logic
ZakirG 7a9e2ee
Merge branch 'master' of https://github.com/uc-cdis/guppy into feat/p…
ZakirG 137b673
clarify manifest logic
ZakirG 3b85d4e
histogram schema
ZakirG 5154bcc
histogram schema
ZakirG eed451e
typo fixes
ZakirG 5c8527e
add to schema
ZakirG 8e8091c
add to schema
ZakirG a4985b5
fix client-side error
ZakirG 677fe99
fix client-side error
ZakirG 30dc094
Merge branch 'master' of https://github.com/uc-cdis/guppy into feat/p…
ZakirG 0768a54
fix logic problem
ZakirG ff9d749
adjust comment
ZakirG 73dba72
eslint
ZakirG d8fc09a
feat: add doc
ZakirG 09c4164
feat: add doc
ZakirG 9700a00
feat: add doc
ZakirG c081c6a
PR feedback: config validation
ZakirG 6ade7bb
PR feedback: add RegularAccessHistograms only on-demand
ZakirG 859155f
PR feedback: remove redundant check from resolver
ZakirG 0a6b870
PR feedback: remove extra console log
ZakirG d967b56
PR feedback: histogram RegularAccess ternary operator
ZakirG e167e36
PR feedback: add unit test
ZakirG 54048c8
PR feedback: add unit test
ZakirG 16c9307
fix logic error
ZakirG 397048f
fix logic error
ZakirG 55b19c8
PR feedback: addd more unit tests
ZakirG 05f1d33
fix travis
ZakirG 14189ca
fix travis
ZakirG fd4ad50
feat: enhance unit test for tierAccessLimit
ZakirG 3ad6a7a
feat: enhance unit test for tierAccessLimit
ZakirG 2b12abc
PR feedback: fix indentation
ZakirG 78be005
PR feedback: remove unnecessary else-if
ZakirG f6460fe
PR feedbacks
ZakirG 8314686
PR feedback: JSON file newlines
ZakirG 7eff1fc
PR feedback: update README
ZakirG 2a31f42
adjust whitespace
ZakirG 3e2da94
PR feedback: update README
ZakirG 606b31d
fix logic for download endpoint
ZakirG 9eefb46
fix logic for download endpoint
ZakirG 44b5ccf
debugging download enddpoint
ZakirG b3f916b
debugging download enddpoint
ZakirG 808a7c4
debugging download enddpoint
ZakirG 125998d
remove extra prints
ZakirG 600165b
fix legacy comments
ZakirG 6e229ca
cleaning up
ZakirG 9e25c8b
adjust README
ZakirG 672b33c
PR feedback: change variable name
ZakirG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,41 @@ | ||
| # Index-scoped Tiered-Access | ||
|
|
||
| Most commons use a site-wide tiered access configuration that applies across indices. However, some use cases require index-scoped permissioning. One example is the case of an open-access study viewer where studies have a mix of public properties and controlled-access properties. Another example is a Data Explorer that presents data types with different permission requirements meant to serve a variety of audiences. For these use cases, tiered-access settings can be specified at the index-level rather than the site-wide level. | ||
|
|
||
| Guppy expects that either all indices in the guppy config block will have a tiered-access level set OR that a site-wide tiered-access level is set in the global block of the manifest. Guppy will throw an error if the config settings do not meet one of these two expectations. | ||
|
|
||
| You can set index-scoped tiered-access levels using the `tier_access_level` properties in the guppy block of a common's `manifest.json`. Note that the `tier_access_limit` setting is still site-wide and configurable in the manifest's `global` block. | ||
| ``` | ||
| ... | ||
| "guppy": { | ||
| "indices": [ | ||
| { | ||
| "index": "subject_regular", | ||
| "type": "subject", | ||
| "tier_access_level": "regular" | ||
| }, | ||
| { | ||
| "index": "subject_private", | ||
| "type": "subject_private", | ||
| "tier_access_level": "private" | ||
| }, | ||
| { | ||
| "index": "file_private", | ||
| "type": "file", | ||
| "tier_access_level": "private" | ||
| }, | ||
| { | ||
| "index": "studies_open", | ||
| "type": "studies_open", | ||
| "tier_access_level": "libre" | ||
| }, | ||
| { | ||
| "index": "studies_controlled_access", | ||
| "type": "studies_controlled_access", | ||
| "tier_access_level": "private" | ||
| } | ||
| ], | ||
| "auth_filter_field": "auth_resource_path", | ||
| ... | ||
| }, | ||
| ``` | ||
This file contains hidden or 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 hidden or 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
29 changes: 29 additions & 0 deletions
29
src/server/__tests__/testConfigFiles/test-index-scoped-tier-access.json
This file contains hidden or 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,29 @@ | ||
| { | ||
| "indices": [ | ||
| { | ||
| "index": "subject_regular", | ||
| "type": "subject", | ||
| "tier_access_level": "regular" | ||
| }, | ||
| { | ||
| "index": "subject_private", | ||
| "type": "subject_private", | ||
| "tier_access_level": "private" | ||
| }, | ||
| { | ||
| "index": "file_private", | ||
| "type": "file", | ||
| "tier_access_level": "private" | ||
| }, | ||
| { | ||
| "index": "studies_open", | ||
| "type": "studies_open", | ||
| "tier_access_level": "libre" | ||
| }, | ||
| { | ||
| "index": "studies_controlled_access", | ||
| "type": "studies_controlled_access", | ||
| "tier_access_level": "private" | ||
| } | ||
| ] | ||
| } |
14 changes: 14 additions & 0 deletions
14
src/server/__tests__/testConfigFiles/test-invalid-index-scoped-tier-access.json
This file contains hidden or 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,14 @@ | ||
| { | ||
| "indices": [ | ||
| { | ||
| "index": "subject_regular", | ||
| "type": "subject", | ||
| "tier_access_level": "regular" | ||
| }, | ||
| { | ||
| "index": "subject_private", | ||
| "type": "subject_private", | ||
| "tier_access_level": "private____typo" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.