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

fix: add missing edgex/security config stem resolution in security-consul-bootstrapper #4110

Merged
merged 1 commit into from
Jul 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions internal/security/bootstrapper/command/setupacl/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ func (c *cmd) createEdgeXACLTokenRoles(bootstrapACLTokenID, secretstoreToken str
}

// getKeyPrefix get the consul ACL key prefix for the service with the input roleName, ie. the service key-based
// Currently we support 2 types of custom services: app and device services
// if the input role name does not fall into the above two types, then it is categorized into core type for the key prefix
// Currently we support 3 types of services: app services, device services, and security services
// if the input role name does not fall into the above types, then it is categorized into core type for the key prefix
func (c *cmd) getKeyPrefix(roleName string) string {
if strings.HasPrefix(roleName, "app-") {
return internal.ConfigStemApp + baseBootStrapConfig.ConfigVersion + "/" + roleName
Expand All @@ -312,6 +312,10 @@ func (c *cmd) getKeyPrefix(roleName string) string {
return internal.ConfigStemDevice + baseBootStrapConfig.ConfigVersion + "/" + roleName
}

if strings.HasPrefix(roleName, "security-") {
return internal.ConfigStemSecurity + baseBootStrapConfig.ConfigVersion + "/" + roleName
}

// anything else falls into the 3rd category: core bucket
return internal.ConfigStemCore + baseBootStrapConfig.ConfigVersion + "/" + roleName
}
Expand Down