fix: native custom CA support for Redis and MinIO#54
Merged
Conversation
|
🎉 This PR is included in version 3.3.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes native loading of custom CA certificates for Redis and MinIO/S3 TLS connections, and enables Redis authentication from individual env vars when the password comes from an external secret.
MINIO_CA_CERTSin configmap and pass it to the MinIO client via a customurllib3.PoolManager, so S3 endpoints with self-signed CAs verify correctlyssl_*kwargs with a properssl.SSLContextbuilt from the configured CA/cert/key files, fixingCERTIFICATE_VERIFY_FAILEDwith self-signed Redis CAsREDIS_HOST/REDIS_PORT/REDIS_DBin the configmap and skipREDIS_URLin the secret whenredis.hostis set withoutredis.password, so the app can build the connection URL from individual env vars + an externally-provided passwordCloses #53
Changes
Helm chart
configmap.yaml— AddedMINIO_CA_CERTS(whenminio.caCertsis set) andREDIS_HOST/REDIS_PORT/REDIS_DB(whenredis.hostis set)secret.yaml—REDIS_URLis now omitted whenredis.hostis set withoutredis.password, allowing the app to build the URL from individual env vars + externally-provided password_helpers.tpl— UpdatedneedsHelmSecretto account for whenREDIS_URLis not neededvalues.yaml— Changedredis.urldefault from"redis://redis:6379/0"to""so theredisUrlhelper falls through toredis.host/ default branches correctlyApp code
src/config/minio.py— Addedca_certsfield (MINIO_CA_CERTSenv var) and_get_http_client()that creates aurllib3.PoolManagerwith custom CA; passedhttp_clientto allMinio()constructorssrc/config/redis.py— Added_build_ssl_context()that creates anssl.SSLContextwithcafile=when custom CA is configured;get_ssl_kwargs()now returns{"ssl_context": ctx}instead of individualssl_*paramsTests
tests/unit/test_minio_config.py— 3 new tests: CA cert field loading from env,_get_http_client()with/without CAtests/unit/test_redis_config.py— 14 new tests:get_url()URL building from individual fields,get_ssl_kwargs()SSL context construction (verify modes, hostname checking, CA cert loading)Test plan
just test-unit)just lint)MINIO_CA_CERTSwhenminio.caCertsis setREDIS_HOST/REDIS_PORT/REDIS_DBwhenredis.hostis setREDIS_URLwhenredis.hostis set withoutredis.passwordREDIS_URLwhenredis.host+redis.passwordare both setREDIS_URL: redis://redis:6379/0)envblock🤖 Generated with Claude Code