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

feat: Guest feature attempt 2 #458

Merged
merged 3 commits into from
Apr 3, 2024
Merged

feat: Guest feature attempt 2 #458

merged 3 commits into from
Apr 3, 2024

Conversation

RulaKhaled
Copy link
Contributor

Purpose/Motivation

What is the feature? Why is this being done?

Links to relevant tickets

What does this PR do?

Include a brief description of the changes in this PR. Bullet points are your friend.

Notes to Reviewer

Anything to note to the team? Any tips on how to review, or where to start?

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@codecov-staging
Copy link

codecov-staging bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.04%. Comparing base (11149b5) to head (d5f7d6f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #458   +/-   ##
=======================================
  Coverage   96.04%   96.04%           
=======================================
  Files         644      644           
  Lines       17151    17161   +10     
=======================================
+ Hits        16473    16483   +10     
  Misses        678      678           
Flag Coverage Δ
unit 96.04% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 96.04% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codecov-public-qa bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (11149b5) 96.04% compared to head (d5f7d6f) 96.04%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #458   +/-   ##
=======================================
  Coverage   96.04%   96.04%           
=======================================
  Files         644      644           
  Lines       17151    17161   +10     
=======================================
+ Hits        16473    16483   +10     
  Misses        678      678           
Flag Coverage Δ
unit 96.04% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 96.04% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
codecov/commands/exceptions.py 100.00% <100.00%> (ø)
graphql_api/types/query/query.py 97.36% <100.00%> (+0.49%) ⬆️

Impacted file tree graph

@RulaKhaled RulaKhaled marked this pull request as ready for review March 18, 2024 15:17
@RulaKhaled RulaKhaled requested a review from a team as a code owner March 18, 2024 15:17
@JerrySentry
Copy link
Contributor

What's the tldr on what happened with attempt 1?

@RulaKhaled
Copy link
Contributor Author

What's the tldr on what happened with attempt 1?

What is guest feature?
guest feature it meant to ensure that only authenticated users can access enterprise pages, any unauthenticated requests should be redirected to /login page. read more about it in this thread: https://sentry.slack.com/archives/C04MJP65Z2M/p1708605980807579?thread_ts=1706626113.674569&cid=C04MJP65Z2M

What was the first attempt?
Initially, I tried using a middleware: #417 it worked, but it worked too well. It wasn't sufficient because it blocked all endpoints except health and login. and apparently we need others like /upload and /commit to always be publicly accessed (some are used in CI build), and the second issue was the inability to fetch internal user to check if current user is logged in.

what am i doing here:
I'm tying this feature to the owner query to block access to all dashboard pages. As you know, all of our dashboard pages depend on this query, if you don't have access to owner, you don't have access to anything. This resolves both of issues mentioned in the first attempt.

Copy link
Contributor

@JerrySentry JerrySentry left a comment

Choose a reason for hiding this comment

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

@RulaKhaled Thanks for the explanation. Approved. Is accessing v2 public REST API for these enterprise builds not an issue in this case?

@thomasrockhu-codecov
Copy link
Contributor

lololol, worked too well

@RulaKhaled
Copy link
Contributor Author

@RulaKhaled Thanks for the explanation. Approved. Is accessing v2 public REST API for these enterprise builds not an issue in this case?

@JerrySentry I'm planning to follow up on the expected for the public API, but i'm not prioritizing it in this PR because most public endpoints require auth token anyway.

@thomasrockhu-codecov hehe quoted Trent on that one

@RulaKhaled RulaKhaled merged commit aa9256b into main Apr 3, 2024
20 checks passed
@RulaKhaled RulaKhaled deleted the guest-feature branch April 3, 2024 16:17
@RulaKhaled RulaKhaled restored the guest-feature branch April 3, 2024 20:12
RulaKhaled added a commit that referenced this pull request Apr 3, 2024
RulaKhaled added a commit that referenced this pull request Apr 3, 2024
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.

3 participants