Skip to content

Commit

Permalink
API route cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
webprofusion-chrisc committed Nov 1, 2024
1 parent 7f8c9b9 commit e979dc7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,7 +8,7 @@ namespace Certify.Server.Api.Public.Controllers
/// Internal API for extended certificate management. Not intended for general use.
/// </summary>
[ApiController]
[Route("internal/v1/[controller]")]
[Route("internal/v1/credentials")]
public partial class StoredCredentialController : ApiControllerBase
{

Expand Down
18 changes: 9 additions & 9 deletions src/Certify.SourceGenerators/ApiMethods.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using SourceGenerator;
Expand Down Expand Up @@ -151,7 +151,7 @@ public static List<GeneratedAPI> GetApiDefinitions()
Comment = "Get All Acme Accounts",
UseManagementAPI = true,
PublicAPIController = "CertificateAuthority",
PublicAPIRoute = "accounts/{instanceId}",
PublicAPIRoute = "{instanceId}/accounts/",
ServiceAPIRoute = "accounts",
ReturnType = "ICollection<Models.AccountDetails>",
Params =new Dictionary<string, string>{ { "instanceId", "string" } }
Expand Down Expand Up @@ -195,17 +195,17 @@ public static List<GeneratedAPI> 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<string, string>{{ "storageKey", "string" }, { "deactivate", "bool" } }
Params =new Dictionary<string, string>{ { "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<Models.Config.StoredCredential>",
UseManagementAPI = true,
Expand All @@ -216,7 +216,7 @@ public static List<GeneratedAPI> GetApiDefinitions()
OperationMethod = HttpPost,
Comment = "Add/Update Stored Credential",
PublicAPIController = "StoredCredential",
PublicAPIRoute = "credentials/{instanceId}",
PublicAPIRoute = "{instanceId}",
ServiceAPIRoute = "credentials",
ReturnType = "Models.Config.ActionResult",
UseManagementAPI = true,
Expand All @@ -227,7 +227,7 @@ public static List<GeneratedAPI> GetApiDefinitions()
OperationMethod = HttpDelete,
Comment = "Remove Stored Credential",
PublicAPIController = "StoredCredential",
PublicAPIRoute = "credentials/{instanceId}/{storageKey}",
PublicAPIRoute = "{instanceId}/{storageKey}",
ServiceAPIRoute = "credentials",
ReturnType = "Models.Config.ActionResult",
UseManagementAPI = true,
Expand All @@ -251,7 +251,7 @@ public static List<GeneratedAPI> 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<Certify.Models.Providers.DnsZone>",
UseManagementAPI = true,
Expand Down Expand Up @@ -287,7 +287,7 @@ public static List<GeneratedAPI> 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",
Expand Down

0 comments on commit e979dc7

Please sign in to comment.