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: limit-count plugin supports username and ssl for redis policy #9185

Merged
merged 12 commits into from
Apr 20, 2023

Conversation

simon-flury
Copy link
Contributor

@simon-flury simon-flury commented Mar 28, 2023

Description

I want to use username and SSL to connect the plugin limit-count to a Redis instance with policy 'Redis'.

  • For Username, it looks like possible to indicate it at line 56 of file apisix/plugins/limit-count/limit-count-redis.lua.
  • For SSL, it looks like possible to add optional parameters when it connects to Redis at line 47 of file apisix/plugins/limit-count/limit-count-redis.lua.

Fixes #9175

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@monkeyDluffy6017
Copy link
Contributor

Hi @simon-flury, Test cases are needed

@simon-flury
Copy link
Contributor Author

Hi @monkeyDluffy6017, i add tests, thks

@monkeyDluffy6017
Copy link
Contributor

@soulbird @leslie-tsang @kingluo please help to review this PR

ssl_verify = conf.redis_ssl_verify
}

local ok, err = red:connect(conf.redis_host, conf.redis_port or 6379, sock_opts)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
local ok, err = red:connect(conf.redis_host, conf.redis_port or 6379, sock_opts)
local ok, err = red:connect(conf.redis_host, conf.redis_port, sock_opts)

It seems that we don't need a default value because it is already defined in the schema.

@monkeyDluffy6017 monkeyDluffy6017 merged commit 41dc764 into apache:master Apr 20, 2023
@simon-flury
Copy link
Contributor Author

simon-flury commented Apr 27, 2023 via email

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.

feat: As a user, I want to use username and SSL to connect the plugin limit-count to a Redis instance
5 participants