Skip to content

Commit

Permalink
Merge pull request #881 from KenxinKun/fix-unsanitised-template
Browse files Browse the repository at this point in the history
Fixes missing unsanitised templates
  • Loading branch information
jamietanna committed Dec 1, 2022
2 parents 5a33791 + 55b0905 commit a444d30
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/codegen/templates/chi/chi-middleware.tmpl
Expand Up @@ -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}}
Expand Down
2 changes: 1 addition & 1 deletion 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}}
Expand Down
2 changes: 1 addition & 1 deletion pkg/codegen/templates/gin/gin-wrappers.tmpl
Expand Up @@ -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}}
Expand Down

0 comments on commit a444d30

Please sign in to comment.