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:support redis username #76

Merged
merged 11 commits into from
Aug 1, 2024
Merged

Conversation

pubalokta
Copy link

@pubalokta pubalokta commented Jul 25, 2024

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

This PR adds the ability to include the username within the optional parameters of the LimitdRedis constructor to use it when connecting to a Redis Cluster.

For Standalone Redis instances, there's no need to include the username as an attribute as we support it through the connection URI.

References

Testing

  • Added specific tests for the username

  • Introduced clustered tests, which is running the same battery of tests against a clustered environment.

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@pubalokta pubalokta requested a review from a team as a code owner July 25, 2024 09:43
@pubalokta pubalokta force-pushed the feat_support_redis_username branch 7 times, most recently from 1d6a131 to 17ec892 Compare July 25, 2024 10:29
@pubalokta pubalokta force-pushed the feat_support_redis_username branch from 17ec892 to 2674ce3 Compare July 25, 2024 11:00
@pubalokta pubalokta force-pushed the feat_support_redis_username branch 9 times, most recently from 399002d to 2327b57 Compare July 25, 2024 11:36
@pubalokta pubalokta force-pushed the feat_support_redis_username branch from 2327b57 to 021dcb8 Compare July 25, 2024 11:37
@pubalokta pubalokta changed the title Feat support redis username feat:support redis username Jul 25, 2024
README.md Show resolved Hide resolved
test/client.tests.js Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@pubalokta pubalokta requested a review from a team as a code owner July 31, 2024 16:29
package.json Outdated
@@ -8,7 +8,8 @@
"url": "http://github.com/auth0/limitd-redis.git"
},
"scripts": {
"test": "trap 'docker-compose down --remove-orphans -v' EXIT; docker-compose up -d && NODE_ENV=test nyc mocha --exit"
"test-standalone": "CLUSTERED_ENV=false NODE_ENV=test nyc mocha --exit",
Copy link

Choose a reason for hiding this comment

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

I'm not a huge fan of this way of running a subset of tests.

I think a better way would be to use mocha to filter for specific test file names. Mocha accepts a glob pattern for test files.

Not tested, but something like:

Suggested change
"test-standalone": "CLUSTERED_ENV=false NODE_ENV=test nyc mocha --exit",
"test-standalone": "NODE_ENV=test nyc mocha --exit '!**/*.clustermode.tests.js,**/*.standalone.tests.js'",

Copy link
Author

Choose a reason for hiding this comment

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

Fixed. Did it a bit different but same idea. Thanks for the suggestion

LeweyM
LeweyM previously approved these changes Jul 31, 2024
Copy link

@LeweyM LeweyM left a comment

Choose a reason for hiding this comment

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

I'd prefer a different way of filtering the tests for standalone and cluster (mentioned a suggestion using mocha in a comment), but will approve to not block and leave the decision up to you 👍

@pubalokta pubalokta merged commit fcfb35d into master Aug 1, 2024
6 checks passed
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.

2 participants