feat: grpc tls connectivity (grpcs)#477
Conversation
…lagd into sync-provider-2
Signed-off-by: James Milligan <james@omnant.co.uk>
…lagd into sync-provider-2
Co-authored-by: Skye Gill <gill.skye95@gmail.com> Signed-off-by: James Milligan <75740990+james-milligan@users.noreply.github.com>
Signed-off-by: James Milligan <james@omnant.co.uk>
Signed-off-by: James Milligan <james@omnant.co.uk>
Signed-off-by: James Milligan <james@omnant.co.uk>
Signed-off-by: James Milligan <james@omnant.co.uk>
…lagd into sync-provider-2
Signed-off-by: James Milligan <james@omnant.co.uk>
Signed-off-by: James Milligan <james@omnant.co.uk>
Signed-off-by: James Milligan <james@omnant.co.uk>
Signed-off-by: James Milligan <james@omnant.co.uk>
Signed-off-by: James Milligan <james@omnant.co.uk>
Signed-off-by: James Milligan <james@omnant.co.uk>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
# Conflicts: # cmd/start.go # docs/configuration/configuration.md # docs/configuration/flagd_start.md # pkg/runtime/from_config.go # pkg/runtime/runtime.go # pkg/runtime/runtime_test.go # pkg/sync/file/filepath_sync.go # pkg/sync/grpc/grpc_sync.go # pkg/sync/grpc/grpc_sync_test.go # pkg/sync/http/http_sync.go # pkg/sync/isync.go # pkg/sync/kubernetes/kubernetes_sync.go
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
aed4118 to
6577362
Compare
Codecov Report
@@ Coverage Diff @@
## main #477 +/- ##
==========================================
+ Coverage 62.08% 63.39% +1.30%
==========================================
Files 15 15
Lines 1891 1923 +32
==========================================
+ Hits 1174 1219 +45
+ Misses 654 639 -15
- Partials 63 65 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
|
This can be tested using the test server [1] @Kavindu-Dodan created and generating self signed certs. Generate CA cert
Generate Server certificate
Where the file
Once certificates & keys are ready,
[1] https://github.com/Kavindu-Dodan/flagd-grpc-sync-server |
There was a problem hiding this comment.
Largely this is working, but I believe it caused a regression in our reconnect which causes flagd to crash when the server connection is lost. This tells me we need a test, e2e or otherwise, for this... I will create a new issue for that. I think the crash itself needs to be resolved in this PR though.
Additionally, grpcs:// is not really a valid scheme. I think it's fine to keep for the uri style configuration, but I think a boolean for tls might make more sense for the --sources style configuration. This more a matter of opinion though... I just feel weird about relying on a non-standard scheme wherever we don't have to.
Edit: I created this issue for testing.
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Good catch. I fixed this and added a unit test to validate this scenario I also have no hard opinion on the |
|
Confirmed reconnect works now. |
🤖 I have created a release *beep* *boop* --- ## [0.4.2](v0.4.1...v0.4.2) (2023-03-09) ### 🧹 Chore * Add targeted Flag to example config ([#467](#467)) ([6a039ce](6a039ce)) * **deps:** pin dependencies ([#473](#473)) ([679e860](679e860)) * **deps:** update google-github-actions/release-please-action digest to e0b9d18 ([#474](#474)) ([5b85b2a](5b85b2a)) * refactoring and improve coverage for K8s Sync ([#466](#466)) ([6dc441e](6dc441e)) ### 🐛 Bug Fixes * add registry login ([#476](#476)) ([99de755](99de755)) * **deps:** update module golang.org/x/crypto to v0.7.0 ([#472](#472)) ([f53f6c8](f53f6c8)) * **deps:** update module google.golang.org/protobuf to v1.29.0 ([#478](#478)) ([f9adc8e](f9adc8e)) ### ✨ New Features * grpc tls connectivity (grpcs) ([#477](#477)) ([228f430](228f430)) * introduce per-sync configurations ([#448](#448)) ([1d80039](1d80039)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
This PR
Introduce TLS connectivity for GRPC sync provider.
TLS can be enabled using schema
grpcs://. For example,./flagd start --uri grpcs://localhost:8090Further, a self-sign certificate can be provided for TLS connectivity using configuration source field
certPathex:-
./flagd start --sources='[{"uri":"grpcs://localhost:9090","provider":"grpc", "certPath":"<CA_CERT>"}]'How to test
Start mock server impl - https://github.com/Kavindu-Dodan/flagd-grpc-sync-server & then run flagd with grpc tls mode