diff --git a/src/Certify.Server/Certify.Server.Api.Public/Controllers/internal/StoredCredentialController.cs b/src/Certify.Server/Certify.Server.Api.Public/Controllers/internal/StoredCredentialController.cs index b90043620..243eb339b 100644 --- a/src/Certify.Server/Certify.Server.Api.Public/Controllers/internal/StoredCredentialController.cs +++ b/src/Certify.Server/Certify.Server.Api.Public/Controllers/internal/StoredCredentialController.cs @@ -1,7 +1,5 @@ using Certify.Client; using Certify.Server.Api.Public.Services; -using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace Certify.Server.Api.Public.Controllers @@ -10,7 +8,7 @@ namespace Certify.Server.Api.Public.Controllers /// Internal API for extended certificate management. Not intended for general use. /// [ApiController] - [Route("internal/v1/[controller]")] + [Route("internal/v1/credentials")] public partial class StoredCredentialController : ApiControllerBase { diff --git a/src/Certify.SourceGenerators/ApiMethods.cs b/src/Certify.SourceGenerators/ApiMethods.cs index 2901ff3c7..1f4d790f2 100644 --- a/src/Certify.SourceGenerators/ApiMethods.cs +++ b/src/Certify.SourceGenerators/ApiMethods.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using SourceGenerator; @@ -151,7 +151,7 @@ public static List GetApiDefinitions() Comment = "Get All Acme Accounts", UseManagementAPI = true, PublicAPIController = "CertificateAuthority", - PublicAPIRoute = "accounts/{instanceId}", + PublicAPIRoute = "{instanceId}/accounts/", ServiceAPIRoute = "accounts", ReturnType = "ICollection", Params =new Dictionary{ { "instanceId", "string" } } @@ -195,17 +195,17 @@ public static List GetApiDefinitions() OperationMethod = HttpDelete, Comment = "Remove ACME Account", PublicAPIController = "CertificateAuthority", - PublicAPIRoute = "accounts/{storageKey}/{deactivate}", + PublicAPIRoute = "{instanceId}/accounts/{storageKey}/{deactivate}", ServiceAPIRoute = "accounts/remove/{storageKey}/{deactivate}", ReturnType = "Models.Config.ActionResult", - Params =new Dictionary{{ "storageKey", "string" }, { "deactivate", "bool" } } + Params =new Dictionary{ { "instanceId", "string" }, { "storageKey", "string" }, { "deactivate", "bool" } } }, new GeneratedAPI { OperationName = "GetStoredCredentials", OperationMethod = HttpGet, Comment = "Get List of Stored Credentials", PublicAPIController = "StoredCredential", - PublicAPIRoute = "credentials/{instanceId}", + PublicAPIRoute = "{instanceId}", ServiceAPIRoute = "credentials", ReturnType = "ICollection", UseManagementAPI = true, @@ -216,7 +216,7 @@ public static List GetApiDefinitions() OperationMethod = HttpPost, Comment = "Add/Update Stored Credential", PublicAPIController = "StoredCredential", - PublicAPIRoute = "credentials/{instanceId}", + PublicAPIRoute = "{instanceId}", ServiceAPIRoute = "credentials", ReturnType = "Models.Config.ActionResult", UseManagementAPI = true, @@ -227,7 +227,7 @@ public static List GetApiDefinitions() OperationMethod = HttpDelete, Comment = "Remove Stored Credential", PublicAPIController = "StoredCredential", - PublicAPIRoute = "credentials/{instanceId}/{storageKey}", + PublicAPIRoute = "{instanceId}/{storageKey}", ServiceAPIRoute = "credentials", ReturnType = "Models.Config.ActionResult", UseManagementAPI = true, @@ -251,7 +251,7 @@ public static List GetApiDefinitions() OperationMethod = HttpGet, Comment = "Get List of Zones with the current DNS provider and credential", PublicAPIController = "ChallengeProvider", - PublicAPIRoute = "dnszones/{instanceId}/{providerTypeId}/{credentialId}", + PublicAPIRoute = "{instanceId}/dnszones/{providerTypeId}/{credentialId}", ServiceAPIRoute = "managedcertificates/dnszones/{providerTypeId}/{credentialId}", ReturnType = "ICollection", UseManagementAPI = true, @@ -287,7 +287,7 @@ public static List GetApiDefinitions() OperationMethod = HttpDelete, Comment = "Remove Managed Certificate", PublicAPIController = "Certificate", - PublicAPIRoute = "settings/{instanceId}/{managedCertId}", + PublicAPIRoute = "{instanceId}/settings/{managedCertId}", UseManagementAPI = true, ServiceAPIRoute = "managedcertificates/delete/{managedCertId}", ReturnType = "bool",