-
Notifications
You must be signed in to change notification settings - Fork 72
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: add ssl support to sync service (#1479) #1501
base: main
Are you sure you want to change the base?
feat: add ssl support to sync service (#1479) #1501
Conversation
Signed-off-by: Alexandra Oberaigner <[email protected]>
ced5619
to
80ff0da
Compare
✅ Deploy Preview for polite-licorice-3db33c canceled.
|
✅ Deploy Preview for polite-licorice-3db33c canceled.
|
Signed-off-by: Alexandra Oberaigner <[email protected]>
[QUESTION] can someone help me with a maintainable solution of the certificate generation. Is it okay to run a script at the beginning of the test to generate the files (see Makefile & script)? I figured that just committing these files is not really maintainable since they expire after the on creation specified number of days. What would be good practice? |
Yep, that's fine with me, BUT: I can specify |
should we maybe use the one from the flagd-testbed also within here? |
Yep we could do that. What's the expiry on that one? |
…days expiration period (open-feature#1479) Signed-off-by: Alexandra Oberaigner <[email protected]>
I went the easy route & added a new certificate to the PR that expires in 9999 days as suggested by @toddbaert, let me know if there speaks something against it |
return | ||
} | ||
|
||
serviceClient := syncv1grpc.NewFlagSyncServiceClient(con) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[INFO] from this line on the test is the same as before
Signed-off-by: Alexandra Oberaigner <[email protected]>
ef58650
to
d97fc8d
Compare
Signed-off-by: Alexandra Oberaigner <[email protected]>
// Load server's certificate and private key | ||
serverCert, err := tls.LoadX509KeyPair(certPath, keyPath) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to load key pair from given certificate paths: '%s' and '%s'", certPath, keyPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return nil, fmt.Errorf("failed to load key pair from given certificate paths: '%s' and '%s'", certPath, keyPath) | |
return nil, fmt.Errorf("failed to load key pair from certificate paths '%s' and '%s': %w", certPath, keyPath, err) |
you could consider wrapping the error returned by LoadX509KeyPair()
to preserve the context.
@@ -30,3 +36,24 @@ func getSimpleFlagStore() (*store.Flags, []string) { | |||
|
|||
return flagStore, []string{"A", "B", "C"} | |||
} | |||
|
|||
func LoadTLSClientCredentials(certPath string) (credentials.TransportCredentials, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func LoadTLSClientCredentials(certPath string) (credentials.TransportCredentials, error) { | |
func loadTLSClientCredentials(certPath string) (credentials.TransportCredentials, error) { |
@@ -0,0 +1 @@ | |||
subjectAltName=IP:0.0.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: missing new line
|
||
func LoadTLSClientCredentials(certPath string) (credentials.TransportCredentials, error) { | ||
// Load certificate of the CA who signed server's certificate | ||
pemServerCA, err := ioutil.ReadFile(certPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pemServerCA, err := ioutil.ReadFile(certPath) | |
pemServerCA, err := os.ReadFile(certPath) |
This PR
Adds SSL support to the flagd sync service
Related Issues
Fixes #1479
How to test
run
make test-flagd