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

Add support for Redis with custom CA. #309

Merged
merged 5 commits into from
Nov 12, 2019

Conversation

thereallukl
Copy link
Contributor

@thereallukl thereallukl commented Nov 8, 2019

Description

This PR adds support for custom CA for connecting to Redis cache.

Motivation and Context

When running clusters with custom CA for issuing internal certificates redis certificate has to be added to oauth2_proxy, so it can connect to cache.

How Has This Been Tested?

Oauth2_proxy configured to connect to redis configured with custom ca.

Checklist:

  • My change requires a change to the documentation or CHANGELOG.
  • I have updated the documentation/CHANGELOG accordingly.
  • I have created a feature (non-master) branch for my PR.

@thereallukl thereallukl requested a review from a team November 8, 2019 09:50
Copy link
Contributor

@loshz loshz left a comment

Choose a reason for hiding this comment

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

Changes look sensible to me. One small nit and it should be good to merge.

pkg/sessions/redis/redis_store.go Outdated Show resolved Hide resolved
@loshz
Copy link
Contributor

loshz commented Nov 9, 2019

Could you also add an entry to the CHANGELOG please.

@thereallukl thereallukl requested review from loshz and removed request for a team November 9, 2019 13:12
@loshz loshz requested a review from JoelSpeed November 9, 2019 22:09
loshz
loshz previously approved these changes Nov 9, 2019
Copy link
Contributor

@loshz loshz left a comment

Choose a reason for hiding this comment

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

Thank you and congrats on your first contribution! 🎉

main.go Outdated Show resolved Hide resolved
}

if opts.RedisCAPath != "" {
rootCAs, _ := x509.SystemCertPool()
Copy link
Member

Choose a reason for hiding this comment

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

Why not read the error here? I am generally against ignoring errors from external packages

Co-Authored-By: Joel Speed <Joel.speed@hotmail.co.uk>
@@ -27,4 +27,6 @@ type RedisStoreOptions struct {
UseSentinel bool `flag:"redis-use-sentinel" cfg:"redis_use_sentinel" env:"OAUTH2_PROXY_REDIS_USE_SENTINEL"`
SentinelMasterName string `flag:"redis-sentinel-master-name" cfg:"redis_sentinel_master_name" env:"OAUTH2_PROXY_REDIS_SENTINEL_MASTER_NAME"`
SentinelConnectionURLs []string `flag:"redis-sentinel-connection-urls" cfg:"redis_sentinel_connection_urls" env:"OAUTH2_PROXY_REDIS_SENTINEL_CONNECTION_URLS"`
RedisCAPath string `flag:"redis-ca-path" cfg:"redis_ca_path" env:"OAUTH2_PROXY_REDIS_CA_PATH"`
RedisInsecureTLS bool `flag:"redis-insecure-tls" cfg:"redis_insecure_tls" env:"OAUTH2_PROXY_REDIS_INSECURE_TLS"`
Copy link
Member

Choose a reason for hiding this comment

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

I had left a comment here, could I just get an ack that you saw it before I approve this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Your comment was about main.go, although you're right that both files should match :). Now it's fixed in here as well.

Copy link
Member

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

Perfect! Thank you for changing that up, you are right, my comment was in the wrong place 🤦‍♂

I'm happy to merge now 😄 Thanks for your work on this @lleszczu

@JoelSpeed JoelSpeed merged commit 9f920b0 into oauth2-proxy:master Nov 12, 2019
Jing-ze pushed a commit to Jing-ze/oauth2-proxy that referenced this pull request Nov 19, 2024
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.

3 participants