mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00: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
|
||||
|
Reference in New Issue
Block a user