mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-01 08:28:51 +00:00
Merge commit from fork
* Add DenyLists parsing * Remove unneeded returned error * Plug global denylist into Command * app creation: apply denylist to backchannel logout URI * Inject denylist to backchannel logout worker * webhook config: validate against blocked URLs * Add notificationsWebhook denylist target * command: Add SMTP endpoint validation against blocklist * command: Add SMS endpoint validation against blocklist * Validate webhook endpoint against denylist on channel notification * Remove unused tests * handle deprecated denylists * remove unintended denylist entry in deprecated list * use single http client * fix tests * update comments * fixes * cleanup * address comments * fix merge --------- Co-authored-by: Livio Spring <[email protected]>
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"crypto/x509"
|
||||
"encoding/xml"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
@@ -156,6 +157,7 @@ func New(
|
||||
metadata []byte,
|
||||
certificate []byte,
|
||||
key []byte,
|
||||
httpClient *http.Client,
|
||||
options ...ProviderOpts,
|
||||
) (*Provider, error) {
|
||||
entityDescriptor, err := ParseMetadata(metadata)
|
||||
@@ -180,6 +182,7 @@ func New(
|
||||
Certificate: keyPair.Leaf,
|
||||
IDPMetadata: entityDescriptor,
|
||||
SignRequest: false,
|
||||
HTTPClient: httpClient,
|
||||
}
|
||||
provider := &Provider{
|
||||
name: name,
|
||||
|
||||
@@ -3,6 +3,7 @@ package saml
|
||||
import (
|
||||
"context"
|
||||
"encoding/xml"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -107,6 +108,7 @@ func TestProvider_BeginAuth(t *testing.T) {
|
||||
tt.fields.metadata,
|
||||
tt.fields.certificate,
|
||||
tt.fields.key,
|
||||
http.DefaultClient,
|
||||
tt.fields.options...,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
@@ -285,7 +287,7 @@ func TestProvider_Options(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
a := assert.New(t)
|
||||
|
||||
provider, err := New(tt.fields.name, tt.fields.rootURL, tt.fields.metadata, tt.fields.certificate, tt.fields.key, tt.fields.options...)
|
||||
provider, err := New(tt.fields.name, tt.fields.rootURL, tt.fields.metadata, tt.fields.certificate, tt.fields.key, http.DefaultClient, tt.fields.options...)
|
||||
if tt.want.err {
|
||||
require.Error(t, err)
|
||||
} else {
|
||||
|
||||
@@ -370,7 +370,7 @@ func TestSession_FetchUser(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
a := assert.New(t)
|
||||
|
||||
provider, err := New(tt.fields.name, tt.fields.rootURL, tt.fields.metadata, tt.fields.certificate, tt.fields.key, tt.fields.options...)
|
||||
provider, err := New(tt.fields.name, tt.fields.rootURL, tt.fields.metadata, tt.fields.certificate, tt.fields.key, http.DefaultClient, tt.fields.options...)
|
||||
require.NoError(t, err)
|
||||
|
||||
session, err := NewSession(provider, tt.args.requestID, tt.args.request)
|
||||
|
||||
Reference in New Issue
Block a user