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

Features/configure response #62

Merged
merged 24 commits into from
Oct 31, 2023
Merged

Features/configure response #62

merged 24 commits into from
Oct 31, 2023

Conversation

gsfk
Copy link
Member

@gsfk gsfk commented Oct 30, 2023

(Requires bento repo changes here to run)

Large refactor of beacon response code.

  • Query responses are now fully configurable: the response will vary based on permissions and the request itself.
  • Both authorized and anonymous users can request arbitrary granularity levels for a response, which will be granted or not, based on permissions. So e.g. authorized users can now get uncensored count or boolean responses, where previously they were limited to full-response only
  • centralized censorship code
  • corrected minor errors in old responses

@gsfk gsfk marked this pull request as ready for review October 30, 2023 18:43
@gsfk gsfk requested a review from davidlougheed October 30, 2023 18:54
return requested_g
# if max if "boolean" nothing else is permitted
if max_g == GRANULARITY_BOOLEAN:
return max_g
Copy link
Member

Choose a reason for hiding this comment

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

so if the user (with boolean access only) requests full records, they get back booleans and not an error? does the spec have an opinion on this or is it a free-for-all?

Copy link
Member Author

@gsfk gsfk Oct 31, 2023

Choose a reason for hiding this comment

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

Yeah, it's a free-for-all, although I am mostly following the suggestion here in the spec. Since we can do whatever, we could also:

  • return 401 Unauthorized (or 400 Bad Request?)
  • return as in this pr, but add a message in the response along the lines of "you don't have permissions for this granularity"

I think either of these is fine.

Copy link
Member

Choose a reason for hiding this comment

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

yeah based on the spec I think this is good then!

Copy link
Member

@davidlougheed davidlougheed left a comment

Choose a reason for hiding this comment

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

lgtm

@gsfk gsfk merged commit 743af83 into master Oct 31, 2023
1 check passed
@gsfk gsfk deleted the features/configure-response branch April 15, 2024 18:56
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.

2 participants