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

PXP-1089 add test + fix acl/authz/size query #251

Merged
merged 6 commits into from
Dec 13, 2019
Merged

Conversation

paulineribeyre
Copy link
Contributor

@paulineribeyre paulineribeyre commented Nov 7, 2019

Bug Fixes

  • Fix query by multiple ACL items or multiple authz items or multiple URLs
  • Fix query by URLs with size=0

Improvements

  • Improve the OpenAPI documentation with more details on how to query by multiple items of the same parameter

@github-actions
Copy link

github-actions bot commented Nov 7, 2019

The style in this PR agrees with black. ✔️

This formatting comment was generated automatically by a script in uc-cdis/wool.

@paulineribeyre paulineribeyre changed the title add test + fix acl/authz/size query PXP-1089 add test + fix acl/authz/size query Nov 7, 2019
Copy link
Contributor

@vpsx vpsx left a comment

Choose a reason for hiding this comment

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

Left a question about possible alternative!
Other than that:

  • do we have any particular reason for assuming that ?x=y,z means AND instead of OR?
  • do we want the same behavior for urls?

if acl:
query = query.join(IndexRecord.acl)
sub = session.query(IndexRecordACE.did)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would we lose anything by doing this instead?

if acl:
    for u in acl:
        sub = session.query(IndexRecordACE.did).filter(IndexRecordACE.ace == u)
        query = query.filter(IndexRecord.did.in_(sub.subquery()))

if authz:
query = query.join(IndexRecord.authz)
sub = session.query(IndexRecordAuthz.did)
Copy link
Contributor

Choose a reason for hiding this comment

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

as with acl

@paulineribeyre
Copy link
Contributor Author

do we have any particular reason for assuming that ?x=y,z means AND instead of OR?

if users want OR they can query each item separately; this is the only way to query AND
(note that currently ?x=y,z doesn't return anything)

do we want the same behavior for urls?

mm, i guess 🤔

Copy link
Contributor

@vpsx vpsx left a comment

Choose a reason for hiding this comment

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

🎉 if you are bored you can specify in the swagger that the multiple urls etc will be anded 🌮

@paulineribeyre paulineribeyre merged commit 265574a into master Dec 13, 2019
@paulineribeyre paulineribeyre deleted the fix/misc branch December 13, 2019 00:17
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.

None yet

2 participants