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

Allow setting Store Id per request for multi tenant implementations

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

首先跟踪 issue 中所示的入口点 fgaClient.check(request, options) 和 ClientCheckOptions API。确定当前如何选择已配置的 store ID,以及请求选项如何传递。完成标准是:请求可以覆盖已配置的 store ID,而不会改变共享的客户端状态,同时现有的配置行为仍然可用。

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

描述

enhancement
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:

  1. Having one client for each store id
  2. 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 模板
  • 阅读贡献指南

从这里开始

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

openfga/java-sdk 的其他 Issue

查看 openfga/java-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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