mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-18 16:46:17 +00:00
refactor(cli): call /api/setup/* from soundtouch-cli (refs #451)
Point the CLI's service calls at the new canonical paths: tts speak (/api/setup/tts/speak) and the CA bundle fetch (/api/setup/ca.crt), plus the user-facing message and doc comment. No behavior change; legacy paths still work. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
21742cfbf6
commit
dbdc75627a
@@ -606,7 +606,7 @@ func setupInstallCACmd() *cli.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("Fetched %d bytes of CA PEM from %s/setup/ca.crt\n", len(certPEM), serviceURL)
|
||||
fmt.Printf("Fetched %d bytes of CA PEM from %s/api/setup/ca.crt\n", len(certPEM), serviceURL)
|
||||
|
||||
m := setup.NewManager(serviceURL, nil, nil)
|
||||
|
||||
@@ -627,11 +627,11 @@ func setupInstallCACmd() *cli.Command {
|
||||
}
|
||||
}
|
||||
|
||||
// fetchCACert pulls AfterTouch's CA bundle from /setup/ca.crt. On HTTP 401
|
||||
// fetchCACert pulls AfterTouch's CA bundle from /api/setup/ca.crt. On HTTP 401
|
||||
// it prompts interactively for basic-auth credentials (or accepts --auth)
|
||||
// and retries once.
|
||||
func fetchCACert(serviceURL, authFlag string) ([]byte, error) {
|
||||
url := serviceURL + "/setup/ca.crt"
|
||||
url := serviceURL + "/api/setup/ca.crt"
|
||||
|
||||
doRequest := func(user, pass string) (*http.Response, error) {
|
||||
req, err := http.NewRequest(http.MethodGet, url, nil)
|
||||
|
||||
@@ -101,7 +101,7 @@ func ttsCloud(c *cli.Context) error {
|
||||
return fmt.Errorf("marshal request: %w", err)
|
||||
}
|
||||
|
||||
req, err := http.NewRequest(http.MethodPost, serviceURL+"/setup/tts/speak", bytes.NewReader(body))
|
||||
req, err := http.NewRequest(http.MethodPost, serviceURL+"/api/setup/tts/speak", bytes.NewReader(body))
|
||||
if err != nil {
|
||||
return fmt.Errorf("build request: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user