gitea/models
KN4CK3R e8186f1c0f
Map OIDC groups to Orgs/Teams (#21441)
Fixes #19555

Test-Instructions:
https://github.com/go-gitea/gitea/pull/21441#issuecomment-1419438000

This PR implements the mapping of user groups provided by OIDC providers
to orgs teams in Gitea. The main part is a refactoring of the existing
LDAP code to make it usable from different providers.

Refactorings:
- Moved the router auth code from module to service because of import
cycles
- Changed some model methods to take a `Context` parameter
- Moved the mapping code from LDAP to a common location

I've tested it with Keycloak but other providers should work too. The
JSON mapping format is the same as for LDAP.


![grafik](https://user-images.githubusercontent.com/1666336/195634392-3fc540fc-b229-4649-99ac-91ae8e19df2d.png)

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-08 14:44:42 +08:00
..
actions Fix ref to trigger Actions (#22679) 2023-01-31 22:45:25 +00:00
activities Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986) 2023-02-06 12:09:18 -06:00
admin Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
asymkey Improve error report when user passes a private key (#22726) 2023-02-02 18:25:54 +00:00
auth Support scoped access tokens (#20908) 2023-01-17 15:46:03 -06:00
avatars Fix get system setting bug when enabled redis cache (#22295) 2023-01-02 00:06:52 +08:00
db Show all projects, not just repo projects and open/closed projects (#22640) 2023-02-04 22:35:08 +08:00
dbfs Add some comments for recent code (#22725) 2023-02-02 11:39:38 -06:00
fixtures Do not overwrite empty DefaultBranch (#22708) 2023-02-02 14:48:48 -06:00
git Add cron method to gc LFS MetaObjects (#22385) 2023-01-16 13:50:53 -06:00
issues Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986) 2023-02-06 12:09:18 -06:00
migrations Implement actions (#21937) 2023-01-31 09:45:19 +08:00
organization Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
packages Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986) 2023-02-06 12:09:18 -06:00
perm Rename almost all Ctx functions (#22071) 2022-12-10 10:46:31 +08:00
project Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986) 2023-02-06 12:09:18 -06:00
pull refactor some functions to support ctx as first parameter (#21878) 2022-12-03 10:48:26 +08:00
repo Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986) 2023-02-06 12:09:18 -06:00
secret Secrets storage with SecretKey encrypted (#22142) 2022-12-20 17:07:13 +08:00
system Set disable_gravatar/enable_federated_avatar when offline mode is true (#22479) 2023-01-17 17:00:19 +02:00
unit Repositories: by default disable all units except code and pulls on forks (#22541) 2023-02-04 14:48:38 +08:00
unittest Implement actions (#21937) 2023-01-31 09:45:19 +08:00
user Implement actions (#21937) 2023-01-31 09:45:19 +08:00
webhook Support system hook API (#14537) 2023-01-28 19:12:10 +01:00
error.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
fixture_generation.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
fixture_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
main_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
migrate_test.go Check primary keys for all tables and drop ForeignReference (#21721) 2022-12-23 19:35:43 +08:00
migrate.go Check primary keys for all tables and drop ForeignReference (#21721) 2022-12-23 19:35:43 +08:00
org_team_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
org_team.go Supports wildcard protected branch (#20825) 2023-01-16 16:00:22 +08:00
org_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
org.go refactor some functions to support ctx as first parameter (#21878) 2022-12-03 10:48:26 +08:00
repo_collaboration_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
repo_collaboration.go refactor some functions to support ctx as first parameter (#21878) 2022-12-03 10:48:26 +08:00
repo_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
repo_transfer_test.go Rename almost all Ctx functions (#22071) 2022-12-10 10:46:31 +08:00
repo_transfer.go Always reuse transaction (#22362) 2023-01-08 09:34:58 +08:00
repo.go Implement actions (#21937) 2023-01-31 09:45:19 +08:00
user.go Supports wildcard protected branch (#20825) 2023-01-16 16:00:22 +08:00