Skip to content

Commit

Permalink
fix: add missing edgex/security config stem resolution in security-co…
Browse files Browse the repository at this point in the history
…nsul-bootstrapper (#4110)

Fixes: #4109

Signed-off-by: Jim Wang (Intel) <yutsung.jim.wang@intel.com>
  • Loading branch information
jim-wang-intel authored Jul 29, 2022
1 parent 4804402 commit a991377
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit a991377

Please sign in to comment.