mirror of
https://github.com/coder/coder.git
synced 2026-10-29 17:44:33 +08:00
chore: add additional fields to license telemetry (#11173)
This sends the email the license was issued to, and whether or not it's a trial in the telemetry payload. It's a bit janky since the license parsing is all enterprise licensed.
This commit is contained in:
@@ -109,6 +109,13 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
|
||||
}
|
||||
}()
|
||||
|
||||
api.AGPL.Options.ParseLicenseClaims = func(rawJWT string) (email string, trial bool, err error) {
|
||||
c, err := license.ParseClaims(rawJWT, Keys)
|
||||
if err != nil {
|
||||
return "", false, err
|
||||
}
|
||||
return c.Subject, c.Trial, nil
|
||||
}
|
||||
api.AGPL.Options.SetUserGroups = api.setUserGroups
|
||||
api.AGPL.Options.SetUserSiteRoles = api.setUserSiteRoles
|
||||
api.AGPL.SiteHandler.AppearanceFetcher = api.fetchAppearanceConfig
|
||||
|
||||
@@ -9,9 +9,8 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/coder/coder/v2/coderd/database"
|
||||
"github.com/coder/coder/v2/coderd/database/dbtime"
|
||||
|
||||
Reference in New Issue
Block a user