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

Feature: Restructure Configuration for Manager and Agent Services #209

Open
6 tasks
SammyOina opened this issue Aug 19, 2024 · 1 comment
Open
6 tasks
Assignees

Comments

@SammyOina
Copy link
Contributor

SammyOina commented Aug 19, 2024

Is your feature request related to a problem? Please describe.

Background

We currently have two configuration structures for our manager and agent services. Both services share the same gRPC server and client library code, but attested TLS should only be usable for the agent service.

Current Configuration Structures

Client Config

type Config struct {
	ClientCert   string        `env:"CLIENT_CERT"     envDefault:""`
	ClientKey    string        `env:"CLIENT_KEY"      envDefault:""`
	ServerCAFile string        `env:"SERVER_CA_CERTS" envDefault:""`
	URL          string        `env:"URL"             envDefault:"localhost:7001"`
	Timeout      time.Duration `env:"TIMEOUT"         envDefault:"60s"`
	AttestedTLS  bool          `env:"ATTESTED_TLS"    envDefault:"false"`
	Manifest     string        `env:"MANIFEST"        envDefault:""`
}

Server Config

type Config struct {
	Host         string `env:"HOST"               envDefault:""`
	Port         string `env:"PORT"               envDefault:""`
	CertFile     string `env:"SERVER_CERT"        envDefault:""`
	KeyFile      string `env:"SERVER_KEY"         envDefault:""`
	ServerCAFile string `env:"SERVER_CA_CERTS"    envDefault:""`
	ClientCAFile string `env:"CLIENT_CA_CERTS"    envDefault:""`
	AttestedTLS  bool   `env:"ATTESTED_TLS"       envDefault:"false"`
}

Proposed Changes

  1. Create a base configuration structure for common fields.
  2. Create separate structures for manager-specific and agent-specific configurations.
  3. Embed the base configuration in both manager and agent configurations.
  4. Move TLS-related fields to the agent configuration only.

Benefits

  • Clear separation of concerns between manager and agent configurations.
  • attested TLS-related fields are explicitly only available for the agent service.
  • Shared fields are centralized in the BaseConfig, reducing duplication.
  • Easier to maintain and extend in the future.

Tasks

  • Implement the new configuration structures
  • Update the manager service to use ManagerConfig
  • Update the agent service to use AgentConfig
  • Adjust any code that relies on the old configuration structures
  • Update documentation to reflect the new configuration structure
  • Add tests to ensure proper functioning with the new configuration

Indicate the importance of this feature to you.

Must-have

Anything else?

No response

@dborovcanin
Copy link
Contributor

@FilipCivljak What's the status with this one?

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

No branches or pull requests

5 participants