mirror of
https://github.com/fleetdm/fleet
synced 2026-05-15 21:18:29 +00:00
Closes: https://github.com/fleetdm/confidential/issues/3230 Changes: - Added a new (optional) input to the admin license key generator: `partnerName`. - Renamed `admin/generate-license-key.js` to `admin/build-license-key.js`, updated routes and regenerated `cloud.setup.js` - Updated the create license key helper to add a `partner` field to the generated license key if `partnerName` is provided.
55 lines
1,004 B
JavaScript
Vendored
55 lines
1,004 B
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'Build license key',
|
|
|
|
|
|
description: 'Build and return a Fleet Premium license key.',
|
|
|
|
|
|
inputs: {
|
|
numberOfHosts: {
|
|
type: 'number',
|
|
required: true,
|
|
},
|
|
|
|
organization: {
|
|
type: 'string',
|
|
required: true,
|
|
},
|
|
|
|
expiresAt: {
|
|
type: 'number',
|
|
required: true,
|
|
description: 'A JS timestamp representing when this license will expire.',
|
|
},
|
|
|
|
partnerName: {
|
|
type: 'string',
|
|
description: 'The name of the partner that will be reselling the generated license.',
|
|
}
|
|
},
|
|
|
|
|
|
exits: {
|
|
success: {
|
|
outputFriendlyName: 'License key',
|
|
outputType: 'string',
|
|
},
|
|
},
|
|
|
|
|
|
fn: async function ({numberOfHosts, organization, expiresAt, partnerName}) {
|
|
|
|
let licenseKey = await sails.helpers.createLicenseKey.with({
|
|
numberOfHosts: numberOfHosts,
|
|
organization: organization,
|
|
expiresAt: expiresAt,
|
|
partnerName: partnerName,
|
|
});
|
|
|
|
return licenseKey;
|
|
}
|
|
|
|
|
|
};
|