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

Configurable Redis TLS Config through settings #289

Merged
merged 5 commits into from
Sep 9, 2021

Conversation

JavierR14
Copy link
Contributor

At the moment, the redis tls config that it's using is a default and there is no way to change it. This makes it so that clients can specify their own TLS config if they choose to.

@mattklein123
Copy link
Member

Thanks, please add documentation in the README and also check CI.

/wait

Signed-off-by: Javier Ruiz Arduengo <javier@squareup.com>
Signed-off-by: Javier Ruiz Arduengo <javier@squareup.com>
Signed-off-by: Javier Ruiz Arduengo <javier@squareup.com>
@JavierR14
Copy link
Contributor Author

JavierR14 commented Sep 8, 2021

I can't seem to get integration tests working locally even on the main branch for envoyproxy.

Signed-off-by: Javier Ruiz Arduengo <javier@squareup.com>
README.md Outdated
@@ -542,6 +542,8 @@ As well Ratelimit supports TLS connections and authentication. These can be conf
1. `REDIS_AUTH` & `REDIS_PERSECOND_AUTH`: set to `"password"` to enable authentication to the redis host.
1. `CACHE_KEY_PREFIX`: a string to prepend to all cache keys

Ratelimit also provides the ability to specify TLS settings via `RedisTlsConfig` in the [settings](https://github.com/envoyproxy/ratelimit/blob/master/src/settings/settings.go).
Copy link
Member

Choose a reason for hiding this comment

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

Sorry it's not clear to me how this is used. Does someone have to instantiate this by code? Or can this be set via env variables?

/wait

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Someone has to instantiate it by code. You shouldn't be setting a TLS config through env variables as it would require dealing with certs and key files and needs code. TLS configs should be configurable and this allows the client using ratelimit to configure it if needed.

Copy link
Member

Choose a reason for hiding this comment

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

OK, then I guess this isn't a general purpose feature so I'm not sure it's worth documenting like this. It would probably be better long term to allow the config to be read from a YAML file of some type. I would remove this from the README and put a TODO in the settings code to have that setting be out of box user configurable somehow.

/wait

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I've added a TODO line. I do think providing an out of the box user configurable setting is a good idea but ultimately will probably not be used much. Setting up a Redis TLS config will be very different from case to case and most of the time users will provide it through code.

mattklein123
mattklein123 previously approved these changes Sep 9, 2021
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

@mattklein123
Copy link
Member

Looks like it needs a format fix.

/wait

Signed-off-by: Javier Ruiz Arduengo <javier@squareup.com>
@mattklein123 mattklein123 merged commit 9c22ef4 into envoyproxy:main Sep 9, 2021
bhepburn added a commit to redhat-marketplace/ratelimit that referenced this pull request Sep 9, 2021
Signed-off-by: Javier Ruiz Arduengo <javier@squareup.com>
vsabella added a commit to vsabella/ratelimit that referenced this pull request Jan 7, 2022
vsabella added a commit to vsabella/ratelimit that referenced this pull request Jan 24, 2022
 fixes isssue envoyproxy#303

Signed-off-by: Vito Sabella <vito@axon.com>
ysawa0 pushed a commit that referenced this pull request Jan 24, 2022
* TLS config pointer is never nil, fixes regression in pull #289 fixes isssue #303

Signed-off-by: Vito Sabella <vito@axon.com>

* Accidentally put the initialization before the environment variable reading.

Signed-off-by: Vito Sabella <vito@axon.com>

* Unit test for settings tlsConfig fix

Signed-off-by: Vito Sabella <vito@axon.com>

* Fixing pre-commits

Signed-off-by: Vito Sabella <vito@axon.com>

Co-authored-by: Vito Sabella <vito@axon.com>
jdamata pushed a commit to jdamata/ratelimit that referenced this pull request Aug 20, 2022
…xy#318)

* TLS config pointer is never nil, fixes regression in pull envoyproxy#289 fixes isssue envoyproxy#303

Signed-off-by: Vito Sabella <vito@axon.com>

* Accidentally put the initialization before the environment variable reading.

Signed-off-by: Vito Sabella <vito@axon.com>

* Unit test for settings tlsConfig fix

Signed-off-by: Vito Sabella <vito@axon.com>

* Fixing pre-commits

Signed-off-by: Vito Sabella <vito@axon.com>

Co-authored-by: Vito Sabella <vito@axon.com>
Signed-off-by: Joel Damata <joel.damata94@gmail.com>
barroca pushed a commit to barroca/ratelimit that referenced this pull request Sep 1, 2023
…xy#318)

* TLS config pointer is never nil, fixes regression in pull envoyproxy#289 fixes isssue envoyproxy#303

Signed-off-by: Vito Sabella <vito@axon.com>

* Accidentally put the initialization before the environment variable reading.

Signed-off-by: Vito Sabella <vito@axon.com>

* Unit test for settings tlsConfig fix

Signed-off-by: Vito Sabella <vito@axon.com>

* Fixing pre-commits

Signed-off-by: Vito Sabella <vito@axon.com>

Co-authored-by: Vito Sabella <vito@axon.com>
timcovar pushed a commit to goatapp/ratelimit that referenced this pull request Jan 16, 2024
Signed-off-by: Javier Ruiz Arduengo <javier@squareup.com>
timcovar pushed a commit to goatapp/ratelimit that referenced this pull request Jan 16, 2024
…xy#318)

* TLS config pointer is never nil, fixes regression in pull envoyproxy#289 fixes isssue envoyproxy#303

Signed-off-by: Vito Sabella <vito@axon.com>

* Accidentally put the initialization before the environment variable reading.

Signed-off-by: Vito Sabella <vito@axon.com>

* Unit test for settings tlsConfig fix

Signed-off-by: Vito Sabella <vito@axon.com>

* Fixing pre-commits

Signed-off-by: Vito Sabella <vito@axon.com>

Co-authored-by: Vito Sabella <vito@axon.com>
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