mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-30 10:56:28 +02:00
proxy: avoid second policy validation (#1204)
This commit is contained in:
parent
7a53e6bb42
commit
202b42f307
2 changed files with 0 additions and 9 deletions
|
@ -157,9 +157,6 @@ func New(opts config.Options) (*Proxy, error) {
|
||||||
}
|
}
|
||||||
p.authzClient = envoy_service_auth_v2.NewAuthorizationClient(authzConn)
|
p.authzClient = envoy_service_auth_v2.NewAuthorizationClient(authzConn)
|
||||||
|
|
||||||
if err := p.UpdatePolicies(&opts); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
metrics.AddPolicyCountCallback("pomerium-proxy", func() int64 {
|
metrics.AddPolicyCountCallback("pomerium-proxy", func() int64 {
|
||||||
return int64(len(opts.Policies))
|
return int64(len(opts.Policies))
|
||||||
})
|
})
|
||||||
|
|
|
@ -90,11 +90,6 @@ func TestNew(t *testing.T) {
|
||||||
shortCookieLength.CookieSecret = "gN3xnvfsAwfCXxnJorGLKUG4l2wC8sS8nfLMhcStPg=="
|
shortCookieLength.CookieSecret = "gN3xnvfsAwfCXxnJorGLKUG4l2wC8sS8nfLMhcStPg=="
|
||||||
badCookie := testOptions(t)
|
badCookie := testOptions(t)
|
||||||
badCookie.CookieName = ""
|
badCookie.CookieName = ""
|
||||||
badPolicyURL := config.Policy{To: "http://", From: "http://bar.example"}
|
|
||||||
badNewPolicy := testOptions(t)
|
|
||||||
badNewPolicy.Policies = []config.Policy{
|
|
||||||
badPolicyURL,
|
|
||||||
}
|
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
|
@ -106,7 +101,6 @@ func TestNew(t *testing.T) {
|
||||||
{"empty options", config.Options{}, false, true},
|
{"empty options", config.Options{}, false, true},
|
||||||
{"short secret/validate sanity check", shortCookieLength, false, true},
|
{"short secret/validate sanity check", shortCookieLength, false, true},
|
||||||
{"invalid cookie name, empty", badCookie, false, true},
|
{"invalid cookie name, empty", badCookie, false, true},
|
||||||
{"bad policy, bad policy url", badNewPolicy, false, true},
|
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue