program_key authentication should become a proper client_credentials grant

オープン
#369 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
ruby

調査の方向性

Start by reading API::V1::ApplicationController#authenticate! and the ident_scope behavior described in the issue. Trace how the program_key path sets authentication context and how OAuth tokens represent delegated users, then decide whether this should use a client credentials grant or a separate API surface. Done means program keys no longer bypass delegation semantics, with the intended behavior covered by tests.

索引モデルが issue の本文から書いたものです。

説明

enhancement

problem

API::V1::ApplicationController#authenticate! accepts two credential types in the same Authorization header:

  • OAuthToken — standard user-delegated access token (RS behavior)
  • Program.program_key — app-level static key, no user delegation

the program_key path sets @current_identity = nil and @current_scopes = @current_program.scopes (the app's full registered scope list). ident_scope then returns every identity that ever authorized the app — all users, all scopes, no per-user consent.

this is a client_credentials grant wearing a trenchcoat. it bypasses the delegation model entirely.

impact on DPoP/on-behalf-of

  • DPoP binds tokens to a key pair held by the presenter. a program_key is a static secret with no presenter concept.
  • on-behalf-of (RFC 8693) assumes the initial token represents a user delegation. program_key represents no user.

direction

the program_key path should become a proper client_credentials grant with its own token, or a separate API surface with explicit non-delegated semantics. the acting_as_program boolean is a code smell for what should be a distinct authentication context.

主要言語
Ruby
スター
85
フォーク
72
平均マージ
3日 12時間
マージ済み PR(30日)
22

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hackclub/auth のほかの issue

hackclub/auth の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。