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

implement NoTLS (--plaintext) support #484

Merged
merged 7 commits into from
Nov 16, 2024
Merged

implement NoTLS (--plaintext) support #484

merged 7 commits into from
Nov 16, 2024

Conversation

gertd
Copy link
Member

@gertd gertd commented Nov 14, 2024

This PR implements:

  • topaz service support for running the gRPC services without TLS
  • topaz CLI support for --plaintext

For the service part, when:

certs block entries contain empty string(s), like:

certs:
  tls_key_path: ''
  tls_cert_path: ''
  tls_ca_cert_path: ''

or
the certs block contains no entries like:

certs:

or
when no certs block is present

the gRPC service instance will start without the associated TLS credentials.

The topaz CLI add the --plaintext or -P parameter to indicate that the gRPC connection will use plain-text HTTP/2 when connecting to server (no TLS).

  -P, --plaintext                use plain-text HTTP/2 (no TLS) ($TOPAZ_PLAINTEXT)

When using grpcurl or grpcui use the -plaintext command line flag.

This PR also changes the default security mode of the health and metrics services to by default run with NoTLS.

@coveralls
Copy link

coveralls commented Nov 14, 2024

Pull Request Test Coverage Report for Build 11866052369

Details

  • 36 of 532 (6.77%) changed or added relevant lines in 32 files are covered.
  • 5 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.04%) to 8.495%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/topaz/main.go 0 1 0.0%
pkg/app/handlers/config.go 0 1 0.0%
pkg/cli/clients/directory/backup.go 0 1 0.0%
pkg/cli/clients/directory/export.go 0 1 0.0%
pkg/cli/cmd/cli.go 0 1 0.0%
pkg/cli/cmd/directory/backup.go 0 1 0.0%
pkg/cli/cmd/directory/exporter.go 0 1 0.0%
pkg/cli/cmd/directory/manifest.go 2 3 66.67%
pkg/cli/cmd/directory/restore.go 0 1 0.0%
pkg/cli/cmd/directory/stats.go 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
pkg/debug/debug.go 1 0.0%
pkg/cc/config/config.go 1 0.0%
pkg/cc/config/loader.go 3 0.0%
Totals Coverage Status
Change from base Build 11788226662: -0.04%
Covered Lines: 794
Relevant Lines: 9347

💛 - Coveralls

ensure test-snapshot produces a valid semver container tag

Revert "ensure test-snapshot produces a valid semver container tag"

This reverts commit cdcb176.

use valid semver for test image

use unique db file name for templates-no-tls

cleanup tests (testifylint)

cleanup linter issues

rm go.opencensus.io (deprecated) dependencies

update test db master

adopt [email protected] TLSConfig & [email protected]
@gertd gertd marked this pull request as ready for review November 15, 2024 05:10
internal/pkg/service/builder/service.go Show resolved Hide resolved
internal/pkg/service/builder/service_factory.go Outdated Show resolved Hide resolved
internal/pkg/service/builder/service_factory.go Outdated Show resolved Hide resolved
internal/pkg/service/builder/service_manager.go Outdated Show resolved Hide resolved
internal/pkg/service/builder/service_manager.go Outdated Show resolved Hide resolved
internal/pkg/service/builder/tls.go Outdated Show resolved Hide resolved
pkg/cli/clients/directory/client.go Show resolved Hide resolved
Copy link
Contributor

@carabasdaniel carabasdaniel left a comment

Choose a reason for hiding this comment

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

Overall looks good but if we move the service builder into internal, I think it might be possible to remove the service-host reference entirely

ronenh
ronenh previously approved these changes Nov 15, 2024
ronenh
ronenh previously approved these changes Nov 15, 2024
@gertd gertd merged commit 4f61026 into main Nov 16, 2024
6 checks passed
@gertd gertd deleted the plaintext branch November 16, 2024 01:47
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.

5 participants