fix(observ): Address the observability review follow-ups#178
Merged
Conversation
Notification targets no longer expose their credentials. A target's URL carries its secret inline (an SMTP password, a webhook token), and it was returned in full by the settings API and written to a world-readable file. The URL is now masked in API responses and the file is owner-only, and saving a target back with a masked URL keeps the stored secret rather than overwriting it. The health watcher no longer blocks health reads while it restarts a container: the restart, a blocking operation, now runs without the lock that those reads need. Turning auto-restart on or off now works from an assistant session that is not scoped to a single deployment. It is a host-wide setting, so it is gated on permission to change settings instead of demanding a deployment it cannot name.
Code Review SummaryThis PR successfully addresses non-blocking follow-up items from the observability review. It introduces critical security improvements for credential handling and enhances the responsiveness of the health monitoring system. 🚀 Key Improvements
💡 Minor Suggestions
|
| for _, t := range stored.Targets { | ||
| byID[t.ID] = t.URL | ||
| } | ||
| for i := range cfg.Targets { |
There was a problem hiding this comment.
When restoring a masked URL, if the provided target ID is not found in the existing configuration, the URL will be silently set to an empty string due to how Go map lookups work. Explicitly checking for the ID's existence before restoring would prevent accidentally clearing the URL if an invalid ID is provided with a masked constant.
Suggested change
| for i := range cfg.Targets { | |
| for i, t := range cfg.Targets { | |
| if t.URL == MaskedURL { | |
| if orig, ok := byID[t.ID]; ok { | |
| cfg.Targets[i].URL = orig | |
| } | |
| } | |
| } |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Notification targets no longer expose their credentials. A target's URL carries its secret inline (an SMTP password, a webhook token), and it was returned in full by the settings API and written to a world-readable file. The URL is now masked in API responses and the file is owner-only, and saving a target back with a masked URL keeps the stored secret rather than overwriting it.
The health watcher no longer blocks health reads while it restarts a container: the restart, a blocking operation, now runs without the lock that those reads need.
Turning auto-restart on or off now works from an assistant session that is not scoped to a single deployment. It is a host-wide setting, so it is gated on permission to change settings instead of demanding a deployment it cannot name.
These are the non-blocking follow-ups from the #148 review.