diff options
author | Mohammed Al Sahaf <[email protected]> | 2024-02-26 00:13:48 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2024-02-26 00:13:48 +0300 |
commit | 03f703a00e006a1e53a2eaf5f4e33a1b3a5e4237 (patch) | |
tree | f17295075e29942f9ff97e790d9db835a0a6c7b3 /internal | |
parent | 931656bd6868a87eef4814cc02b5125a907662bf (diff) | |
download | caddy-03f703a00e006a1e53a2eaf5f4e33a1b3a5e4237.tar.gz caddy-03f703a00e006a1e53a2eaf5f4e33a1b3a5e4237.zip |
caddytls: verifier: caddyfile: re-add Caddyfile support (#6127)
* caddytls: verifier: caddyfile: re-add Caddyfile support
* appease the linter
* caddytls: client_auth: verifier: change namespace to `tls.client_auth.verifier`
Diffstat (limited to 'internal')
-rw-r--r-- | internal/testmocks/dummyverifier.go | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/internal/testmocks/dummyverifier.go b/internal/testmocks/dummyverifier.go new file mode 100644 index 000000000..1fbef32bf --- /dev/null +++ b/internal/testmocks/dummyverifier.go @@ -0,0 +1,41 @@ +package testmocks + +import ( + "crypto/x509" + + "github.com/caddyserver/caddy/v2" + "github.com/caddyserver/caddy/v2/caddyconfig/caddyfile" + "github.com/caddyserver/caddy/v2/modules/caddytls" +) + +func init() { + caddy.RegisterModule(new(dummyVerifier)) +} + +type dummyVerifier struct{} + +// UnmarshalCaddyfile implements caddyfile.Unmarshaler. +func (dummyVerifier) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { + return nil +} + +// CaddyModule implements caddy.Module. +func (dummyVerifier) CaddyModule() caddy.ModuleInfo { + return caddy.ModuleInfo{ + ID: "tls.client_auth.verifier.dummy", + New: func() caddy.Module { + return new(dummyVerifier) + }, + } +} + +// VerifyClientCertificate implements ClientCertificateVerifier. +func (dummyVerifier) VerifyClientCertificate(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { + return nil +} + +var ( + _ caddy.Module = dummyVerifier{} + _ caddytls.ClientCertificateVerifier = dummyVerifier{} + _ caddyfile.Unmarshaler = dummyVerifier{} +) |