mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
chore: deprecate HTTP API endpoints for obtaining the runner registration token (#11650)
Forgejo Runner is deprecating the runner registration token. It is too powerful, requires tooling, and is unnecessary. https://codeberg.org/forgejo/forgejo/pulls/10677 added an HTTP API for runner registration. https://codeberg.org/forgejo/forgejo/pulls/11516 added the ability to manage runners using Forgejo's web interface and marked the runner registration token in the UI as deprecated. This PR deprecates the HTTP endpoints for obtaining the runner registration token by updating the API documentation. The implementation and all the tests remain in place and untouched. See https://code.forgejo.org/forgejo/forgejo-actions-feature-requests/issues/88 for context. ## Checklist The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org). ### Tests for Go changes (can be removed for JavaScript changes) - I added test coverage for Go changes... - [ ] in their respective `*_test.go` for unit tests. - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server. - I ran... - [x] `make pr-go` before pushing ### Tests for JavaScript changes (can be removed for Go changes) - I added test coverage for JavaScript changes... - [ ] in `web_src/js/*.test.js` if it can be unit tested. - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)). ### Documentation - [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. - [x] I did not document these changes and I do not expect someone else to do it. ### Release notes - [x] This change will be noticed by a Forgejo user or admin (feature, bug fix, performance, etc.). I suggest to include a release note for this change. - [ ] This change is not visible to a Forgejo user or admin (refactor, dependency upgrade, etc.). I think there is no need to add a release note for this change. *The decision if the pull request will be shown in the release notes is up to the mergers / release team.* The content of the `release-notes/<pull request number>.md` file will serve as the basis for the release notes. If the file does not exist, the title of the pull request will be used instead. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11650 Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org> Co-authored-by: Andreas Ahlenstorf <andreas@ahlenstorf.ch> Co-committed-by: Andreas Ahlenstorf <andreas@ahlenstorf.ch>
This commit is contained in:
parent
6e804c8b1b
commit
9177e52cf4
6 changed files with 38 additions and 6 deletions
|
|
@ -9,10 +9,16 @@ import (
|
|||
)
|
||||
|
||||
// GetRunnerRegistrationToken returns a token to register global runners
|
||||
//
|
||||
// Deprecated: This operation has been deprecated in Forgejo 15. Use the web UI or RegisterRunner instead.
|
||||
func GetRunnerRegistrationToken(ctx *context.APIContext) {
|
||||
// swagger:operation GET /admin/actions/runners/registration-token admin adminGetRunnerRegistrationToken
|
||||
// ---
|
||||
// summary: Get a runner registration token for registering global runners
|
||||
// description: >
|
||||
// This operation has been deprecated in Forgejo 15.
|
||||
// Use the web UI or [`/admin/actions/runners`](#/admin/registerAdminRunner) instead.
|
||||
// deprecated: true
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
|
|
@ -25,14 +31,14 @@ func GetRunnerRegistrationToken(ctx *context.APIContext) {
|
|||
|
||||
// GetRegistrationToken returns the token to register global runners
|
||||
//
|
||||
// Deprecated: This operation has been deprecated in Forgejo 15. Use GetRunnerRegistrationToken instead.
|
||||
// Deprecated: This operation has been deprecated in Forgejo 15. Use the web UI or RegisterRunner instead.
|
||||
func GetRegistrationToken(ctx *context.APIContext) {
|
||||
// swagger:operation GET /admin/runners/registration-token admin adminGetRegistrationToken
|
||||
// ---
|
||||
// summary: Get a runner registration token for registering global runners
|
||||
// description: >
|
||||
// This operation has been deprecated in Forgejo 15.
|
||||
// Use [`/admin/actions/runners/registration-token`](#/admin/adminGetRunnerRegistrationToken) instead.
|
||||
// Use the web UI or [`/admin/actions/runners`](#/admin/registerAdminRunner) instead.
|
||||
// deprecated: true
|
||||
// produces:
|
||||
// - application/json
|
||||
|
|
|
|||
|
|
@ -1010,7 +1010,7 @@ func Routes() *web.Route {
|
|||
m.Combo("").
|
||||
Get(reqToken(), user.ListRunners).
|
||||
Post(bind(api.RegisterRunnerOptions{}), user.RegisterRunner)
|
||||
m.Get("/registration-token", reqToken(), user.GetRegistrationToken)
|
||||
m.Get("/registration-token", reqToken(), user.GetRegistrationToken) //nolint:staticcheck
|
||||
m.Get("/{runner_id}", reqToken(), user.GetRunner)
|
||||
m.Delete("/{runner_id}", reqToken(), user.DeleteRunner)
|
||||
m.Get("/jobs", reqToken(), user.SearchActionRunJobs)
|
||||
|
|
@ -1694,7 +1694,7 @@ func Routes() *web.Route {
|
|||
m.Combo("").
|
||||
Get(admin.ListRunners).
|
||||
Post(bind(api.RegisterRunnerOptions{}), admin.RegisterRunner)
|
||||
m.Get("/registration-token", admin.GetRunnerRegistrationToken)
|
||||
m.Get("/registration-token", admin.GetRunnerRegistrationToken) //nolint:staticcheck
|
||||
m.Get("/{runner_id}", admin.GetRunner)
|
||||
m.Delete("/{runner_id}", admin.DeleteRunner)
|
||||
m.Get("/jobs", admin.GetActionRunJobs)
|
||||
|
|
|
|||
|
|
@ -168,11 +168,17 @@ func (Action) DeleteSecret(ctx *context.APIContext) {
|
|||
ctx.Status(http.StatusNoContent)
|
||||
}
|
||||
|
||||
// GetRegistrationToken returns the organization's runner registration token
|
||||
// GetRegistrationToken returns the organization's runner registration token.
|
||||
//
|
||||
// Deprecated: This operation has been deprecated in Forgejo 15. Use the web UI or RegisterRunner instead.
|
||||
func (Action) GetRegistrationToken(ctx *context.APIContext) {
|
||||
// swagger:operation GET /orgs/{org}/actions/runners/registration-token organization orgGetRunnerRegistrationToken
|
||||
// ---
|
||||
// summary: Get the organization's runner registration token
|
||||
// description: >
|
||||
// This operation has been deprecated in Forgejo 15.
|
||||
// Use the web UI or [`/orgs/{org}/actions/runners`](#/organization/registerOrgRunner) instead.
|
||||
// deprecated: true
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
|
|
|
|||
|
|
@ -482,10 +482,16 @@ func (Action) ListVariables(ctx *context.APIContext) {
|
|||
}
|
||||
|
||||
// GetRegistrationToken returns the runner registration token to register runners for the repository
|
||||
//
|
||||
// Deprecated: This operation has been deprecated in Forgejo 15. Use the web UI or RegisterRunner instead.
|
||||
func (Action) GetRegistrationToken(ctx *context.APIContext) {
|
||||
// swagger:operation GET /repos/{owner}/{repo}/actions/runners/registration-token repository repoGetRunnerRegistrationToken
|
||||
// ---
|
||||
// summary: Get a repository's runner registration token
|
||||
// description: >
|
||||
// This operation has been deprecated in Forgejo 15.
|
||||
// Use the web UI or [`/repos/{owner}/{repo}/actions/runners`](#/repository/registerRepoRunner) instead.
|
||||
// deprecated: true
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
|
|
|
|||
|
|
@ -9,10 +9,16 @@ import (
|
|||
)
|
||||
|
||||
// GetRegistrationToken returns a token to register user-level runners
|
||||
//
|
||||
// Deprecated: This operation has been deprecated in Forgejo 15. Use the web UI or RegisterRunner instead.
|
||||
func GetRegistrationToken(ctx *context.APIContext) {
|
||||
// swagger:operation GET /user/actions/runners/registration-token user userGetRunnerRegistrationToken
|
||||
// ---
|
||||
// summary: Get the user's runner registration token
|
||||
// description: >
|
||||
// This operation has been deprecated in Forgejo 15.
|
||||
// Use the web UI or [`/user/actions/runners`](#/user/registerUserRunner) instead.
|
||||
// deprecated: true
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue