Skip to content

Commit

Permalink
feature: add caddy directive replacer to user transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
greenpau committed Apr 9, 2024
1 parent 4992f12 commit 2ce3bc5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions caddyfile_authn_transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/caddy-security/pkg/util"
"github.com/greenpau/go-authcrunch/pkg/authn"
"github.com/greenpau/go-authcrunch/pkg/authn/transformer"
cfgutil "github.com/greenpau/go-authcrunch/pkg/util/cfg"
Expand All @@ -29,8 +30,8 @@ func parseCaddyfileAuthPortalTransform(h *caddyfile.Dispenser, repl *caddy.Repla
case "user", "users":
tc := &transformer.Config{}
for nesting := h.Nesting(); h.NextBlock(nesting); {
trKey := h.Val()
trArgs := h.RemainingArgs()
trKey := util.FindReplace(repl, h.Val())
trArgs := util.FindReplaceAll(repl, h.RemainingArgs())
trArgs = append([]string{trKey}, trArgs...)
encodedArgs := cfgutil.EncodeArgs(trArgs)
var matchArgs bool
Expand Down

0 comments on commit 2ce3bc5

Please sign in to comment.