gitea/modules/structs
M Hickford 191a74d622
Record OAuth client type at registration (#21316)
The OAuth spec [defines two types of
client](https://datatracker.ietf.org/doc/html/rfc6749#section-2.1),
confidential and public. Previously Gitea assumed all clients to be
confidential.

> OAuth defines two client types, based on their ability to authenticate
securely with the authorization server (i.e., ability to
>   maintain the confidentiality of their client credentials):
>
>   confidential
> Clients capable of maintaining the confidentiality of their
credentials (e.g., client implemented on a secure server with
> restricted access to the client credentials), or capable of secure
client authentication using other means.
>
>   **public
> Clients incapable of maintaining the confidentiality of their
credentials (e.g., clients executing on the device used by the resource
owner, such as an installed native application or a web browser-based
application), and incapable of secure client authentication via any
other means.**
>
> The client type designation is based on the authorization server's
definition of secure authentication and its acceptable exposure levels
of client credentials. The authorization server SHOULD NOT make
assumptions about the client type.

 https://datatracker.ietf.org/doc/html/rfc8252#section-8.4

> Authorization servers MUST record the client type in the client
registration details in order to identify and process requests
accordingly.

Require PKCE for public clients:
https://datatracker.ietf.org/doc/html/rfc8252#section-8.1

> Authorization servers SHOULD reject authorization requests from native
apps that don't use PKCE by returning an error message

Fixes #21299

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-10-24 15:59:24 +08:00
..
activitypub.go User keypairs and HTTP signatures for ActivityPub federation using go-ap (#19133) 2022-06-19 07:25:12 +02:00
admin_user.go Respect DefaultUserIsRestricted system default when creating new user (#19310) 2022-04-29 15:38:11 -04:00
attachment.go
commit_status.go
cron.go
doc.go
fork.go
git_blob.go
git_hook.go
hook.go Display total commit count in hook message (#21400) 2022-10-17 00:22:34 +08:00
issue.go Support Issue forms and PR forms (#20987) 2022-09-02 15:58:49 +08:00
issue_comment.go Add API to get issue/pull comments and events (timeline) (#17403) 2022-01-01 22:12:25 +08:00
issue_label.go
issue_milestone.go
issue_reaction.go
issue_stopwatch.go
issue_tracked_time.go
lfs_lock.go
mirror.go Add new API endpoints for push mirrors management (#19841) 2022-07-30 18:45:59 +02:00
miscellaneous.go
nodeinfo.go
notifications.go
org.go Add name field for org api (#21270) 2022-09-29 05:27:33 +02:00
org_member.go
org_team.go Fix typo in API comment document (#21347) 2022-10-05 21:26:34 +01:00
org_type.go Add more linters to improve code readability (#19989) 2022-06-20 12:02:49 +02:00
package.go Add Package Registry (#16510) 2022-03-30 16:42:47 +08:00
pull.go Add API endpoint to get changed files of a PR (#21177) 2022-09-29 04:27:20 +02:00
pull_review.go Dismiss prior pull reviews if done via web in review dismiss (#20197) 2022-07-19 15:20:28 +02:00
release.go
repo.go Make external issue tracker regexp configurable via API (#21338) 2022-10-07 20:49:30 +08:00
repo_branch.go
repo_collaborator.go Add API to query collaborators permission for a repository (#18761) 2022-04-29 14:24:38 +02:00
repo_commit.go More commit info from API (#19252) 2022-03-29 10:47:44 -05:00
repo_file.go Add latest commit's SHA to content response (#20398) 2022-07-30 16:09:04 +08:00
repo_key.go
repo_note.go
repo_refs.go
repo_tag.go
repo_topic.go
repo_tree.go
repo_watch.go
repo_wiki.go
settings.go
status.go
task.go
user.go Include login_name in adminCreateUser response (#20283) 2022-07-15 16:52:11 +08:00
user_app.go Record OAuth client type at registration (#21316) 2022-10-24 15:59:24 +08:00
user_email.go
user_gpgkey.go
user_key.go