forked from gitea/gitea
1
0
Fork 0
gitea/modules
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 actions workflow branches match bug (#22724) 2023-02-02 20:40:08 +08:00
activitypub Add Chef package registry (#22554) 2023-02-06 09:49:21 +08:00
analyze
auth Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
avatar
base
cache
charset Fix line spacing for plaintext previews (#22699) 2023-02-01 22:51:02 -06:00
container
context Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
csv
doctor
emoji
eventsource
generate
git Refactor legacy strange git operations (#22756) 2023-02-06 10:23:17 +08:00
gitgraph Refactor git command package to improve security and maintainability (#22678) 2023-02-04 10:30:43 +08:00
graceful
hcaptcha
highlight
hostmatcher
html
httpcache Add some comments for recent code (#22725) 2023-02-02 11:39:38 -06:00
httplib
indexer
issue/template
json
lfs
log Improve trace logging for pulls and processes (#22633) 2023-02-03 18:11:48 -05:00
markup
mcaptcha
metrics
migration Fix restore repo bug, clarify the problem of ForeignIndex (#22776) 2023-02-07 09:18:52 +08:00
mirror
nosql
notification
options
packages Use import of OCI structs (#22765) 2023-02-06 10:07:09 +00:00
paginator
password
pprof
private
process Improve trace logging for pulls and processes (#22633) 2023-02-03 18:11:48 -05:00
proxy
proxyprotocol
public
queue
recaptcha
references Use correct captured group range when parsing cross-reference (#22672) 2023-01-31 10:08:05 +01:00
regexplru
repository Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
secret
session
setting Add Chef package registry (#22554) 2023-02-06 09:49:21 +08:00
sitemap
ssh
storage
structs 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
svg
sync
system
templates
test
timeutil
translation
turnstile Add new captcha: cloudflare turnstile (#22369) 2023-02-05 15:29:03 +08:00
typesniffer
updatechecker
upload
uri
user
util Add Chef package registry (#22554) 2023-02-06 09:49:21 +08:00
validation Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
watcher
web Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
webhook