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: endpoint for validating oauth token source #972

Merged
merged 12 commits into from
Sep 27, 2023
Merged

Conversation

plyr4
Copy link
Contributor

@plyr4 plyr4 commented Sep 26, 2023

the following PR refactors oauth token validation into its own function and exposes the functionality through an API endpoint.

the purpose is to allow users to pass back tokens embedded by vela pipelines to validate that they were indeed created by Vela. it is meant to also improve the security around third-party integrated tooling.

  • the AuthenticateToken has been refactored to use the new func, but it is functionally identical.
  • also fixes a couple test typos

closes go-vela/community#854

@plyr4 plyr4 changed the title feat/validate token feat: endpoint for validating oauth tokens Sep 26, 2023
@plyr4 plyr4 changed the title feat: endpoint for validating oauth tokens feat: endpoint for validating oauth token source Sep 26, 2023
@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Merging #972 (361e26d) into main (f3acd78) will increase coverage by 0.00%.
The diff coverage is 75.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #972   +/-   ##
=======================================
  Coverage   71.09%   71.09%           
=======================================
  Files         312      312           
  Lines       12982    12989    +7     
=======================================
+ Hits         9229     9235    +6     
  Misses       3288     3288           
- Partials      465      466    +1     
Files Coverage Δ
scm/github/authentication.go 81.25% <75.00%> (+0.29%) ⬆️

@plyr4 plyr4 marked this pull request as ready for review September 27, 2023 13:48
@plyr4 plyr4 requested a review from a team as a code owner September 27, 2023 13:48
wass3rw3rk
wass3rw3rk previously approved these changes Sep 27, 2023
timhuynh94
timhuynh94 previously approved these changes Sep 27, 2023
@plyr4 plyr4 dismissed stale reviews from timhuynh94 and wass3rw3rk via 361e26d September 27, 2023 16:35
@plyr4 plyr4 merged commit aa6f468 into main Sep 27, 2023
11 of 12 checks passed
@plyr4 plyr4 deleted the feat/validate-token branch September 27, 2023 16:47
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.

allow validation for generated oauth tokens
3 participants