Files
Bose-SoundTouch/pkg/service/spotify/zeroconf.go
T
Tobias GesellchenandClaude Sonnet 4.6 466e9eca97 feat: extract shared ZeroConf package and add Amazon Music OAuth service
- Extract DH key exchange crypto from pkg/service/spotify into new
  pkg/service/zeroconf package with exported functions and
  AuthTypeOAuthToken constant (both Spotify and Amazon use auth type 4)
- Reduce pkg/service/spotify/zeroconf.go to thin wrappers around the
  shared package; public API (PushSpotifyCredentials, ZeroConfGetInfo)
  is preserved
- Add pkg/service/amazon package mirroring the Spotify service with
  Amazon-specific differences: LWA endpoints, POST body credentials
  (not Basic Auth), user_id/name profile fields, amazon/accounts.json
- Add PushAmazonCredentials delegating to shared zeroconf.PushCredentials

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 20:30:06 +02:00

16 lines
707 B
Go

package spotify
import "github.com/gesellix/bose-soundtouch/pkg/service/zeroconf"
// ZeroConfGetInfo fetches the speaker's DH public key via GET ?action=getInfo.
func ZeroConfGetInfo(zcBaseURL string) ([]byte, error) {
return zeroconf.GetInfo(zcBaseURL)
}
// PushSpotifyCredentials pushes Spotify credentials to a speaker using the full
// ZeroConf DH key exchange protocol. Falls back to simplified token push if
// the speaker does not support DH (older firmware).
// zcBaseURL is the base URL of the ZeroConf endpoint, e.g. "http://192.168.1.10:8200/zc".
func PushSpotifyCredentials(zcBaseURL, username, accessToken string) error {
return zeroconf.PushCredentials(zcBaseURL, username, accessToken)
}