From f3bfa19938a7f0b97999e3253638bd2fa9c27c6a Mon Sep 17 00:00:00 2001 From: Leonard Henriquez Date: Mon, 4 Dec 2023 11:29:03 +0100 Subject: [PATCH] feat: add alternate schema route --- cmd/buz/app.go | 3 +++ deploy/terraform/aws/lambda/config.yml.tftpl | 1 + deploy/terraform/gcp/cloud_run/config.yml.tftpl | 3 ++- pkg/config/app.go | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/buz/app.go b/cmd/buz/app.go index d99d061d..4f8068b9 100644 --- a/cmd/buz/app.go +++ b/cmd/buz/app.go @@ -176,6 +176,9 @@ func (a *App) initializeSchemaCacheRoutes() { if a.config.Registry.Http.Enabled { log.Info().Msg("🟢 initializing schema registry routes") a.switchableRouterGroup.GET(registry.SCHEMAS_ROUTE+"*"+registry.SCHEMA_PARAM, registry.GetSchemaHandler(r)) + if a.config.SchemaRoute != "" { + a.switchableRouterGroup.GET(a.config.SchemaRoute+"*"+registry.SCHEMA_PARAM, registry.GetSchemaHandler(r)) + } } } diff --git a/deploy/terraform/aws/lambda/config.yml.tftpl b/deploy/terraform/aws/lambda/config.yml.tftpl index 0b6d4aff..6fe1d65a 100644 --- a/deploy/terraform/aws/lambda/config.yml.tftpl +++ b/deploy/terraform/aws/lambda/config.yml.tftpl @@ -7,6 +7,7 @@ app: trackerDomain: ${trackerDomain} enableConfigRoute: false serverless: true + schemaRoute: /schemas/ middleware: timeout: diff --git a/deploy/terraform/gcp/cloud_run/config.yml.tftpl b/deploy/terraform/gcp/cloud_run/config.yml.tftpl index 912ee0e5..6e4c199e 100644 --- a/deploy/terraform/gcp/cloud_run/config.yml.tftpl +++ b/deploy/terraform/gcp/cloud_run/config.yml.tftpl @@ -7,6 +7,7 @@ app: trackerDomain: ${trackerDomain} enableConfigRoute: false serverless: false + schemaRoute: /schemas/ middleware: timeout: @@ -96,4 +97,4 @@ squawkBox: enabled: true tele: - enabled: true \ No newline at end of file + enabled: true diff --git a/pkg/config/app.go b/pkg/config/app.go index 3923c267..50bfba43 100644 --- a/pkg/config/app.go +++ b/pkg/config/app.go @@ -12,4 +12,5 @@ type App struct { TrackerDomain string `json:"trackerDomain"` EnableConfigRoute bool `json:"enableConfigRoute"` Serverless bool `json:"serverless"` + SchemaRoute string `json:"schemaRoute"` }