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

feat(plugins/bk-user-restriction): add new plugin #85

Merged
merged 4 commits into from
Nov 8, 2024

Conversation

wklken
Copy link
Collaborator

@wklken wklken commented Nov 5, 2024

Description

  • add bk-user-restriction plugin

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 marked this pull request as ready for review November 6, 2024 06:36
@wklken
Copy link
Collaborator Author

wklken commented Nov 6, 2024

The pull request #85 titled "feat(plugins/bk-user-restriction): add new plugin" introduces a new plugin called bk-user-restriction.

Summary:

  • Adds the bk-user-restriction plugin.
  • Includes related unit tests.
  • Ensures code style compliance.
  • Verified in a local development environment.

The pull request contains 536 additions across 5 files and has 3 commits.

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

@wklken wklken merged commit 2c82c0e into TencentBlueKing:master Nov 8, 2024
3 checks passed
assert.is_true(core.string.find(ctx.var.bk_apigw_error.error.message, 'bk_username="unknown_user"') ~= nil)
end)

it("should allow user not in whitelist", function()
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里应该是 should allow user in whitelist

},
},
oneOf = {
{ required = { "whitelist" } },
Copy link
Collaborator

Choose a reason for hiding this comment

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

是不是应该在什么地方写插件的文档使用说明,比如我看到这就会好奇两个字段如果都配置会怎么样,理论上字段有互斥。(看了代码的写法,黑名单的优先级是更好,即使 user 命中白名单,仍然可能被黑名单拦下来)

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.

3 participants