This repository was archived by the owner on Apr 6, 2026. It is now read-only.
CERTS-176 - Provide a way to fetch a new OpenBao secret when the old one expires#198
Merged
Conversation
SammyOina
suggested changes
Jan 15, 2026
| AM_CERTS_DB_SSL_ROOT_CERT= | ||
| AM_CERTS_DB_MAX_CONNECTIONS=100 | ||
| AM_CERTS_HTTP_HOST=certs | ||
| AM_CERTS_HTTP_HOST=0.0.0.0 |
Contributor
There was a problem hiding this comment.
keeping it as certs is fine
SammyOina
previously approved these changes
Jan 15, 2026
dborovcanin
suggested changes
Jan 15, 2026
| OpenBaoServiceToken string `env:"AM_CERTS_SERVICE_TOKEN" envDefault:""` | ||
| ServiceTokenPath string `env:"AM_CERTS_SERVICE_TOKEN_PATH" envDefault:""` | ||
| SecretIDPath string `env:"AM_CERTS_SECRET_ID_PATH" envDefault:""` | ||
| SecretRefreshBuffer string `env:"AM_CERTS_SECRET_REFRESH_BUFFER" envDefault:"24h"` |
Contributor
There was a problem hiding this comment.
Buffer is an inconvenient name for something that represents duration.
| secret *api.Secret | ||
| logger *slog.Logger | ||
| serviceToken string | ||
| refreshBuffer time.Duration |
Contributor
There was a problem hiding this comment.
Same, use refreshBufferTTL.
Contributor
Author
There was a problem hiding this comment.
@dborovcanin What about renewThreshold since it is not TTL
| continue | ||
| } | ||
|
|
||
| timeUntilExpiry := time.Until(createdAt.Add(ttl)) |
Contributor
There was a problem hiding this comment.
Extract createdAt.Add(ttl) to a var; it it's potentially used later in logging.
| timeUntilExpiry := time.Until(createdAt.Add(ttl)) | ||
|
|
||
| if timeUntilExpiry <= agent.refreshBuffer { | ||
| agent.logger.Warn("Secret ID approaching expiration", "time_until_expiry", timeUntilExpiry, "refresh_buffer", agent.refreshBuffer, "expiry_time", createdAt.Add(ttl)) |
Contributor
There was a problem hiding this comment.
"Secret ID approaching expiration and will be renewed" or something like this - it's more informative that renewal starts immediately.
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
arvindh123
suggested changes
Jan 19, 2026
Comment on lines
67
to
79
| OpenBaoHost string `env:"AM_CERTS_OPENBAO_HOST" envDefault:"http://localhost:8200"` | ||
| OpenBaoAppRole string `env:"AM_CERTS_OPENBAO_APP_ROLE" envDefault:""` | ||
| OpenBaoAppSecret string `env:"AM_CERTS_OPENBAO_APP_SECRET" envDefault:""` | ||
| OpenBaoNamespace string `env:"AM_CERTS_OPENBAO_NAMESPACE" envDefault:""` | ||
| OpenBaoPKIPath string `env:"AM_CERTS_OPENBAO_PKI_PATH" envDefault:"pki"` | ||
| OpenBaoRole string `env:"AM_CERTS_OPENBAO_ROLE" envDefault:"certs"` | ||
| OpenBaoServiceToken string `env:"AM_CERTS_SERVICE_TOKEN" envDefault:""` | ||
| ServiceTokenPath string `env:"AM_CERTS_SERVICE_TOKEN_PATH" envDefault:""` | ||
| SecretIDPath string `env:"AM_CERTS_SECRET_ID_PATH" envDefault:""` | ||
| SecretRenewThreshold string `env:"AM_CERTS_SECRET_RENEW_THRESHOLD" envDefault:"24h"` | ||
| SecretIDTTL string `env:"AM_CERTS_OPENBAO_SECRET_ID_TTL" envDefault:"72h"` | ||
| SecretCheckInterval string `env:"AM_CERTS_SECRET_CHECK_INTERVAL" envDefault:"30s"` | ||
| } |
There was a problem hiding this comment.
spacing between env and envDefault is not same.
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
arvindh123
approved these changes
Jan 19, 2026
nyagamunene
added a commit
to nyagamunene/certs
that referenced
this pull request
Mar 12, 2026
…one expires (absmach#198) * initial commit Signed-off-by: nyagamunene <stevenyaga2014@gmail.com> * fix failing linter Signed-off-by: nyagamunene <stevenyaga2014@gmail.com> * address comments Signed-off-by: nyagamunene <stevenyaga2014@gmail.com> * address comments Signed-off-by: nyagamunene <stevenyaga2014@gmail.com> * fix failing linter Signed-off-by: nyagamunene <stevenyaga2014@gmail.com> * fix spacing Signed-off-by: nyagamunene <stevenyaga2014@gmail.com> --------- Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
What does this do?
Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
Did you document any new/modified features?
Notes