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

Make DerivedState from Configs #113

Open
mlajkim opened this issue Mar 27, 2024 · 3 comments
Open

Make DerivedState from Configs #113

mlajkim opened this issue Mar 27, 2024 · 3 comments
Labels
refactor Changes without functional changes, or api changes)

Comments

@mlajkim
Copy link
Contributor

mlajkim commented Mar 27, 2024

Current SIA v3.2 turns on/off based on given configurations, but it has the following probles:

  • Easy to make mistakes for developers
    • Let's say the following is the correct setting that makes SIA to read local instance cert
    • this.config.ProviderService === "" && this.config.CertFile === "" && this.config.KeyFile === ""
    • Developers might forget to include this.config.CertFile === "" && this.config.KeyFile === "" and only include this.config.ProviderService === ""
      • Actually happened and fixed in 27d3522
  • Hard to read
    • The following code is so vague and has no meaning.
    • this.config.ProviderService === "" && this.config.CertFile === "" && this.config.KeyFile === ""
    • if we can have a DerivedState that holds such combination, it would be much easier to read
DerivedState := func() {
  if this.config.ProviderService != "" {
    return "identityd"
  }
  if config.CertFile === "" &&config.KeyFile === ""  {
    return "readLocalFile"
  }
  return "inactive"
}()
@mlajkim mlajkim added the refactor Changes without functional changes, or api changes) label Mar 27, 2024
@mlajkim
Copy link
Contributor Author

mlajkim commented Sep 13, 2024

finish the review 2 hours before the Merge Done
(Merge Done) TODOs:

@mlajkim
Copy link
Contributor Author

mlajkim commented Sep 15, 2024

Prototype as whole: #150, and learned to separate:
- kuberenetes
- X509
- service-cert
- log fix

Grouped States (No Derived State):

  • Kubernetes
  • X509

Derived State:

  • SerivceCert

Log:
? Dont know yet

@mlajkim
Copy link
Contributor Author

mlajkim commented Sep 15, 2024

Optional TODOs:
Reorder the following based on the config/model.go:

  • athenz-sia.env
  • config/default.go
  • config.config.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Changes without functional changes, or api changes)
Projects
None yet
Development

No branches or pull requests

1 participant