Skip to content

Commit 79ede78

Browse files
Fix hub credential update result
1 parent 86211be commit 79ede78

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/Certify.Core/Management/CertifyManager/CertifyManager.ManagementHub.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Text.Json;
@@ -265,7 +265,15 @@ public async Task<InstanceCommandResult> PerformHubCommandWithResult(InstanceCom
265265
var itemArg = args.FirstOrDefault(a => a.Key == "item");
266266
var storedCredential = JsonSerializer.Deserialize<StoredCredential>(itemArg.Value);
267267

268-
val = await _credentialsManager.Update(storedCredential);
268+
var updated = await _credentialsManager.Update(storedCredential);
269+
if (updated != null)
270+
{
271+
val = new ActionResult { IsSuccess = true, Message = "Updated", Result = updated };
272+
}
273+
else
274+
{
275+
val = new ActionResult("Update failed", false);
276+
}
269277
}
270278
else if (arg.CommandType == ManagementHubCommands.RemoveStoredCredential)
271279
{

src/Certify.Server/Certify.Server.HubService/Services/CertifyHubService.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ private ServiceControllers.ManagedChallengeController _managedChallengeControlle
5858
public Task<ActionResult> UpdateSecurityPrinciplePassword(SecurityPrinciplePasswordUpdate passwordUpdate, AuthContext authContext) => _accessController(authContext).UpdatePassword(passwordUpdate);
5959
public Task<SecurityPrincipleCheckResponse> ValidateSecurityPrinciplePassword(SecurityPrinciplePasswordCheck passwordCheck, AuthContext authContext) => _accessController(authContext).Validate(passwordCheck);
6060
public Task<ICollection<Role>> GetAccessRoles(AuthContext authContext) => _accessController(authContext).GetRoles();
61+
6162
public Task<ICollection<ManagedChallenge>> GetManagedChallenges(AuthContext authContext) => _managedChallengeController(authContext).Get();
6263
public Task<ActionResult> UpdateManagedChallenge(ManagedChallenge update, AuthContext authContext) => _managedChallengeController(authContext).Update(update);
6364
public Task<ActionResult> CleanupManagedChallenge(ManagedChallengeRequest request, AuthContext authContext) => _managedChallengeController(authContext).CleanupChallengeResponse(request);
65+
public Task<ActionResult> RemoveManagedChallenge(string id, AuthContext authContext) => _managedChallengeController(authContext).Delete(id);
66+
public Task<ActionResult> PerformManagedChallenge(ManagedChallengeRequest request, AuthContext authContext) => _managedChallengeController(authContext).PerformChallengeResponse(request);
6467

6568
public Task<ActionResult> AddAccount(ContactRegistration contact, AuthContext authContext = null) => throw new NotImplementedException();
6669
public Task<List<CertificateRequestResult>> BeginAutoRenewal(RenewalSettings settings, AuthContext authContext = null) => throw new NotImplementedException();
@@ -100,14 +103,13 @@ private ServiceControllers.ManagedChallengeController _managedChallengeControlle
100103
public Task<ImportExportPackage> PerformExport(ExportRequest exportRequest, AuthContext authContext) => throw new NotImplementedException();
101104
public Task<ICollection<ActionStep>> PerformImport(ImportRequest importRequest, AuthContext authContext) => throw new NotImplementedException();
102105
public Task<List<ActionResult>> PerformManagedCertMaintenance(string id = null, AuthContext authContext = null) => throw new NotImplementedException();
103-
public Task<ActionResult> PerformManagedChallenge(ManagedChallengeRequest request, AuthContext authContext) => throw new NotImplementedException();
106+
104107
public Task<List<ActionResult>> PerformServiceDiagnostics(AuthContext authContext = null) => throw new NotImplementedException();
105108
public Task<List<ActionStep>> PreviewActions(ManagedCertificate site, AuthContext authContext = null) => throw new NotImplementedException();
106109
public Task<CertificateRequestResult> ReapplyCertificateBindings(string managedItemId, bool isPreviewOnly, bool includeDeploymentTasks, AuthContext authContext = null) => throw new NotImplementedException();
107110
public Task<List<CertificateRequestResult>> RedeployManagedCertificates(bool isPreviewOnly, bool includeDeploymentTasks, AuthContext authContext = null) => throw new NotImplementedException();
108111
public Task<CertificateRequestResult> RefetchCertificate(string managedItemId, AuthContext authContext = null) => throw new NotImplementedException();
109112
public Task<ActionResult> RemoveAccount(string storageKey, bool deactivate, AuthContext authContext = null) => throw new NotImplementedException();
110-
public Task<ActionResult> RemoveManagedChallenge(string id, AuthContext authContext) => throw new NotImplementedException();
111113

112114
public Task<StatusMessage> RevokeManageSiteCertificate(string managedItemId, AuthContext authContext = null) => throw new NotImplementedException();
113115
public Task<List<ActionStep>> RunConfigurationDiagnostics(StandardServerTypes serverType, string serverSiteId, AuthContext authContext = null) => throw new NotImplementedException();

0 commit comments

Comments
 (0)