mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
bd5071058e
Bumps [semver](https://github.com/npm/node-semver) from 7.3.8 to 7.5.3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/npm/node-semver/releases">semver's releases</a>.</em></p> <blockquote> <h2>v7.5.3</h2> <h2><a href="https://github.com/npm/node-semver/compare/v7.5.2...v7.5.3">7.5.3</a> (2023-06-22)</h2> <h3>Bug Fixes</h3> <ul> <li><a href=" |
||
---|---|---|
.. | ||
license.js | ||
package.json | ||
README.md | ||
yarn.lock |
Fleet license key generation
This directory contains the Node script for generating Fleet license keys.
Usage
Setup
Install the JS dependencies:
yarn
Put the private key and passphrase into files (avoid using shell commands to prevent secrets from leaking into shell history). They are in the "Licensing" Vault in 1Password. Speak to @zwass or @mikermcneil if you need to get access to these secrets.
nano key.pem
nano passphrase.txt
Generate a key
Run ./license.js generate
to generate a key. For example:
./license.js generate --private-key key.pem --key-passphrase passphrase.txt --expiration 2022-01-01 --customer test --devices 100 --note 'for development only'
eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJGbGVldCBEZXZpY2UgTWFuYWdlbWVudCBJbmMuIiwiZXhwIjoxNjQwOTk1MjAwLCJzdWIiOiJkZXZlbG9wbWVudCIsImRldmljZXMiOjEwMCwibm90ZSI6ImZvciBkZXZlbG9wbWVudCBvbmx5IiwidGllciI6ImJhc2ljIiwiaWF0IjoxNjIyNDI2NTg2fQ.WmZ0kG4seW3IrNvULCHUPBSfFdqj38A_eiXdV_DFunMHechjHbkwtfkf1J6JQJoDyqn8raXpgbdhafDwv3rmDw
See ./license.js generate --help
for more details on arguments.
Key format
License keys are JWTs signed with the ES256
method.
Check the contents of a key with https://jwt.io/.
The key generated above contains the following payload:
{
"iss": "Fleet Device Management Inc.",
"exp": 1640995200,
"sub": "development",
"devices": 100,
"note": "for development only",
"tier": "premium",
"iat": 1622426586
}
devices
refers to the number of licensed devices.note
includes any additional note about the terms of the license.tier
is the license Tier: currentlypremium
= paid,free
= free (though we do not plan to issue license keys forfree
)- Other claims use the meanings described in the JWT specification.