jojo/models/auth
Mathieu Fenniak c8d24ff06a feat: enable auth to git HTTP via authorized integrations (#12715)
Allow authentication to git HTTP & git LFS via an authorized integration.

This is the first step in getting rid of OAuth, basic auth, etc.'s usage of [`isGitRawOrAttachPath(req)`](26f18a94ee/services/auth/method/basic.go (L38-L40)).  I don't want to follow that pattern of HTTP route matching in the authentication method, so I've broken the HTTP routes related to git functionality out to using a separate authentication middleware in the top-level `web.Routes` handler.  As this approach is expanded to the other endpoints in order to add support to them for authorized integrations, eventually it will be possible to remove this URL matching completely and just rely on middleware installation.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. All work and communication must conform to Forgejo's [AI Agreement](https://codeberg.org/forgejo/governance/src/branch/main/AIAgreement.md). 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

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [x] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I ran...
  - [x] `make pr-go` before pushing

### 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

- [ ] 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.
- [x] 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/12715
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2026-05-25 19:33:36 +02:00
..
TestGetRepositoriesAccessibleWithIntegration feat: add repo-specific & public-only authz reducers to authorized integrations (#12267) 2026-04-26 23:54:41 +02:00
TestGetRepositoriesAccessibleWithToken feat: backend DB model for fine-grained repo access tokens 2026-02-27 17:17:29 +01:00
TestGetRepositoriesAccessibleWithTokens feat: read, create, & delete repo-specific access tokens via API (#11504) 2026-03-07 21:55:08 +01:00
TestOrphanedOAuth2Applications test: Global OAuth should not be deleted 2024-11-23 19:49:55 +01:00
access_token.go feat: read, create, & delete repo-specific access tokens via API (#11504) 2026-03-07 21:55:08 +01:00
access_token_resource.go feat: add repo-specific & public-only authz reducers to authorized integrations (#12267) 2026-04-26 23:54:41 +02:00
access_token_resource_test.go feat: read, create, & delete repo-specific access tokens via API (#11504) 2026-03-07 21:55:08 +01:00
access_token_scope.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
access_token_scope_test.go [GITEA] silently ignore obsolete sudo scope 2024-02-05 16:05:50 +01:00
access_token_test.go feat: avoid updating all columns (#9572) 2025-10-09 13:22:29 +02:00
auth_token.go feat: persist OAuth2/OIDC sign-in via IdP re-validation (#12321) 2026-05-15 02:31:20 +02:00
authorized_integration.go feat: enable auth to git HTTP via authorized integrations (#12715) 2026-05-25 19:33:36 +02:00
authorized_integration_resource_repo.go feat: ability to edit authorized integration in web UI (#12601) 2026-05-17 18:33:39 +02:00
authorized_integration_resource_repo_test.go feat: add CLI command 'admin user create-authorized-integration' (#12299) 2026-04-28 21:32:45 +02:00
authorized_integration_test.go feat: web UI to delete authorized integration (#12632) 2026-05-19 17:10:43 +02:00
main_test.go chore: move all test blank imports in a single package (#10662) 2026-01-02 05:32:32 +01:00
oauth2.go chore: upgrade to https://code.forgejo.org/xorm/xorm v1.4.0 (#12639) 2026-05-20 20:20:08 +02:00
oauth2_list.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
oauth2_test.go 2026-05-12 security patches (#12493) 2026-05-12 04:54:25 +02:00
session.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
session_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
source.go chore: upgrade to https://code.forgejo.org/xorm/xorm v1.4.0 (#12639) 2026-05-20 20:20:08 +02:00
source_test.go chore: upgrade to https://code.forgejo.org/xorm/xorm v1.4.0 (#12639) 2026-05-20 20:20:08 +02:00
two_factor.go feat: consider WebAuthn & SSH for instance signing (#7693) 2025-04-29 10:34:07 +00:00
two_factor_test.go chore: add SQL fault injector testing (#9314) 2025-09-18 00:39:06 +02:00
twofactor.go feat: cache derived keys for faster keying (#10114) 2025-11-16 14:29:14 +01:00
webauthn.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
webauthn_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00