relax portal gate to grant-holding admins; student audit access on development only (2026-11-17 ruling)

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python

调研方向

Read docs/environment-access-policy.md and docs/audit-tracing.md first, then trace the portal gate and the can_manage_keys check to identify their entry points. The issue describes a grants existence check and environment-specific AUDIT_ADMINS configuration; verify both environments and the acceptance cases, including that key management stays superadmin-only.

由索引模型根据 Issue 内容生成。

描述

Ruling being implemented (2026-11-17)

Recorded on campus#1129 (closed) and encoded in docs/environment-access-policy.md on campus#1120:

  1. Relax the portal gate: any account holding one or more access grants may use campus-admin — instead of the current campus-admin-circle/superadmin-only membership. The campus#883 grants store (GET /auth/v1/grants, the "who can administer what" matrix) is the gate source: signed-in user has ≥ 1 grant row → portal access. Fail-closed like the current gate.
  2. Student audit access is development-only: students may use the audit views/queries on the development environment; the production audit trail stays superadmin/admin-only (AUDIT_ADMINS on prod unchanged).

Implementation sketch

  • Portal gate: replace the circle-membership check with a grants-existence check (a cheap "any grant row where grantee matches the signed-in user" query against the auth service).
  • Audit views keep gating on AUDIT_ADMINS per environment (that var lives on the portal deployment and must be present at portal start — see campus docs/audit-tracing.md "Browser access"): seed the dev portal's AUDIT_ADMINS with the students who should get dev audit access; leave prod as the superadmin list. No code change needed for this half.
  • can_manage_keys stays superadmin-only in both environments regardless of the gate relaxation — key management never opens to students.
  • Verify the two environments actually diverge: dev portal redeploy with the student-inclusive list, prod untouched; smoke on both.

Acceptance

  • A grant-holder who is not in the campus-admin circle can sign into the portal.
  • A student on the dev portal can open audit views; the same account cannot open them on prod (403/redirect).
  • Key management (can_manage_keys) remains superadmin-only on dev and prod.
主要语言
Python
星标
0
派生
0
平均合并
13 分钟
30 天内合并 PR
62

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

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

从这里开始

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

nyjc-computing/campus-admin 的其他 Issue

查看 nyjc-computing/campus-admin 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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