Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Proposal: Default-Roles configurable via property

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

从 src/main/java/org/ohdsi/webapi/shiro/management/AtlasSecurity.java 中硬编码的默认角色入手,并将其与现有的 security.ad.default.import.group 属性进行比较。确定提议的 security.default.roles 设置应如何应用于 OIDC 和其他认证方式,以及 OIDC roles-claim 替代方案是否属于范围之内。当无需准备数据库即可配置默认角色,并且已覆盖受支持的认证路径的行为时,即视为完成。

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

描述

Current Behavior

When Webapi is setup with e.g. OIDC and a new User signs in, it defaults to the public role. Without any preparation on the database, an admin has to set the actual roles afterwards. It would be more comfortable if the default roles could be configurable, similar to the User-Import from AD via the property security.ad.default.import.group.

The default role is hardcoded here: https://github.com/OHDSI/WebAPI/blob/3f9e90c5a62dac4557f34f85b2d0ce70d58b439d/src/main/java/org/ohdsi/webapi/shiro/management/AtlasSecurity.java#L79

Proposal

Define a new property security.default.roles, that sets the default roles:

// in AtlasSecurity.java
@Value("${security.default.roles}#{T(java.util.Set).of('public')}")
protected Set<String> defaultRoles;

This would apply to all authentications.

Alternative for OIDC

Allow to define a roles claim in the access token. By default Keycloak already sets this claim and pac4j parses it.
May add a property in webapi, that switches interpreting of the supplied roles. The huge advantage here is, that authorization can be managed by the IDP/Keycloak.

主要语言
Java
星标
153
派生
186
平均合并
2 天 12 小时
30 天内合并 PR
13

环境准备

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

从这里开始

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

OHDSI/WebAPI 的其他 Issue

查看 OHDSI/WebAPI 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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