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

Remove token enforcement for true tokenless endpoints #533

Merged
merged 13 commits into from
Nov 7, 2024
Merged

Conversation

nora-codecov
Copy link
Contributor

@nora-codecov nora-codecov commented Oct 15, 2024

Went through the upload endpoints on API:

  • endpoints where we want to allow tokenless: I've made sure the method uses get_token_header() which allows None for the token, which will allow tokenless requests through to the api.

  • endpoints where we don't want to allow tokenless: I've made sure they use get_token_header_or_fail() which does not allow None, so the request will be kicked out before it gets to api. This is not required for the tokenless logic to work, but is nice to have since it prevents junk requests from clogging api.

  • update: we are going to allow tokenless uploads on all upload related endpoints, so switched them all to get_token_header(). get_token_header_or_fail() is now unused, but I'm leaving it in code for if we need to switch an endpoint back to token required.

codecov/engineering-team#2300

@nora-codecov nora-codecov requested review from thomasrockhu-codecov and a team October 15, 2024 22:27
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.95%. Comparing base (db6ab02) to head (10b24f7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #533   +/-   ##
=======================================
  Coverage   95.95%   95.95%           
=======================================
  Files          84       84           
  Lines        3067     3067           
=======================================
  Hits         2943     2943           
  Misses        124      124           
Flag Coverage Δ
python3.10 96.22% <100.00%> (ø)
python3.11 96.21% <100.00%> (ø)
python3.12 96.21% <100.00%> (ø)
python3.8 96.18% <100.00%> (ø)
python3.9 96.18% <100.00%> (ø)
smart-labels 95.95% <100.00%> (ø)

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

github-actions bot commented Oct 15, 2024

✅ All tests successful. No failed tests were found.

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

setup.py Outdated Show resolved Hide resolved
Copy link
Contributor

@michelletran-codecov michelletran-codecov left a comment

Choose a reason for hiding this comment

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

Generally LGTM. Just a few comments about the type annotation.

codecov_cli/services/commit/__init__.py Outdated Show resolved Hide resolved
codecov_cli/services/report/__init__.py Show resolved Hide resolved
@thomasrockhu-codecov
Copy link
Contributor

Agreed, this looks good to me. I'd like to know, however, that this change has been tested on

  1. Public repos from user in the org
  2. Public repos from user outside the org
  3. Dependabot RPs to a repo
  4. Private repos

Copy link
Contributor

@thomasrockhu-codecov thomasrockhu-codecov left a comment

Choose a reason for hiding this comment

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

just fix the lint

@nora-codecov nora-codecov merged commit 880d3fd into main Nov 7, 2024
21 checks passed
@nora-codecov nora-codecov deleted the nora/2298 branch November 7, 2024 20:00
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