From 55b09050d2b39a009f17894efb89c3fa325ef678 Mon Sep 17 00:00:00 2001 From: Borja Lazaro Toralles Date: Thu, 1 Dec 2022 11:21:35 +0000 Subject: [PATCH] Fixes missing unsanitised templates --- pkg/codegen/templates/chi/chi-middleware.tmpl | 2 +- pkg/codegen/templates/constants.tmpl | 2 +- pkg/codegen/templates/gin/gin-wrappers.tmpl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/codegen/templates/chi/chi-middleware.tmpl b/pkg/codegen/templates/chi/chi-middleware.tmpl index bb4e8f7715..e99bbebdbd 100644 --- a/pkg/codegen/templates/chi/chi-middleware.tmpl +++ b/pkg/codegen/templates/chi/chi-middleware.tmpl @@ -40,7 +40,7 @@ func (siw *ServerInterfaceWrapper) {{$opid}}(w http.ResponseWriter, r *http.Requ {{end}} {{range .SecurityDefinitions}} - ctx = context.WithValue(ctx, {{.ProviderName | ucFirst}}Scopes, {{toStringArray .Scopes}}) + ctx = context.WithValue(ctx, {{.ProviderName | sanitizeGoIdentity | ucFirst}}Scopes, {{toStringArray .Scopes}}) {{end}} {{if .RequiresParamObject}} diff --git a/pkg/codegen/templates/constants.tmpl b/pkg/codegen/templates/constants.tmpl index a3a08595f7..8fad8764c4 100644 --- a/pkg/codegen/templates/constants.tmpl +++ b/pkg/codegen/templates/constants.tmpl @@ -1,7 +1,7 @@ {{- if gt (len .SecuritySchemeProviderNames) 0 }} const ( {{range $ProviderName := .SecuritySchemeProviderNames}} - {{- $ProviderName | ucFirst}}Scopes = "{{$ProviderName}}.Scopes" + {{- $ProviderName | sanitizeGoIdentity | ucFirst}}Scopes = "{{$ProviderName}}.Scopes" {{end}} ) {{end}} diff --git a/pkg/codegen/templates/gin/gin-wrappers.tmpl b/pkg/codegen/templates/gin/gin-wrappers.tmpl index 1757d95826..a0beee4855 100644 --- a/pkg/codegen/templates/gin/gin-wrappers.tmpl +++ b/pkg/codegen/templates/gin/gin-wrappers.tmpl @@ -40,7 +40,7 @@ func (siw *ServerInterfaceWrapper) {{$opid}}(c *gin.Context) { {{end}} {{range .SecurityDefinitions}} - c.Set({{.ProviderName | ucFirst}}Scopes, {{toStringArray .Scopes}}) + c.Set({{.ProviderName | sanitizeGoIdentity | ucFirst}}Scopes, {{toStringArray .Scopes}}) {{end}} {{if .RequiresParamObject}}