aboutsummaryrefslogtreecommitdiffhomepage
path: root/caddyconfig
diff options
context:
space:
mode:
authorFrancis Lavoie <[email protected]>2024-02-12 12:34:23 -0500
committerGitHub <[email protected]>2024-02-12 17:34:23 +0000
commitf9e11158bc139294804cba99e9fea408f1fb00d6 (patch)
treeea47745c0a31ebe8d3d0300d473b08a459999a46 /caddyconfig
parent91ec75441ab5b95deec4ee6794f00b3880ec6336 (diff)
downloadcaddy-f9e11158bc139294804cba99e9fea408f1fb00d6.tar.gz
caddy-f9e11158bc139294804cba99e9fea408f1fb00d6.zip
caddyauth: Rename `basicauth` to `basic_auth` (#6092)
Diffstat (limited to 'caddyconfig')
-rw-r--r--caddyconfig/caddyfile/parse_test.go8
-rw-r--r--caddyconfig/httpcaddyfile/directives.go3
2 files changed, 6 insertions, 5 deletions
diff --git a/caddyconfig/caddyfile/parse_test.go b/caddyconfig/caddyfile/parse_test.go
index 90f5095d4..eec94e3af 100644
--- a/caddyconfig/caddyfile/parse_test.go
+++ b/caddyconfig/caddyfile/parse_test.go
@@ -801,7 +801,7 @@ func TestImportedFilesIgnoreNonDirectiveImportTokens(t *testing.T) {
fileName := writeStringToTempFileOrDie(t, `
http://example.com {
# This isn't an import directive, it's just an arg with value 'import'
- basicauth / import password
+ basic_auth / import password
}
`)
// Parse the root file that imports the other one.
@@ -812,12 +812,12 @@ func TestImportedFilesIgnoreNonDirectiveImportTokens(t *testing.T) {
}
auth := blocks[0].Segments[0]
line := auth[0].Text + " " + auth[1].Text + " " + auth[2].Text + " " + auth[3].Text
- if line != "basicauth / import password" {
+ if line != "basic_auth / import password" {
// Previously, it would be changed to:
- // basicauth / import /path/to/test/dir/password
+ // basic_auth / import /path/to/test/dir/password
// referencing a file that (probably) doesn't exist and changing the
// password!
- t.Errorf("Expected basicauth tokens to be 'basicauth / import password' but got %#q", line)
+ t.Errorf("Expected basic_auth tokens to be 'basic_auth / import password' but got %#q", line)
}
}
diff --git a/caddyconfig/httpcaddyfile/directives.go b/caddyconfig/httpcaddyfile/directives.go
index 6e5241c7f..9a549a18e 100644
--- a/caddyconfig/httpcaddyfile/directives.go
+++ b/caddyconfig/httpcaddyfile/directives.go
@@ -58,7 +58,8 @@ var directiveOrder = []string{
"try_files",
// middleware handlers; some wrap responses
- "basicauth",
+ "basicauth", // TODO: deprecated, renamed to basic_auth
+ "basic_auth",
"forward_auth",
"request_header",
"encode",