Skip to content

fix: parse public key as fallback for certificate for bearer authentication#3180

Merged
andaaron merged 2 commits into
project-zot:mainfrom
evanebb:bearer-parse-pubkey
Jun 4, 2025
Merged

fix: parse public key as fallback for certificate for bearer authentication#3180
andaaron merged 2 commits into
project-zot:mainfrom
evanebb:bearer-parse-pubkey

Conversation

@evanebb

@evanebb evanebb commented Jun 2, 2025

Copy link
Copy Markdown
Contributor

What type of PR is this?
bug

Which issue does this PR fix:
#3173

Testing done on this change:
Added automated test cases to check whether supplying RSA/ED/EC public keys instead of certificates works as expected.
Additionally, I spun up a local Zot instance and handed it an RSA public key (not a certificate), and verified that bearer authentication works as expected.

Automation added to e2e:

Will this break upgrades or downgrades?
Nope.

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Signed-off-by: evanebb <git@evanus.nl>
@rchincha

rchincha commented Jun 3, 2025

Copy link
Copy Markdown
Contributor

@evanebb pls take a look at the ci failures. Thx for getting this PR started.

Comment thread errors/errors.go Outdated
Signed-off-by: evanebb <git@evanus.nl>
@codecov

codecov Bot commented Jun 3, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.

Project coverage is 90.60%. Comparing base (167f7e3) to head (bca1e70).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/api/authn.go 90.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3180      +/-   ##
==========================================
+ Coverage   90.57%   90.60%   +0.02%     
==========================================
  Files         182      182              
  Lines       32827    32836       +9     
==========================================
+ Hits        29734    29752      +18     
+ Misses       2325     2320       -5     
+ Partials      768      764       -4     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@evanebb

evanebb commented Jun 3, 2025

Copy link
Copy Markdown
Contributor Author

@rchincha the CI failures (at least the testing workflow) just seemed to be flaky tests, given that two runs failed at a different point, and the latest run went fine without me changing anything in those places:

The only blocker is Codecov complaining about 0.10% of missing patch coverage, I'll try to bump it up that last bit but you're of course free to bypass it if you want to :)

@rchincha rchincha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@andaaron
andaaron merged commit 0c51cb7 into project-zot:main Jun 4, 2025
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.

4 participants