MCPcopy Create free account
hub / github.com/supabase/auth / newSAMLTestAPI

Function newSAMLTestAPI

internal/api/saml_test.go:68–87  ·  view source on GitHub ↗

newSAMLTestAPI builds a minimal API with SAML enabled using the given key(s).

(t *tst.T, primaryKey, nextKey string, allowEncrypted bool)

Source from the content-addressed store, hash-verified

66
67// newSAMLTestAPI builds a minimal API with SAML enabled using the given key(s).
68func newSAMLTestAPI(t *tst.T, primaryKey, nextKey string, allowEncrypted bool) (*API, error) {
69 t.Helper()
70 config, err := confload.LoadGlobal(apiTestConfig)
71 if err != nil {
72 return nil, err
73 }
74 config.API.ExternalURL = "https://projectref.supabase.co/auth/v1/"
75 config.API.MaxRequestDuration = 5 * time.Second
76 config.SAML.Enabled = true
77 config.SAML.PrivateKey = primaryKey
78 config.SAML.PrivateKeyNext = nextKey
79 config.SAML.AllowEncryptedAssertions = allowEncrypted
80 if err := config.ApplyDefaults(); err != nil {
81 return nil, err
82 }
83 if err := config.SAML.PopulateFields(config.API.ExternalURL); err != nil {
84 return nil, err
85 }
86 return NewAPI(config, nil), nil
87}
88
89// samlMetadataRequest issues a GET /sso/saml/metadata and parses the response.
90func samlMetadataRequest(t *tst.T, api *API) (*saml.EntityDescriptor, http.Header) {

Calls 4

LoadGlobalFunction · 0.92
NewAPIFunction · 0.85
ApplyDefaultsMethod · 0.80
PopulateFieldsMethod · 0.80

Tested by

no test coverage detected