forgejo/models/repo
Mathieu Fenniak 35b872f383 feat(ui): create repo-specific access tokens (#11696)
Adds a user interface for creating repo-specific access tokens (#11311).  When the new option "Specific repositories" is selected, a search option appears.  Each repository in the search result has an "Add" button to include it on the access token, and once included, a repository can be removed with the "Remove" button.  This is a JS-free form.

## 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...
  - [x] 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

- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [x] 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)).
    - Technically there are no "JavaScript changes" in this PR, but e2e tests were added for browser interaction testing.

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
    - TODO: planning to create documentation in https://forgejo.org/docs/next/user/token-scope/; there is none for public only tokens but I think this seems like a good place to add both.
- [ ] 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.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11696
Reviewed-by: Andreas Ahlenstorf <aahlenst@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2026-03-23 15:29:08 +01:00
..
fixtures/TestFindRepoAttachmentsByUUID chore: add unit test 2026-03-06 11:21:07 -07:00
TestGetUserForkLax fix: reduce deadlocks merging PRs by using caching for repo issue count stats (#9922) 2025-10-31 23:50:05 +01:00
TestGetUserForkLaxWithTwoChoices fix: reduce deadlocks merging PRs by using caching for repo issue count stats (#9922) 2025-10-31 23:50:05 +01:00
TestSearchRepositoryIDsByCondition fix: reduce deadlocks merging PRs by using caching for repo issue count stats (#9922) 2025-10-31 23:50:05 +01:00
archive_download_count.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
archive_download_count_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
archiver.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
attachment.go fix: check that attachments belong to correct resource 2026-03-06 11:21:07 -07:00
attachment_test.go chore: add unit test 2026-03-06 11:21:07 -07:00
authz.go refactor: split AuthorizationReducer into a base RepositoryAuthorizationReducer interface 2026-03-01 17:05:53 +01:00
avatar.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
collaboration.go feat: add foreign keys to table collaboration (#9724) 2025-10-18 02:50:50 +02:00
collaboration_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
following_repo.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
following_repo_test.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
fork.go feat: allow PRs between common forks of the same base repository (#9045) 2025-10-01 04:58:12 +02:00
fork_test.go feat: allow PRs between common forks of the same base repository (#9045) 2025-10-01 04:58:12 +02:00
git.go feat: introduce global merge message templates (#8347) 2025-07-12 16:00:42 +02:00
issue.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
language_stats.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
language_stats_test.go chore: remove usages of sort.Sort (#6689) 2025-01-26 13:30:00 +00:00
main_test.go chore: move all test blank imports in a single package (#10662) 2026-01-02 05:32:32 +01:00
mirror.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
moderation.go feat: render a link to poster profile next to the ID within shadow copy details (#10194) 2025-12-09 15:19:10 +01:00
moderation_test.go feat: Admin interface for abuse reports (#7905) 2025-07-23 00:20:15 +02:00
pushmirror.go feat: cache derived keys for faster keying (#10114) 2025-11-16 14:29:14 +01:00
pushmirror_test.go feat: add configuration to only push mirror selected branches (#7823) 2025-07-12 00:39:35 +02:00
redirect.go fix: do permission check for repository redirect 2025-08-30 09:37:34 +02:00
redirect_test.go fix: do permission check for repository redirect 2025-08-30 09:37:34 +02:00
release.go fix: check that attachments belong to correct resource 2026-03-06 11:21:07 -07:00
release_list.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
release_list_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
release_test.go feat: add tag label to commit list view (#8759) 2025-08-06 14:47:51 +02:00
repo.go feat(ui): display repositories accessible by repo-specific access tokens (#11604) 2026-03-12 16:06:38 +01:00
repo_flags.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo_flags_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo_indexer.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo_list.go feat(ui): create repo-specific access tokens (#11696) 2026-03-23 15:29:08 +01:00
repo_list_test.go feat(ui): create repo-specific access tokens (#11696) 2026-03-23 15:29:08 +01:00
repo_repository.go fix: assorted ActivityPub code only refactors (#8708) 2025-07-28 15:17:29 +02:00
repo_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
repo_unit.go fix: a corrupted Forgejo Actions scheduled workflow is disabled (#8942) 2025-08-18 22:45:10 +02:00
repo_unit_test.go fix: corrupted wiki unit default permission (#8234 follow-up) (#8258) 2025-07-07 18:04:00 +02:00
search.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
star.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
star_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
topic.go chore(api): update swagger method descripitons (#8728) 2025-07-30 18:08:28 +02:00
topic_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
update.go chore: remove redundant code (#9378) 2025-09-22 09:18:19 +02:00
update_test.go chore: remove redundant code (#9378) 2025-09-22 09:18:19 +02:00
upload.go feat: Drag and drop nested directories (#6687) 2025-10-03 00:16:40 +02:00
user_repo.go feat: implement fine-grained access tokens in /user/subscriptions & /users/{username}/subscriptions 2026-03-01 17:05:53 +01:00
user_repo_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
watch.go fix: decrease watch count when blocking user (#10882) 2026-01-26 22:58:22 +01:00
watch_test.go chore: remove dead code in WatchIfAuto and general model documentation (#10880) 2026-01-26 12:03:08 +01:00
wiki.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
wiki_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00