Strip email local-part from cassette guard failure → Wire 13 access-review connectors in Helm chart
- Strip email local-part from cassette guard failure - Drop dead src/components/connectors vite include - Cover all 13 access-review providers in builder test - Wire 13 access-review connectors in Helm chart Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
@@ -96,14 +96,19 @@ func TestCassettesUseSyntheticEmails(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Log the domain (actionable) but never the local-part
|
||||
// — a failed assertion ends up in CI logs, and the whole
|
||||
// point of this guard is to keep PII out of those logs.
|
||||
// Operators can grep the cassette locally to identify the
|
||||
// offending row.
|
||||
assert.Truef(
|
||||
t,
|
||||
ok,
|
||||
"cassette %s contains email %q with non-synthetic domain %q; "+
|
||||
"cassette %s contains an email with non-synthetic domain %q; "+
|
||||
"either replace with a synthetic *.example.com address or "+
|
||||
"add the domain to allowedExactDomains in cassette_safety_test.go "+
|
||||
"with a justification",
|
||||
filepath.Base(cassette), email, domain,
|
||||
filepath.Base(cassette), domain,
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -17,6 +17,7 @@ package bootstrap
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -436,15 +437,20 @@ func TestBuilder_Build_Microsoft365Connector(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestBuilder_Build_AccessReviewConnectors(t *testing.T) {
|
||||
// All non-Vercel access-review providers added by this PR. Vercel
|
||||
// has its own dedicated test because it carries an additional
|
||||
// CONNECTOR_VERCEL_INTEGRATION_SLUG env var.
|
||||
providers := []string{
|
||||
"GITLAB", "BITBUCKET", "HEROKU", "PAGERDUTY",
|
||||
"ASANA", "SNYK", "NETLIFY", "RAMP", "CLICKUP",
|
||||
"MONDAY", "LEVER", "DEEL",
|
||||
}
|
||||
|
||||
env := requiredEnv()
|
||||
env["CONNECTOR_GITLAB_CLIENT_ID"] = "gitlab-id"
|
||||
env["CONNECTOR_GITLAB_CLIENT_SECRET"] = "gitlab-secret"
|
||||
env["CONNECTOR_BITBUCKET_CLIENT_ID"] = "bitbucket-id"
|
||||
env["CONNECTOR_BITBUCKET_CLIENT_SECRET"] = "bitbucket-secret"
|
||||
env["CONNECTOR_PAGERDUTY_CLIENT_ID"] = "pagerduty-id"
|
||||
env["CONNECTOR_PAGERDUTY_CLIENT_SECRET"] = "pagerduty-secret"
|
||||
env["CONNECTOR_DEEL_CLIENT_ID"] = "deel-id"
|
||||
env["CONNECTOR_DEEL_CLIENT_SECRET"] = "deel-secret"
|
||||
for _, provider := range providers {
|
||||
env["CONNECTOR_"+provider+"_CLIENT_ID"] = strings.ToLower(provider) + "-id"
|
||||
env["CONNECTOR_"+provider+"_CLIENT_SECRET"] = strings.ToLower(provider) + "-secret"
|
||||
}
|
||||
|
||||
b := NewBuilder(mockEnv(env))
|
||||
b.samlCertificate = "test-cert"
|
||||
@@ -453,13 +459,13 @@ func TestBuilder_Build_AccessReviewConnectors(t *testing.T) {
|
||||
cfg, err := b.Build()
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Len(t, cfg.Probod.Connectors, 4)
|
||||
require.Len(t, cfg.Probod.Connectors, len(providers))
|
||||
byProvider := make(map[string]probodconfig.ConnectorConfig, len(cfg.Probod.Connectors))
|
||||
for _, c := range cfg.Probod.Connectors {
|
||||
byProvider[c.Provider] = c
|
||||
}
|
||||
|
||||
for _, provider := range []string{"GITLAB", "BITBUCKET", "PAGERDUTY", "DEEL"} {
|
||||
for _, provider := range providers {
|
||||
c, ok := byProvider[provider]
|
||||
require.True(t, ok, "missing %s connector", provider)
|
||||
assert.Equal(t, "oauth2", string(c.Protocol))
|
||||
|
||||
Reference in New Issue
Block a user