Skip to content

Commit

Permalink
Merge pull request #65 from CanDIG/model_3
Browse files Browse the repository at this point in the history
Update to model 3
  • Loading branch information
SonQBChau authored Aug 21, 2024
2 parents 2a0cb9a + 3e52283 commit 51669ae
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 59 deletions.
44 changes: 18 additions & 26 deletions defaults/paths.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"paths": {
"read": {
"get": [
"/v2/discovery/?.*",
"/v2/authorized/?.*",
"/htsget/v1/variants/?.*",
"/htsget/v1/variants/search",
"/htsget/v1/reads/?.*",
"/htsget/v1/samples/?.*",
"/ga4gh/drs/v1/objects/?.*",
"/ga4gh/drs/v1/cohorts/?.*",
"/ga4gh/drs/v1/cohorts/?.*/status",
"/beacon/v2/g_variants/?.*"
"/v3/discovery/?.*",
"/v3/authorized/?.*",
"/htsget/v1/variants/?.*",
"/htsget/v1/variants/search",
"/htsget/v1/reads/?.*",
"/htsget/v1/samples/?.*",
"/ga4gh/drs/v1/objects/?.*",
"/ga4gh/drs/v1/cohorts/?.*",
"/ga4gh/drs/v1/cohorts/?.*/status",
"/beacon/v2/g_variants/?.*"
],
"post": [
"/htsget/v1/variants/search",
Expand All @@ -20,22 +20,14 @@
]
},
"curate": {
"get": [
"/htsget/v1/variants/?.*/index",
"/htsget/v1/variants/?.*/verify",
"/htsget/v1/reads/?.*/index",
"/htsget/v1/reads/?.*/verify"
],
"post": [
"/ingest/?.*",
"/ga4gh/drs/v1/?.*",
"/v2/ingest/?.*"
],
"delete": [
"/ingest/?.*",
"/ga4gh/drs/v1/?.*",
"/v2/ingest/?.*"
]
"get": [
"/htsget/v1/variants/?.*/index",
"/htsget/v1/variants/?.*/verify",
"/htsget/v1/reads/?.*/index",
"/htsget/v1/reads/?.*/verify"
],
"post": ["/ingest/?.*", "/ga4gh/drs/v1/?.*", "/v3/ingest/?.*"],
"delete": ["/ingest/?.*", "/ga4gh/drs/v1/?.*", "/v3/ingest/?.*"]
}
}
}
46 changes: 13 additions & 33 deletions tests/test_opa_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,47 +243,27 @@ def test_site_admin(user, expected_result, site_roles, users, programs):

def get_user_datasets():
return [
( # site admin should be able to read all datasets
( # site admin should be able to read all datasets
"site_admin",
{
"body": {
"path": "/ga4gh/drs/v1/cohorts/",
"method": "GET"
}
},
["SYNTHETIC-1", "SYNTHETIC-2", "SYNTHETIC-3", "SYNTHETIC-4"]
{"body": {"path": "/ga4gh/drs/v1/cohorts/", "method": "GET"}},
["SYNTHETIC-1", "SYNTHETIC-2", "SYNTHETIC-3", "SYNTHETIC-4"],
),
( # user1 can view the datasets it's a member of
( # user1 can view the datasets it's a member of
"user1",
{
"body": {
"path": "/v2/discovery/programs/",
"method": "GET"
}
},
["SYNTHETIC-1", "SYNTHETIC-3", "SYNTHETIC-4"]
{"body": {"path": "/v3/discovery/programs/", "method": "GET"}},
["SYNTHETIC-1", "SYNTHETIC-3", "SYNTHETIC-4"],
),
( # user3 can view the datasets it's a member of + DAC programs,
# but SYNTHETIC-1's authorized dates are in the past
( # user3 can view the datasets it's a member of + DAC programs,
# but SYNTHETIC-1's authorized dates are in the past
"user3",
{
"body": {
"path": "/v2/discovery/programs/",
"method": "GET"
}
},
["SYNTHETIC-3", "SYNTHETIC-4"]
{"body": {"path": "/v3/discovery/programs/", "method": "GET"}},
["SYNTHETIC-3", "SYNTHETIC-4"],
),
(
"dac_user",
{
"body": {
"path": "/ga4gh/drs/v1/cohorts",
"method": "GET"
}
},
["SYNTHETIC-3"]
)
{"body": {"path": "/ga4gh/drs/v1/cohorts", "method": "GET"}},
["SYNTHETIC-3"],
),
]


Expand Down

0 comments on commit 51669ae

Please sign in to comment.