mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-26 22:48:07 +02:00
Add client certificate utilities
This commit is contained in:
parent
6ed5752fa5
commit
490a301aa4
10 changed files with 355 additions and 20 deletions
|
@ -2,9 +2,11 @@ package testenv
|
|||
|
||||
import (
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/pomerium/pomerium/config"
|
||||
"github.com/pomerium/pomerium/internal/testenv/values"
|
||||
"github.com/pomerium/pomerium/pkg/policy/parser"
|
||||
)
|
||||
|
||||
// PolicyRoute is a [Route] implementation suitable for most common use cases
|
||||
|
@ -54,6 +56,20 @@ func (b *PolicyRoute) Policy(edit func(*config.Policy)) Route {
|
|||
return b
|
||||
}
|
||||
|
||||
// PPL implements Route.
|
||||
func (b *PolicyRoute) PPL(ppl string) Route {
|
||||
pplPolicy, err := parser.ParseYAML(strings.NewReader(ppl))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
b.edits = append(b.edits, func(p *config.Policy) {
|
||||
p.Policy = &config.PPLPolicy{
|
||||
Policy: pplPolicy,
|
||||
}
|
||||
})
|
||||
return b
|
||||
}
|
||||
|
||||
// To implements Route.
|
||||
func (b *PolicyRoute) URL() values.Value[string] {
|
||||
return b.from
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue