Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
balena-register-device
Advanced tools
Balena device registration utilities.
Install balena-register-device
by running:
$ npm install --save balena-register-device
Balena-Register-Device exports a factory function, which must be called with a dependencies object, containing a configured balena-request
instance.
Example:
deviceRegister = require('balena-register-device')({
request: request # An instantiated balena-request instance
})
Generate a random key, useful for both uuid and api key.
Example:
randomKey = deviceRegister.generateUniqueKey()
# randomKey is a randomly generated key that can be used as either a uuid or an api key
console.log(randomKey)
Register a device with Balena.
Notice: You can use this function as a promise if you omit the callback
argument.
The options
object requires the following properties:
Number userId
: The user id.Number applicationId
: The application id.String uuid
: The device's UUID.String deviceType
: The device type slug.String deviceApiKey
: The API key to create for the newly registered device.String provisioningApiKey
: The provisioning API Key.String apiEndpoint
: The API endpoint.The callback
gets called with two arguments: (error, deviceInfo)
, where deviceInfo
is an object containing one property: the id
for the device that was just registered.
Example:
deviceRegister.register
userId: 199
applicationId: 10350
uuid: '...'
deviceType: 'raspberry-pi'
deviceApiKey: '...'
provisioningApiKey: '...'
apiEndpoint: 'https://api.balena-cloud.com'
, (error, deviceInfo) ->
throw error if error?
console.log(deviceInfo) # { id }
Run the test suite by doing:
$ npm test
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ npm run lint
If you're having any problem, please raise an issue on GitHub.
The project is licensed under the Apache 2.0 license.
6.0.1 - 2020-02-04
FAQs
Balena device registration utilities
The npm package balena-register-device receives a total of 9,442 weekly downloads. As such, balena-register-device popularity was classified as popular.
We found that balena-register-device demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.