Uh oh!
There was an error while loading. Please reload this page.
fix(storage): namespace Redis ID key - #29
Open
yangruike wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题背景
ibex 的 Redis ID 生成器目前使用全局 Key
id。当 Nightingale 使用 Redis ACL,并仅授权带命名空间的 Key,例如
n9e_*时,服务启动阶段无法访问id,并出现以下错误:id缺少明确的业务前缀,在多个应用共用 Redis 的场景下,不利于最小权限配置和 Key 管理。关联 Issue:ccfos/nightingale#3284
修改内容
idKeyid修改为n9e_ibex_idIdInit和IdGet统一使用idKeyIDINITIAL的值不变idKey修改后,
n9e_ibex_id可以被现有的n9e_*Redis ACL 规则覆盖。验证结果
gofmt -w src/storage/redis.go:通过git diff --check:通过go test ./src/storage:通过,该包当前无测试文件,编译检查成功执行
go test ./...时,项目现有的 Nightingale Router API 兼容问题导致部分包编译失败,涉及rt.Auth、rt.User、rt.Perm和rt.Bgrw。该问题与本次 Redis Key 修改无关,因此未在本 PR 中处理。