forgejo/services
Earl Warren 7cabc5670d
Implement remote user login source and promotion to regular user
A remote user (UserTypeRemoteUser) is a placeholder that can be
promoted to a regular user (UserTypeIndividual). It represents users
that exist somewhere else. Although the UserTypeRemoteUser already
exists in Forgejo, it is neither used or documented.

A new login type / source (Remote) is introduced and set to be the login type
of remote users.

Type        UserTypeRemoteUser
LogingType  Remote

The association between a remote user and its counterpart in another
environment (for instance another forge) is via the OAuth2 login
source:

LoginName   set to the unique identifier relative to the login source
LoginSource set to the identifier of the remote source

For instance when migrating from GitLab.com, a user can be created as
if it was authenticated using GitLab.com as an OAuth2 authentication
source.

When a user authenticates to Forejo from the same authentication
source and the identifier match, the remote user is promoted to a
regular user. For instance if 43 is the ID of the GitLab.com OAuth2
login source, 88 is the ID of the Remote loging source, and 48323
is the identifier of the foo user:

Type        UserTypeRemoteUser
LogingType  Remote
LoginName   48323
LoginSource 88
Email       (empty)
Name        foo

Will be promoted to the following when the user foo authenticates to
the Forgejo instance using GitLab.com as an OAuth2 provider. All users
with a LoginType of Remote and a LoginName of 48323 are examined. If
the LoginSource has a provider name that matches the provider name of
GitLab.com (usually just "gitlab"), it is a match and can be promoted.

The email is obtained via the OAuth2 provider and the user set to:

Type        UserTypeIndividual
LogingType  OAuth2
LoginName   48323
LoginSource 43
Email       foo@example.com
Name        foo

Note: the Remote login source is an indirection to the actual login
source, i.e. the provider string my be set to a login source that does
not exist yet.
2024-04-25 13:03:49 +02:00
..
actions Use action user as the trigger user of schedules (#30581) 2024-04-21 16:28:16 +02:00
agit Use the database object format name but not read from git repoisitory everytime and fix possible migration wrong objectformat when migrating a sha256 repository (#29294) 2024-02-26 22:30:26 +01:00
asymkey Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
attachment Add support for API blob upload of release attachments (#29507) 2024-03-06 12:10:46 +08:00
auth Implement remote user login source and promotion to regular user 2024-04-25 13:03:49 +02:00
automerge Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
context Clean up log messages (#30313) 2024-04-15 20:01:35 +02:00
contexttest add label filters in org/{org_name}/issues 2024-04-04 17:57:11 +05:30
convert [FEAT]Add Option to hide Release Archive links (#3139) 2024-04-24 15:15:55 +00:00
cron Update checker setting updates 2024-03-31 10:52:24 +05:00
doctor Count downloads for tag archives 2024-04-08 12:51:27 +02:00
externalaccount
feed
forgejo [UPGRADE] run sanity checks before the database is upgraded 2024-02-05 14:44:33 +01:00
forms [FEAT]Add Option to hide Release Archive links (#3139) 2024-04-24 15:15:55 +00:00
gitdiff [PERFORMANCE] git check-attr on bare repo if supported 2024-03-28 10:52:51 +01:00
indexer Fix missing issue search index update when changing status (#28325) 2023-12-03 12:22:44 +01:00
issue [Port] gitea#29999: Fix Add/Remove WIP on pull request title failure 2024-03-29 12:21:51 +01:00
lfs Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
mailer fix(incoming): allow replies to comments 2024-04-23 00:05:12 +02:00
markup Format code 2024-03-28 05:42:25 +01:00
migrations Change the default maxPerPage for gitbucket (#30392) 2024-04-15 20:01:36 +02:00
mirror Avoid losing token when updating mirror settings (#30429) 2024-04-15 20:01:36 +02:00
notify Clean up log messages (#30313) 2024-04-15 20:01:35 +02:00
org
packages packages: skip error logging on duplicate 2024-03-24 07:12:31 +01:00
pull Do not update PRs based on events that happened before they existed 2024-04-11 11:16:23 +02:00
release Fix release published actions not triggering for releases created from existing tags 2024-04-15 22:53:53 +02:00
remote Implement remote user login source and promotion to regular user 2024-04-25 13:03:49 +02:00
repository Allow admins to fork repos even when creation limits are exhausted (#3277) 2024-04-17 05:52:02 +00:00
secrets Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00
task Fix incorrect ctx usage in defer function (#27740) 2023-10-22 14:12:27 +00:00
uinotification
user Check the token's owner and repository when registering a runner (#30406) 2024-04-16 09:38:26 +02:00
webhook s/Gitea/Forgejo in various log messages and comments 2024-04-21 21:26:15 +05:00
wiki Clean up log messages (#30313) 2024-04-15 20:01:35 +02:00