Allow setting Store Id per request for multi tenant implementations
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- java
调研方向
首先跟踪 issue 中所示的入口点 fgaClient.check(request, options) 和 ClientCheckOptions API。确定当前如何选择已配置的 store ID,以及请求选项如何传递。完成标准是:请求可以覆盖已配置的 store ID,而不会改变共享的客户端状态,同时现有的配置行为仍然可用。
由索引模型根据 Issue 内容生成。
描述
Describe the problem you'd like to have solved
In multitenant solutions it would be nice to have a single client instance and the possibility to set the store id for each request, this way the connection pool can be reused without the need to have multiple client instances.
Describe the ideal solution
The store id should available as a client option:
var request = new ClientCheckRequest()
.user("user:81684243-9356-4421-8fbf-a4f8d36aa31b")
.relation("writer")
._object("document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a");
var options = new ClientCheckOptions()
.additionalHeaders(Map.of("Some-Http-Header", "Some value"))
// You can rely on the model id set in the configuration or override it for this specific request
.authorizationModelId("01GXSA8YR785C4FYS3C0RTG7B1")
// SET THE STORE ID PER REQUEST
.storeId("01ARZ3NDEKTSV4RRFFQ69G5FAV");
var response = fgaClient.check(request, options).get();
// response.getAllowed() = true
Alternatives and current workarounds
There are two alternatives:
- Having one client for each store id
- Explicitly calling
fgaClient.setStoreId(store.getId());on each request, but my guess is there could be race condition issues
Additional context
N/A
- 主要语言
- Java
- 星标
- 55
- 派生
- 26
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
openfga/java-sdk 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
Make client-credentials token refresh buffer and jitter configurable可能已有人在做 @dpkass 于 29 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 72/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
openfga/java-sdk#370 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
openfga/java-sdk#361 · 1 个 reaction ·
维护者通常 1 天内回复
相似的 Issue
-
[BUG] S3 CORS responses omit Access-Control-Allow-Credentials for matched origins可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
sqlcipher/sqlcipher-android#97 · 1 条评论 ·
-
area-integrations
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug IIIF interoperability
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 72/100