mirror of
https://github.com/fleetdm/fleet
synced 2026-05-21 16:08:47 +00:00
* create admin/generate-license page * create generate-license-key action, update routes, policies, importer, regenerate cloud-sdk * update layouts * use moment * Update view-generate-license.js * Fixing lint errors * Update generate-license-key.js * Update redirects in is-super-admin policy * redirect super admins to the license generator * Update login form * requested changes from mike-j-thomas * Update generate-license.page.js * Update is-super-admin.js * Update view-login.js * Update generate-license-key.js * Update generate-license-key.js * use naming convention for js timestamps * validTo » expiresAt Co-authored-by: Mike McNeil <[email protected]>
49 lines
912 B
JavaScript
Vendored
49 lines
912 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;
|
|
}
|
|
|
|
|
|
};
|