Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tenant verify and validate plugins #93

Merged
merged 10 commits into from
Dec 18, 2024

Conversation

wklken
Copy link
Collaborator

@wklken wklken commented Dec 12, 2024

Description

  • component bklogin: update to new api
  • plugin bk-tenant-verify: get tenant info of app/user
    • bkauth: get app info, with lrucache/retry/fallback
    • bkuser: get user info, with lrucache/retry/fallback
  • plugin bk-tenant-validate: validate the requests, cross-tenant calls are not allowed.
  • refactor: bk-components/*.lua

思路:

  • bk-tenant-verify: 根据上下文,获取 app_tenant_mode/app_tenant_id/user_tenant_id 放入上下文
  • bk-tenant-validate: 根据 配置中的 gateway tenant_mode/tenant_id, 结合 app_tenant_mode/app_tenant_id/user_tenant_id 进行校验,禁止跨租户调用行为

Checklist

  • 填写 PR 描述及相关 issue (write PR description and related issue)
  • 代码风格检查通过 (code style check passed)
  • PR 中包含单元测试 (include unit test)
  • 单元测试通过 (unit test passed)
  • 本地开发联调环境验证通过 (local development environment verification passed)

@wklken wklken requested a review from Han-Ya-Jun December 16, 2024 09:47
Copy link
Member

@Han-Ya-Jun Han-Ya-Jun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

.github/workflows/apisix.yml Show resolved Hide resolved
@wklken wklken merged commit 81dd05b into TencentBlueKing:ft_tenant Dec 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants