Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 4352fca

Browse files
authored
Small fix to licenseKey encoding (#769)
So that it's not base64 re-encoded
1 parent 1e0eb3e commit 4352fca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

quesma/licensing/license_manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type InstallationIDPayload struct {
2121
}
2222

2323
type LicensePayload struct {
24-
LicenseKey []byte `json:"license_key"`
24+
LicenseKey string `json:"license_key"`
2525
}
2626

2727
// obtainLicenseKey presents an InstallationId to the license server and receives a LicenseKey in return
@@ -46,7 +46,7 @@ func (l *LicenseModule) obtainLicenseKey() (err error) {
4646
if err = json.Unmarshal(body, &licenseResponse); err != nil {
4747
return err
4848
}
49-
l.LicenseKey = licenseResponse.LicenseKey
49+
l.LicenseKey = []byte(licenseResponse.LicenseKey)
5050
fmt.Printf("License key obtained and set successfully, key=[%s.....%s]\n", string(l.LicenseKey[:8]), string(l.LicenseKey[len(l.LicenseKey)-8:]))
5151
return nil
5252
}
@@ -68,7 +68,7 @@ func (l *LicenseModule) processLicense() error {
6868

6969
func (l *LicenseModule) fetchLicense() (a *License, err error) {
7070
var payloadBytes []byte
71-
if payloadBytes, err = json.Marshal(LicensePayload{LicenseKey: l.LicenseKey}); err != nil {
71+
if payloadBytes, err = json.Marshal(LicensePayload{LicenseKey: string(l.LicenseKey)}); err != nil {
7272
return nil, err
7373
}
7474
resp, err := http.Post(verifyLicenseEndpoint, "application/json", bytes.NewReader(payloadBytes))

0 commit comments

Comments
 (0)