Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-30 22:06:11 +01:00
forgejo/services/actions
Rowan Bohde ddabba5f89
allow the actions user to login via the jwt token (#32527)
We have some actions that leverage the Gitea API that began receiving
401 errors, with a message that the user was not found. These actions
use the `ACTIONS_RUNTIME_TOKEN` env var in the actions job to
authenticate with the Gitea API. The format of this env var in actions
jobs changed with go-gitea/gitea/pull/28885 to be a JWT (with a
corresponding update to `act_runner`) Since it was a JWT, the OAuth
parsing logic attempted to parse it as an OAuth token, and would return
user not found, instead of falling back to look up the running task and
assigning it to the actions user.

Make ACTIONS_RUNTIME_TOKEN in action runners could be used,
attempting to parse Oauth JWTs. The code to parse potential old
`ACTION_RUNTIME_TOKEN` was kept in case someone is running an older
version of act_runner that doesn't support the Actions JWT.

(cherry picked from commit 407b6e6dfc7ee9ebb8a16c7f1a786e4c24d0516e)

Conflicts:
	services/auth/oauth2.go
  trivial context conflicts because OAuth2 scopes are in Forgejo and
  not yet in Gitea
2024-11-24 10:41:56 +00:00
..
auth.go allow the actions user to login via the jwt token (#32527) 2024-11-24 10:41:56 +00:00
auth_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
cleanup.go Clear up old Actions logs (#31735) 2024-08-04 18:24:10 +02:00
clear_tasks.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
commit_status.go fix: Actions PR workflows must update the commit status 2024-11-04 11:27:14 +01:00
init.go Move notification interface to services layer (#26915) 2023-09-05 18:37:47 +00:00
interface.go feat(api): enhance Actions Secrets Management API for repository (#30656) 2024-04-28 15:39:01 +02:00
job_emitter.go Improve the handling of jobs.<job_id>.if (#31070) 2024-06-02 09:08:07 +02:00
job_emitter_test.go Improve the handling of jobs.<job_id>.if (#31070) 2024-06-02 09:08:07 +02:00
main_test.go tests: improve actvititypub integration test code 2024-11-01 22:39:49 +01:00
notifier.go fix: add label to issues and PR labeled/unlabeled events 2024-11-04 10:41:11 +01:00
notifier_helper.go Update scheduled tasks even if changes are pushed by "ActionsUser" (#32246) 2024-10-20 09:24:58 +02:00
notifier_helper_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
rerun.go Fix bugs in rerunning jobs (#29955) 2024-03-26 19:04:26 +01:00
rerun_test.go Fix bugs in rerunning jobs (#29955) 2024-03-26 19:04:26 +01:00
schedule_tasks.go Interpolate runs-on with variables when scheduling tasks (#30640) 2024-04-28 15:39:00 +02:00
variables.go Add API for Variables (#29520) 2024-04-07 10:57:53 +02:00
workflows.go style: reenable switch check 2024-08-18 15:19:01 +02:00