Skip to content

API V3: add IsAuthenticated to permissions #10452

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 2 commits into from
Jun 21, 2023
Merged

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Jun 20, 2023

This isn't a security vulnerability,
we were filtering by the current user.

This was just causing errors, since we were expecting a real user in some queries.

These views are used in .com only, so I have added tests there.
Also, went ahead and added tests for all other endpoints that didn't have them.

Ref https://read-the-docs.sentry.io/issues/4261898141/?alert_rule_id=242443&alert_timestamp=1687234764178&alert_type=email&environment=production&project=161479&referrer=alert_email

This isn't a security vulnerability,
we were filtering by the current user.

This was just causing errors, since we were expecting
a real user in some queries.

These views are used in .com only, so I have added tests there.

Ref https://read-the-docs.sentry.io/issues/4261898141/?alert_rule_id=242443&alert_timestamp=1687234764178&alert_type=email&environment=production&project=161479&referrer=alert_email
@stsewd stsewd requested a review from a team as a code owner June 20, 2023 21:55
@stsewd stsewd requested a review from benjaoming June 20, 2023 21:55
Copy link
Contributor

@benjaoming benjaoming left a comment

Choose a reason for hiding this comment

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

The change itself looks good, and great to have tests validating this as well 👏

The tests seem to follow the same logic:

Given a URL name, kwargs, an HTTP method and optional post data, check that the expected response codes are returned: a) when not logged in and b) when logged in.

So I guess that could also be in some utility method :) I think that'd be nice to maybe note for anyone working on the test code in the future.

@stsewd stsewd merged commit 0df0520 into main Jun 21, 2023
@stsewd stsewd deleted the add-is-auth-permission branch June 21, 2023 14:12
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