Skip to content

glooctl license validate looks for outdated license format #11022

Description

@Nadine2016

Gloo Edge Product

Open Source

Gloo Edge Version

1.19

Kubernetes Version

1.32

Describe the bug

When running the glooctl license validate command with a Gloo Edge or Gloo Gateway license, the command always returns

Error: can't parse license key.

Looking at the source code

func validateLicense(licenseKey string) error {
var licenseClaims LicenseClaims
_, _, err := new(jwt.Parser).ParseUnverified(licenseKey, &licenseClaims)
if err != nil {
return fmt.Errorf("can't parse license key")
}
fmt.Print(formatLicenseDetail(licenseClaims.CreationDate, licenseClaims.ExpirationDate, licenseClaims.Product, licenseClaims.LicenseType == "trial"))
return nil
}
func validateLegacyLicense(licenseKey string) error {
var licenseLegacyClaim LicenseLegacyClaims
var standardizedLicenseKey = base64.RawURLEncoding.EncodeToString([]byte(`{"alg":"HS256","typ":"JWT"}`)) + "." + licenseKey
_, _, err := new(jwt.Parser).ParseUnverified(standardizedLicenseKey, &licenseLegacyClaim)
if err != nil {
return fmt.Errorf("can't parse license key")
}
fmt.Print(formatLicenseDetail(licenseLegacyClaim.Iat, licenseLegacyClaim.Exp, licenseLegacyClaim.Product, licenseLegacyClaim.LicType == "trial"))
return nil
}
we seem to be looking for a CreationDate and ExpirationDate.

The current format however seems to use IssuedAt and ExpiresAt.

Expected Behavior

the glooctl license validate should show the result for a validated license

Steps to reproduce the bug

Run glooctl license validate with a new Gloo Edge or Gloo Gateway license key.

Additional Environment Detail

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    PrioritizedIndicating issue prioritized to be worked on in RFE streamZendeskstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions