From a9ce28d4120e6c03905274e088665b3de9fab3ff Mon Sep 17 00:00:00 2001 From: Simon Emms Date: Wed, 13 Nov 2024 14:02:10 +0000 Subject: [PATCH 1/3] feat(azure): get regions available for azure --- docs/docs.go | 3 +++ docs/swagger.json | 3 +++ docs/swagger.yaml | 2 ++ go.mod | 1 + go.sum | 2 ++ internal/azure/azure.go | 35 ++++++++++++++++++++++++++++++++ internal/router/api/v1/region.go | 34 +++++++++++++++++++++++++++++++ internal/types/region.go | 1 + 8 files changed, 81 insertions(+) diff --git a/docs/docs.go b/docs/docs.go index df7731d4..d5e4a142 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1746,6 +1746,9 @@ const docTemplate = `{ "aws_auth": { "$ref": "#/definitions/types.AWSAuth" }, + "azure_auth": { + "$ref": "#/definitions/types.AzureAuth" + }, "civo_auth": { "$ref": "#/definitions/types.CivoAuth" }, diff --git a/docs/swagger.json b/docs/swagger.json index e7ac7d43..ddfd6013 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1740,6 +1740,9 @@ "aws_auth": { "$ref": "#/definitions/types.AWSAuth" }, + "azure_auth": { + "$ref": "#/definitions/types.AzureAuth" + }, "civo_auth": { "$ref": "#/definitions/types.CivoAuth" }, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index f61e9a55..607065dd 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -509,6 +509,8 @@ definitions: $ref: '#/definitions/types.AkamaiAuth' aws_auth: $ref: '#/definitions/types.AWSAuth' + azure_auth: + $ref: '#/definitions/types.AzureAuth' civo_auth: $ref: '#/definitions/types.CivoAuth' cloud_region: diff --git a/go.mod b/go.mod index 1ed729c5..881a0737 100644 --- a/go.mod +++ b/go.mod @@ -62,6 +62,7 @@ require ( require ( dario.cat/mergo v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/docker/go-connections v0.4.0 // indirect diff --git a/go.sum b/go.sum index 75f8d73d..70647a9a 100644 --- a/go.sum +++ b/go.sum @@ -71,6 +71,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 h1:lpOxw github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0/go.mod h1:fSvRkb8d26z9dbL40Uf/OO6Vo9iExtZK3D0ulRV+8M0= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0 h1:wxQx2Bt4xzPIKvW59WQf1tJNx/ZZKPfN+EhPX3Z6CYY= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0/go.mod h1:TpiwjwnW/khS0LKs4vW5UmmT9OWcxaveS8U7+tlknzo= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0 h1:PiSrjRPpkQNjrM8H0WwKMnZUdu1RGMtd/LdGKUrOo+c= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0/go.mod h1:oDrbWx4ewMylP7xHivfgixbfGBT6APAwsSoHRKotnIc= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.1 h1:cf+OIKbkmMHBaC3u78AXomweqM0oxQSgBXRZf3WH4yM= diff --git a/internal/azure/azure.go b/internal/azure/azure.go index 29ee8a57..e2df7fb7 100644 --- a/internal/azure/azure.go +++ b/internal/azure/azure.go @@ -9,6 +9,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob" ) @@ -43,6 +44,14 @@ func (c *Client) newResourceClientFactory() (*armresources.ClientFactory, error) return client, nil } +func (c *Client) newSubscriptionClientFactory() (*armsubscriptions.ClientFactory, error) { + client, err := armsubscriptions.NewClientFactory(c.cred, nil) + if err != nil { + return nil, fmt.Errorf("failed to create armsubscriptions client: %w", err) + } + return client, nil +} + func (c *Client) newStorageClientFactory() (*armstorage.ClientFactory, error) { client, err := armstorage.NewClientFactory(c.subscriptionID, c.cred, nil) if err != nil { @@ -135,6 +144,32 @@ func (c *Client) CreateStorageAccount(ctx context.Context, location, resourceGro return &resp.Account, nil } +func (c *Client) GetRegions(ctx context.Context) ([]string, error) { + client, err := c.newSubscriptionClientFactory() + if err != nil { + return nil, err + } + + pager := client.NewClient().NewListLocationsPager(c.subscriptionID, &armsubscriptions.ClientListLocationsOptions{ + IncludeExtendedLocations: to.Ptr(false), + }) + + var regions []string + + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + return nil, fmt.Errorf("failed to list regions: %w", err) + } + + for _, v := range page.Value { + regions = append(regions, *v.Name) + } + } + + return regions, nil +} + func (c *Client) GetStorageAccessKeys(ctx context.Context, resourceGroup, storageAccountName string) (*Keys, error) { client, err := c.newStorageClientFactory() if err != nil { diff --git a/internal/router/api/v1/region.go b/internal/router/api/v1/region.go index 6cdf6c26..b790b1e1 100644 --- a/internal/router/api/v1/region.go +++ b/internal/router/api/v1/region.go @@ -14,6 +14,7 @@ import ( "github.com/gin-gonic/gin" awsinternal "github.com/konstructio/kubefirst-api/internal/aws" + "github.com/konstructio/kubefirst-api/internal/azure" "github.com/konstructio/kubefirst-api/internal/civo" "github.com/konstructio/kubefirst-api/internal/digitalocean" "github.com/konstructio/kubefirst-api/internal/types" @@ -98,6 +99,39 @@ func PostRegions(c *gin.Context) { }) return } + regionListResponse.Regions = regions + case "azure": + if regionListRequest.AzureAuth.ClientID == "" || + regionListRequest.AzureAuth.ClientSecret == "" || + regionListRequest.AzureAuth.SubscriptionID == "" || + regionListRequest.AzureAuth.TenantID == "" { + c.JSON(http.StatusBadRequest, types.JSONFailureResponse{ + Message: "missing authentication credentials in request, please check and try again", + }) + return + } + + azureClient, err := azure.NewClient( + regionListRequest.AzureAuth.ClientID, + regionListRequest.AzureAuth.ClientSecret, + regionListRequest.AzureAuth.SubscriptionID, + regionListRequest.AzureAuth.TenantID, + ) + if err != nil { + c.JSON(http.StatusBadRequest, types.JSONFailureResponse{ + Message: err.Error(), + }) + return + } + + regions, err := azureClient.GetRegions(context.Background()) + if err != nil { + c.JSON(http.StatusBadRequest, types.JSONFailureResponse{ + Message: err.Error(), + }) + return + } + regionListResponse.Regions = regions case "civo": if regionListRequest.CivoAuth.Token == "" { diff --git a/internal/types/region.go b/internal/types/region.go index b31008c4..9a5b5e0f 100644 --- a/internal/types/region.go +++ b/internal/types/region.go @@ -15,6 +15,7 @@ type RegionListRequest struct { CloudRegion string `json:"cloud_region,omitempty"` AkamaiAuth pkgtypes.AkamaiAuth `json:"akamai_auth,omitempty"` AWSAuth pkgtypes.AWSAuth `json:"aws_auth,omitempty"` + AzureAuth pkgtypes.AzureAuth `json:"azure_auth,omitempty"` CivoAuth pkgtypes.CivoAuth `json:"civo_auth,omitempty"` DigitaloceanAuth pkgtypes.DigitaloceanAuth `json:"do_auth,omitempty"` VultrAuth pkgtypes.VultrAuth `json:"vultr_auth,omitempty"` From 6f1e19249a92eb2562e07064d0dba6ef9eb0bb9f Mon Sep 17 00:00:00 2001 From: Simon Emms Date: Wed, 13 Nov 2024 15:09:31 +0000 Subject: [PATCH 2/3] feat(azure): get instance sizes for azure --- go.mod | 1 + go.sum | 2 ++ internal/azure/azure.go | 33 +++++++++++++++++++++++++ internal/router/api/v1/instanceSizes.go | 32 ++++++++++++++++++++++++ internal/types/instanceSizes.go | 1 + 5 files changed, 69 insertions(+) diff --git a/go.mod b/go.mod index 881a0737..046e303b 100644 --- a/go.mod +++ b/go.mod @@ -62,6 +62,7 @@ require ( require ( dario.cat/mergo v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions v1.3.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect diff --git a/go.sum b/go.sum index 70647a9a..d57eed84 100644 --- a/go.sum +++ b/go.sum @@ -67,6 +67,8 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0 h1:/Di3vB4sNeQ+7A8efjUVENvyB945Wruvstucqp7ZArg= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0/go.mod h1:gM3K25LQlsET3QR+4V74zxCsFAy0r6xMNN9n80SZn+4= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 h1:lpOxwrQ919lCZoNCd69rVt8u1eLZuMORrGXqy8sNf3c= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0/go.mod h1:fSvRkb8d26z9dbL40Uf/OO6Vo9iExtZK3D0ulRV+8M0= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= diff --git a/internal/azure/azure.go b/internal/azure/azure.go index e2df7fb7..91ee5da7 100644 --- a/internal/azure/azure.go +++ b/internal/azure/azure.go @@ -7,6 +7,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" @@ -60,6 +61,14 @@ func (c *Client) newStorageClientFactory() (*armstorage.ClientFactory, error) { return client, nil } +func (c *Client) newVirtualMachineSizesClient() (*armcompute.VirtualMachineSizesClient, error) { + client, err := armcompute.NewVirtualMachineSizesClient(c.subscriptionID, c.cred, nil) + if err != nil { + return nil, fmt.Errorf("failed to create virtualmachine client: %w", err) + } + return client, nil +} + func (c *Client) CreateBlobContainer(ctx context.Context, storageAccountName, containerName string) (*azblob.CreateContainerResponse, error) { client, err := azblob.NewClient(fmt.Sprintf("https://%s.blob.core.windows.net", storageAccountName), c.cred, nil) if err != nil { @@ -144,6 +153,30 @@ func (c *Client) CreateStorageAccount(ctx context.Context, location, resourceGro return &resp.Account, nil } +func (c *Client) GetInstanceSizes(ctx context.Context, location string) ([]string, error) { + client, err := c.newVirtualMachineSizesClient() + if err != nil { + return nil, err + } + + var sizes []string + + pager := client.NewListPager(location, nil) + + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + return nil, fmt.Errorf("failed to list instance sizes: %w", err) + } + + for _, v := range page.Value { + sizes = append(sizes, *v.Name) + } + } + + return sizes, nil +} + func (c *Client) GetRegions(ctx context.Context) ([]string, error) { client, err := c.newSubscriptionClientFactory() if err != nil { diff --git a/internal/router/api/v1/instanceSizes.go b/internal/router/api/v1/instanceSizes.go index 9c64e4c6..3b1c3db2 100644 --- a/internal/router/api/v1/instanceSizes.go +++ b/internal/router/api/v1/instanceSizes.go @@ -8,6 +8,7 @@ import ( "github.com/gin-gonic/gin" awsinternal "github.com/konstructio/kubefirst-api/internal/aws" + "github.com/konstructio/kubefirst-api/internal/azure" "github.com/konstructio/kubefirst-api/internal/civo" "github.com/konstructio/kubefirst-api/internal/digitalocean" "github.com/konstructio/kubefirst-api/internal/types" @@ -108,7 +109,38 @@ func ListInstanceSizesForRegion(c *gin.Context) { instanceSizesResponse.InstanceSizes = instanceSizes c.JSON(http.StatusOK, instanceSizesResponse) return + case "azure": + if instanceSizesRequest.AzureAuth.ClientID == "" || + instanceSizesRequest.AzureAuth.ClientSecret == "" || + instanceSizesRequest.AzureAuth.SubscriptionID == "" || + instanceSizesRequest.AzureAuth.TenantID == "" { + c.JSON(http.StatusBadRequest, types.JSONFailureResponse{ + Message: "missing authentication credentials in request, please check and try again", + }) + return + } + azureClient, err := azure.NewClient( + instanceSizesRequest.AzureAuth.ClientID, + instanceSizesRequest.AzureAuth.ClientSecret, + instanceSizesRequest.AzureAuth.SubscriptionID, + instanceSizesRequest.AzureAuth.TenantID, + ) + if err != nil { + c.JSON(http.StatusBadRequest, types.JSONFailureResponse{ + Message: err.Error(), + }) + return + } + + instances, err := azureClient.GetInstanceSizes(context.Background(), instanceSizesRequest.CloudRegion) + if err != nil { + c.JSON(http.StatusBadRequest, types.JSONFailureResponse{ + Message: err.Error(), + }) + return + } + instanceSizesResponse.InstanceSizes = instances case "digitalocean": if instanceSizesRequest.DigitaloceanAuth.Token == "" { c.JSON(http.StatusBadRequest, types.JSONFailureResponse{ diff --git a/internal/types/instanceSizes.go b/internal/types/instanceSizes.go index 3a975861..3fdea80b 100644 --- a/internal/types/instanceSizes.go +++ b/internal/types/instanceSizes.go @@ -16,6 +16,7 @@ type InstanceSizesRequest struct { CivoAuth pkgtypes.CivoAuth `json:"civo_auth,omitempty"` AkamaiAuth pkgtypes.AkamaiAuth `json:"akamai_auth,omitempty"` AWSAuth pkgtypes.AWSAuth `json:"aws_auth,omitempty"` + AzureAuth pkgtypes.AzureAuth `json:"azure_auth,omitempty"` DigitaloceanAuth pkgtypes.DigitaloceanAuth `json:"do_auth,omitempty"` VultrAuth pkgtypes.VultrAuth `json:"vultr_auth,omitempty"` GoogleAuth pkgtypes.GoogleAuth `json:"google_auth,omitempty"` From 0023b3a9b45a76db618c04f2c6de779e8fa65dc9 Mon Sep 17 00:00:00 2001 From: Simon Emms Date: Mon, 18 Nov 2024 09:09:56 +0000 Subject: [PATCH 3/3] todo: start of the domains for azure --- docs/docs.go | 46 +++++++++++++++++++++++++++++ docs/swagger.json | 46 +++++++++++++++++++++++++++++ docs/swagger.yaml | 33 +++++++++++++++++++++ internal/azure/azure.go | 2 ++ internal/router/api/v1/azure.go | 51 +++++++++++++++++++++++++++++++++ internal/router/router.go | 1 + internal/types/errors.go | 2 +- 7 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 internal/router/api/v1/azure.go diff --git a/docs/docs.go b/docs/docs.go index d5e4a142..8d120fbc 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -538,6 +538,52 @@ const docTemplate = `{ } } }, + "/domain/validate/azure/:domain": { + "get": { + "description": "Returns status of whether or not an Azure hosted zone is validated for use with Kubefirst", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "aws" + ], + "summary": "Returns status of whether or not an Azure hosted zone is validated for use with Kubefirst", + "parameters": [ + { + "type": "string", + "description": "Domain name, no trailing dot", + "name": "domain", + "in": "path", + "required": true + }, + { + "type": "string", + "default": "Bearer \u003cAPI key\u003e", + "description": "API key", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/types.AWSDomainValidateResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/types.JSONFailureResponse" + } + } + } + } + }, "/gitops-catalog/:cluster_name/:cloud_provider/apps": { "get": { "description": "Returns a list of available Kubefirst gitops catalog applications", diff --git a/docs/swagger.json b/docs/swagger.json index ddfd6013..bacab9d0 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -532,6 +532,52 @@ } } }, + "/domain/validate/azure/:domain": { + "get": { + "description": "Returns status of whether or not an Azure hosted zone is validated for use with Kubefirst", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "aws" + ], + "summary": "Returns status of whether or not an Azure hosted zone is validated for use with Kubefirst", + "parameters": [ + { + "type": "string", + "description": "Domain name, no trailing dot", + "name": "domain", + "in": "path", + "required": true + }, + { + "type": "string", + "default": "Bearer \u003cAPI key\u003e", + "description": "API key", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/types.AWSDomainValidateResponse" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/types.JSONFailureResponse" + } + } + } + } + }, "/gitops-catalog/:cluster_name/:cloud_provider/apps": { "get": { "description": "Returns a list of available Kubefirst gitops catalog applications", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 607065dd..96077f99 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -989,6 +989,39 @@ paths: account tags: - domain + /domain/validate/azure/:domain: + get: + consumes: + - application/json + description: Returns status of whether or not an Azure hosted zone is validated + for use with Kubefirst + parameters: + - description: Domain name, no trailing dot + in: path + name: domain + required: true + type: string + - default: Bearer + description: API key + in: header + name: Authorization + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/types.AWSDomainValidateResponse' + "400": + description: Bad Request + schema: + $ref: '#/definitions/types.JSONFailureResponse' + summary: Returns status of whether or not an Azure hosted zone is validated + for use with Kubefirst + tags: + - aws /gitops-catalog/:cluster_name/:cloud_provider/apps: get: consumes: diff --git a/internal/azure/azure.go b/internal/azure/azure.go index 91ee5da7..0966ccf8 100644 --- a/internal/azure/azure.go +++ b/internal/azure/azure.go @@ -231,6 +231,8 @@ func (c *Client) GetStorageAccessKeys(ctx context.Context, resourceGroup, storag }, nil } +func (c *Client) TestDomainLiveness(domainName, resourceGroup string) {} + func (c *Client) TestHostedZoneLiveness(ctx context.Context, domainName, resourceGroup string) (bool, error) { client, err := c.newDNSClientFactory() if err != nil { diff --git a/internal/router/api/v1/azure.go b/internal/router/api/v1/azure.go new file mode 100644 index 00000000..9268111c --- /dev/null +++ b/internal/router/api/v1/azure.go @@ -0,0 +1,51 @@ +/* +Copyright (C) 2021-2023, Kubefirst + +This program is licensed under MIT. +See the LICENSE file for more details. +*/ +package api + +import ( + "net/http" + + "github.com/gin-gonic/gin" + "github.com/konstructio/kubefirst-api/internal/types" +) + +// GetValidateAzureDomain godoc +// +// @Summary Returns status of whether or not an Azure hosted zone is validated for use with Kubefirst +// @Description Returns status of whether or not an Azure hosted zone is validated for use with Kubefirst +// @Tags aws +// @Accept json +// @Produce json +// @Param domain path string true "Domain name, no trailing dot" +// @Success 200 {object} types.AWSDomainValidateResponse +// @Failure 400 {object} types.JSONFailureResponse +// @Router /domain/validate/azure/:domain [get] +// @Param Authorization header string true "API key" default(Bearer ) +// +// GetValidateAzureDomain returns status for an AWS domain validation +func GetValidateAzureDomain(c *gin.Context) { + domainName, exists := c.Params.Get("domain") + if !exists { + c.JSON(http.StatusBadRequest, types.JSONFailureResponse{ + Message: ":domain parameter not provided in request", + }) + return + } + + resourceGroup, exists := c.GetQuery("resourceGroup") + if !exists { + c.JSON(http.StatusBadRequest, types.JSONFailureResponse{ + Message: ":resourceGroup parameter not provided in request", + }) + return + } + + c.JSON(http.StatusOK, map[string]string{ + "domain": domainName, + "resourceGroup": resourceGroup, + }) +} diff --git a/internal/router/router.go b/internal/router/router.go index 1a5270a9..652a1ec3 100644 --- a/internal/router/router.go +++ b/internal/router/router.go @@ -76,6 +76,7 @@ func SetupRouter() *gin.Engine { // Domains v1.POST("/domain/:dns_provider", middleware.ValidateAPIKey(), router.PostDomains) v1.GET("/domain/validate/aws/:domain", middleware.ValidateAPIKey(), router.GetValidateAWSDomain) + v1.GET("/domain/validate/azure/:domain", middleware.ValidateAPIKey(), router.GetValidateAzureDomain) v1.GET("/domain/validate/civo/:domain", middleware.ValidateAPIKey(), router.GetValidateCivoDomain) v1.POST("/domain/validate/cloudflare/:domain", middleware.ValidateAPIKey(), router.PostValidateCloudflareDomain) v1.POST("/domain/validate/digitalocean/:domain", middleware.ValidateAPIKey(), router.PostValidateDigitalOceanDomain) diff --git a/internal/types/errors.go b/internal/types/errors.go index d81f057e..de9414cf 100644 --- a/internal/types/errors.go +++ b/internal/types/errors.go @@ -12,7 +12,7 @@ type JSONFailureResponse struct { } // JSONHealthResponse describes a message returned by the API health endpoint -type JSONHealthResponse struct { +type JSONHealthResponse struct { Status string `json:"status" example:"healthy"` }