mirror of
https://github.com/fleetdm/fleet
synced 2026-05-05 06:18:25 +00:00
Changes: - Updated the `expiresAt` input description in `api/controllers/admin/generate-license-key.js` and `api/helpers/create-license-key.js` - Updated timestamps sent to `generate-license-key` and `create-license-key` to be in seconds. . . Co-authored-by: Mike McNeil <[email protected]>
49 lines
913 B
JavaScript
Vendored
49 lines
913 B
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'Generate license key',// FUTURE: Rename this to avoid confusion w/ generators. For example: 'Build license key'
|
|
|
|
|
|
description: 'Generate 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.',
|
|
}
|
|
},
|
|
|
|
|
|
exits: {
|
|
success: {
|
|
outputFriendlyName: 'License key',
|
|
outputType: 'string',
|
|
},
|
|
},
|
|
|
|
|
|
fn: async function ({numberOfHosts, organization, expiresAt}) {
|
|
|
|
let licenseKey = await sails.helpers.createLicenseKey.with({
|
|
numberOfHosts: numberOfHosts,
|
|
organization: organization,
|
|
expiresAt: expiresAt
|
|
});
|
|
|
|
return licenseKey;
|
|
}
|
|
|
|
|
|
};
|