-
Notifications
You must be signed in to change notification settings - Fork 695
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
Added env based support for HTTPS connection #4706
Added env based support for HTTPS connection #4706
Conversation
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
if utils.CustomTlsCert != "" && utils.TlSKey != "" { | ||
go runGrpcServerWithTLS(applicationService) | ||
} else { | ||
log.Fatalf("Failure to start chaoscenter authentication REST server due to empty TLS cert file path and TLS key path") |
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.
log.Fatalf("Failure to start chaoscenter authentication REST server due to empty TLS cert file path and TLS key path") | |
log.Fatalf("Failure to start chaoscenter authentication GRPC server due to empty TLS cert file path and TLS key path") |
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
…tmus into encryption-fixes
} | ||
|
||
if enableHTTPSConnection { | ||
if utils.CustomTlsCert != "" && utils.TlSKey != "" { |
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.
We can rename it wrt paths
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.
can you check build-pipeline / backend-checks (pull_request)
?
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
…tmus into encryption-fixes
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
log.Infof("Listening and serving gRPC on %s with TLS", utils.GrpcPort) | ||
err = grpcServer.Serve(lis) | ||
if err != nil { | ||
log.Fatalf("Failure to start litmus-portal authentication GRPC server due to %v", err) |
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.
log.Fatalf("Failure to start litmus-portal authentication GRPC server due to %v", err) | |
log.Fatalf("Failure to start chaos-center authentication GRPC server due to %v", err) |
log.Fatalf("Failure to start litmus-portal authentication server due to %s", err) | ||
} | ||
|
||
// configuration of the certificate what we want |
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.
// configuration of the certificate what we want | |
// configuring TLS config based on provided certificates & keys |
@@ -20,6 +21,7 @@ func ValidateRole(ctx context.Context, projectID string, | |||
requiredRoles, | |||
invitation) | |||
if err != nil { | |||
fmt.Println("errrrrrrrrrrrr ", err) |
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.
This can be removed or print it with logrus and make it error
level?
chaoscenter/graphql/server/server.go
Outdated
go startGRPCServer(utils.Config.RpcPort, mongodbOperator) // start GRPC serve | ||
if enableHTTPSConnection { | ||
if utils.Config.ServerTlsCertPath != "" && utils.Config.ServerTlsKeyPath != "" { | ||
go startGRPCServerWithTLS("8001", mongodbOperator) // start GRPC serve |
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.
Port is hardcoded
chaoscenter/graphql/server/server.go
Outdated
} | ||
}() | ||
if enableHTTPSConnection { | ||
// configuration of the certificate what we want |
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.
do we need log here as well same as above
log.Infof("graphql server running at https://localhost:%s", utils.Config.HttpsPort)
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
…tmus into encryption-fixes
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
…tmus into encryption-fixes
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
…ncryption-fixes
Signed-off-by: Saranya-jena <saranya.jena@harness.io>
* Added env based support for HTTPS connection Signed-off-by: Saranya-jena <saranya.jena@harness.io> * resolved review comments Signed-off-by: Saranya-jena <saranya.jena@harness.io> * updated logic Signed-off-by: Saranya-jena <saranya.jena@harness.io> * fixed importd Signed-off-by: Saranya-jena <saranya.jena@harness.io> * added helper files Signed-off-by: Saranya-jena <saranya.jena@harness.io> * resolved comments Signed-off-by: Saranya-jena <saranya.jena@harness.io> * resolved comments Signed-off-by: Saranya-jena <saranya.jena@harness.io> * Update push.yml * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * Update push.yml * updated oush.yam Signed-off-by: Saranya-jena <saranya.jena@harness.io> * updated manifest Signed-off-by: Saranya-jena <saranya.jena@harness.io> --------- Signed-off-by: Saranya-jena <saranya.jena@harness.io> Co-authored-by: Namkyu Park <53862866+namkyu1999@users.noreply.github.com> Signed-off-by: andoriyaprashant <prashantandoriya@gmail.com>
* Added env based support for HTTPS connection Signed-off-by: Saranya-jena <saranya.jena@harness.io> * resolved review comments Signed-off-by: Saranya-jena <saranya.jena@harness.io> * updated logic Signed-off-by: Saranya-jena <saranya.jena@harness.io> * fixed importd Signed-off-by: Saranya-jena <saranya.jena@harness.io> * added helper files Signed-off-by: Saranya-jena <saranya.jena@harness.io> * resolved comments Signed-off-by: Saranya-jena <saranya.jena@harness.io> * resolved comments Signed-off-by: Saranya-jena <saranya.jena@harness.io> * Update push.yml * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * Update push.yml * updated oush.yam Signed-off-by: Saranya-jena <saranya.jena@harness.io> * updated manifest Signed-off-by: Saranya-jena <saranya.jena@harness.io> --------- Signed-off-by: Saranya-jena <saranya.jena@harness.io> Co-authored-by: Namkyu Park <53862866+namkyu1999@users.noreply.github.com> Signed-off-by: andoriyaprashant <prashantandoriya@gmail.com>
* Added env based support for HTTPS connection Signed-off-by: Saranya-jena <saranya.jena@harness.io> * resolved review comments Signed-off-by: Saranya-jena <saranya.jena@harness.io> * updated logic Signed-off-by: Saranya-jena <saranya.jena@harness.io> * fixed importd Signed-off-by: Saranya-jena <saranya.jena@harness.io> * added helper files Signed-off-by: Saranya-jena <saranya.jena@harness.io> * resolved comments Signed-off-by: Saranya-jena <saranya.jena@harness.io> * resolved comments Signed-off-by: Saranya-jena <saranya.jena@harness.io> * Update push.yml * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * minor changes Signed-off-by: Saranya-jena <saranya.jena@harness.io> * Update push.yml * updated oush.yam Signed-off-by: Saranya-jena <saranya.jena@harness.io> * updated manifest Signed-off-by: Saranya-jena <saranya.jena@harness.io> --------- Signed-off-by: Saranya-jena <saranya.jena@harness.io> Co-authored-by: Namkyu Park <53862866+namkyu1999@users.noreply.github.com> Signed-off-by: sagnik3788 <116512372+sagnik3788@users.noreply.github.com>
Proposed changes
Enhanced auth and the graphql server to support both http and https and allow users to leverage either option using env.
Types of changes
What types of changes does your code introduce to Litmus? Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Dependency
Special notes for your reviewer: