MCPcopy Create free account
hub / github.com/auth0/auth0-cli / replaceDetectionSub

Function replaceDetectionSub

internal/cli/quickstarts.go:1524–1545  ·  view source on GitHub ↗
(envValues map[string]string, tenantDomain string, client *management.Client, port int)

Source from the content-addressed store, hash-verified

1522}
1523
1524func replaceDetectionSub(envValues map[string]string, tenantDomain string, client *management.Client, port int) (map[string]string, error) {
1525 if port == 0 {
1526 port = 3000
1527 }
1528 baseURL := fmt.Sprintf("http://localhost:%d", port)
1529
1530 updatedEnvValues := make(map[string]string)
1531
1532 for key, value := range envValues {
1533 if value != auth0.DetectionSub && value != auth0.DetectionSubAsBase {
1534 updatedEnvValues[key] = value
1535 continue
1536 }
1537 resolved, err := resolveDetectionSubValue(key, tenantDomain, baseURL, client)
1538 if err != nil {
1539 return nil, err
1540 }
1541 updatedEnvValues[key] = resolved
1542 }
1543
1544 return updatedEnvValues, nil
1545}
1546
1547// resolveDetectionSubValue maps a single env key to its runtime value.
1548func resolveDetectionSubValue(key, tenantDomain, baseURL string, client *management.Client) (string, error) {

Calls 1

resolveDetectionSubValueFunction · 0.85