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

fix: TLS and extend FileServer OpenAPI #124

Merged
merged 2 commits into from
May 9, 2024
Merged

fix: TLS and extend FileServer OpenAPI #124

merged 2 commits into from
May 9, 2024

Conversation

EnriqueL8
Copy link
Contributor

  • Enable TLS on the HTTP Server correctly
  • Nest FileServer OpenAPI under /api/*filepath
  • Add JSON OpenAPI version
  • Update the mocks to fix

@EnriqueL8 EnriqueL8 force-pushed the fixes branch 2 times, most recently from 39c988c to dafe33a Compare May 3, 2024 15:34
- Enable TLS on the HTTP Server correctly
- Nest FileServer OpenAPI under /api/*filepath
- Add JSON OpenAPI version
- Update the mocks to fix

Signed-off-by: Enrique Lacal <[email protected]>
Signed-off-by: Enrique Lacal <[email protected]>
if tlsConfig != nil {
// Under the covers it will use g.srv.TLSConfig
// If the cert and key file are not present, it will use the CA from the TLSConfig
err = g.srv.ListenAndServeTLS(g.config.HTTP.TLS.ClientCertsFile, g.config.HTTP.TLS.ClientKeyFile)
Copy link
Contributor

Choose a reason for hiding this comment

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

The ClientCertsFile and ClientKeyFile are for the Kafka client component. To collect configurations for the server cert and key files, we should define new config properties. Maybe call them config.HTTP.TLS.ServerCertsFile and config.HTTP.TLS.ServerKeyFile, with the JSON property names accordingly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This configuration is under the HTTP section already , we have a separate configuration for Kafka here

cmd.Flags().StringVarP(&conf.Kafka.TLS.ClientCertsFile, "tls-clientcerts", "c", "", "Client certificate file, for mutual TLS auth with the Kafka endpoint")
_ = viper.BindPFlag("kafka.tls.clientCertsFile", cmd.Flags().Lookup("tls-clientcerts"))
cmd.Flags().StringVarP(&conf.Kafka.TLS.ClientKeyFile, "tls-clientkey", "k", "", "Client private key file, for mutual TLS auth with the Kafka endpoint")
_ = viper.BindPFlag("kafka.tls.clientKeyFile", cmd.Flags().Lookup("tls-clientkey"))
cmd.Flags().StringVarP(&conf.Kafka.TLS.CACertsFile, "tls-cacerts", "a", "", "CA certificates file (or host CAs will be used) when connecting with the Kafka endpoint")

@EnriqueL8 EnriqueL8 merged commit 9578869 into main May 9, 2024
3 checks passed
@EnriqueL8 EnriqueL8 deleted the fixes branch May 9, 2024 10:54
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.

2 participants