Refactor function names and doc comments

This commit is contained in:
akp 2024-10-10 00:30:09 +01:00
parent 842a867d21
commit d1308e6f9e
No known key found for this signature in database
GPG key ID: CF8D58F3DEB20755

View file

@ -12,16 +12,18 @@ import (
)
func init() {
httpcaddyfile.RegisterDirective("tailscale_auth", parseCaddyfileTSAuth)
httpcaddyfile.RegisterDirective("tailscale_auth", parseCaddyfile)
httpcaddyfile.RegisterDirectiveOrder("tailscale_auth", httpcaddyfile.After, "basic_auth")
}
// parseCaddyfileTSAuth sets up the handler from Caddyfile tokens. Syntax:
// parseCaddyfile sets up the handler from Caddyfile tokens. Syntax:
//
// tailscale_auth
// tailscale_auth [set_headers]
//
// See also for further examples: https://github.com/caddyserver/caddy/blob/master/modules/caddyhttp/caddyauth/caddyfile.go
func parseCaddyfileTSAuth(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error) {
// See also for further examples:
// - https://github.com/caddyserver/caddy/blob/master/modules/caddyhttp/caddyauth/caddyfile.go
// - https://github.com/caddyserver/caddy/blob/master/modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go
func parseCaddyfile(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error) {
h.Next() // consume directive name
handlers := []json.RawMessage{