diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-12-09 08:04:24 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-09 08:04:24 -0600 |
| commit | 24ce3f1b74a26b04dd96be62c07d25da0158df0b (patch) | |
| tree | 216be0fbdfdab5728cfcd14101cb85de39a4c3f1 /src/slskd/Core/API | |
| parent | ec60cfbd397badca9a76d3923c653ad7cb6561c5 (diff) | |
| parent | 2262e842f42ccef7f557cee4f7e05c9adf15b739 (diff) | |
| download | slskd-24ce3f1b74a26b04dd96be62c07d25da0158df0b.tar.gz | |
Merge pull request #299 from slskd/secrets
Explicitly redact secrets stored in options before exporting them
Diffstat (limited to 'src/slskd/Core/API')
| -rw-r--r-- | src/slskd/Core/API/Controllers/OptionsController.cs | 4 | ||||
| -rw-r--r-- | src/slskd/Core/API/Hubs/ApplicationHub.cs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/slskd/Core/API/Controllers/OptionsController.cs b/src/slskd/Core/API/Controllers/OptionsController.cs index 60237878..201869e1 100644 --- a/src/slskd/Core/API/Controllers/OptionsController.cs +++ b/src/slskd/Core/API/Controllers/OptionsController.cs @@ -57,7 +57,7 @@ namespace slskd.Core.API [ProducesResponseType(typeof(Options), 200)] public IActionResult Current() { - return Ok(OptionsSnapshot.Value); + return Ok(OptionsSnapshot.Value.Redact()); } /// <summary> @@ -70,7 +70,7 @@ namespace slskd.Core.API [ProducesResponseType(typeof(Options), 200)] public IActionResult Startup() { - return Ok(OptionsAtStartup); + return Ok(OptionsAtStartup.Redact()); } [HttpGet] diff --git a/src/slskd/Core/API/Hubs/ApplicationHub.cs b/src/slskd/Core/API/Hubs/ApplicationHub.cs index d30b4a28..9861d0f9 100644 --- a/src/slskd/Core/API/Hubs/ApplicationHub.cs +++ b/src/slskd/Core/API/Hubs/ApplicationHub.cs @@ -53,7 +53,7 @@ namespace slskd.Core.API /// <returns>The operation context.</returns> public static Task BroadcastOptionsAsync(this IHubContext<ApplicationHub> hub, Options options) { - return hub.Clients.All.SendAsync(ApplicationHubMethods.Options, options); + return hub.Clients.All.SendAsync(ApplicationHubMethods.Options, options.Redact()); } } @@ -77,7 +77,7 @@ namespace slskd.Core.API public override async Task OnConnectedAsync() { await Clients.Caller.SendAsync(ApplicationHubMethods.State, StateMonitor.CurrentValue); - await Clients.Caller.SendAsync(ApplicationHubMethods.Options, OptionsMonitor.CurrentValue); + await Clients.Caller.SendAsync(ApplicationHubMethods.Options, OptionsMonitor.CurrentValue.Redact()); } } }
\ No newline at end of file |
