AddLicense generates a new license with the options provided and inserts it.
(t *testing.T, client *codersdk.Client, options LicenseOptions)
| 254 | |
| 255 | // AddLicense generates a new license with the options provided and inserts it. |
| 256 | func AddLicense(t *testing.T, client *codersdk.Client, options LicenseOptions) codersdk.License { |
| 257 | l, err := client.AddLicense(context.Background(), codersdk.AddLicenseRequest{ |
| 258 | License: GenerateLicense(t, options), |
| 259 | }) |
| 260 | require.NoError(t, err) |
| 261 | return l |
| 262 | } |
| 263 | |
| 264 | // GenerateLicense returns a signed JWT using the test key. |
| 265 | func GenerateLicense(t *testing.T, options LicenseOptions) string { |