summaryrefslogtreecommitdiff
path: root/modules/caddyhttp
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2023-04-19 11:55:22 -0400
committerGitHub <noreply@github.com>2023-04-19 11:55:22 -0400
commitb301a3df70232fe00de186b0586dcec8bf0d2559 (patch)
tree2954364b23ca05dae62cd9849b29fab78c29b2a5 /modules/caddyhttp
parent998c6e06a75030cccabcc08790bc32642791aff7 (diff)
celmatcher: Implement `pkix.Name` conversion to string (#5492)
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r--modules/caddyhttp/celmatcher.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/caddyhttp/celmatcher.go b/modules/caddyhttp/celmatcher.go
index c4635e2..fbc5f5a 100644
--- a/modules/caddyhttp/celmatcher.go
+++ b/modules/caddyhttp/celmatcher.go
@@ -255,7 +255,10 @@ type celPkixName struct{ *pkix.Name }
func (pn celPkixName) ConvertToNative(typeDesc reflect.Type) (any, error) {
return pn.Name, nil
}
-func (celPkixName) ConvertToType(typeVal ref.Type) ref.Val {
+func (pn celPkixName) ConvertToType(typeVal ref.Type) ref.Val {
+ if typeVal.TypeName() == "string" {
+ return types.String(pn.Name.String())
+ }
panic("not implemented")
}
func (pn celPkixName) Equal(other ref.Val) ref.Val {