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: Addressed permission error in redis v7 #4027 #4118

Merged
merged 2 commits into from
Aug 4, 2022

Conversation

drkfmorton
Copy link
Contributor

@drkfmorton drkfmorton commented Aug 4, 2022

Signed-off-by: Kyle Morton kylex.f.morton@intel.com

Closes #4027

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

New Dependency Instructions (If applicable)

Signed-off-by: Kyle Morton <kylex.f.morton@intel.com>
@drkfmorton
Copy link
Contributor Author

Testing Notes:

Unit test
image

Tested in redis v6 & v7
image
image

Copy link
Collaborator

@bnevis-i bnevis-i left a comment

Choose a reason for hiding this comment

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

Please change to allchannels

@@ -103,7 +103,7 @@ const (
aclFileConfigTemplate = "aclfile {{.ACLFilePath}}"

// aclDefaultUserTemplate is the ACL rule for "default" user
aclDefaultUserTemplate = "user {{.RedisUser}} on allkeys +@all -@dangerous #{{.Sha256RedisPwd}}"
aclDefaultUserTemplate = "user {{.RedisUser}} on allkeys &* +@all -@dangerous #{{.Sha256RedisPwd}}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
aclDefaultUserTemplate = "user {{.RedisUser}} on allkeys &* +@all -@dangerous #{{.Sha256RedisPwd}}"
aclDefaultUserTemplate = "user {{.RedisUser}} on allkeys allchannels +@all -@dangerous #{{.Sha256RedisPwd}}"

@@ -81,9 +81,9 @@ func TestGenerateACLConfig(t *testing.T) {
}

require.Equal(t, 1, len(outputlines))
require.Equal(t, fmt.Sprintf("user default on allkeys +@all -@dangerous #%x",
require.Equal(t, fmt.Sprintf("user default on allkeys &* +@all -@dangerous #%x",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
require.Equal(t, fmt.Sprintf("user default on allkeys &* +@all -@dangerous #%x",
require.Equal(t, fmt.Sprintf("user default on allkeys allchannels +@all -@dangerous #%x",

sha256.Sum256([]byte(testFakePwd))), outputlines[0])
// should not be equal if use different password
require.NotEqual(t, fmt.Sprintf("user default on allkeys +@all -@dangerous #%x",
require.NotEqual(t, fmt.Sprintf("user default on allkeys &* +@all -@dangerous #%x",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
require.NotEqual(t, fmt.Sprintf("user default on allkeys &* +@all -@dangerous #%x",
require.NotEqual(t, fmt.Sprintf("user default on allkeys allchannels +@all -@dangerous #%x",

Signed-off-by: Kyle Morton <kylex.f.morton@intel.com>
@sonarcloud
Copy link

sonarcloud bot commented Aug 4, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.5% 0.5% Duplication

@bnevis-i bnevis-i merged commit 153a892 into edgexfoundry:main Aug 4, 2022
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.

Upgrade to Redis 7
2 participants