program_key authentication should become a proper client_credentials grant

未关闭
#369 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
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 小时
30 天内合并 PR
22

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

hackclub/auth 的其他 Issue

查看 hackclub/auth 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。