apinf / emq-rest-api Goto Github PK
View Code? Open in Web Editor NEWA REST API for EMQ user and ACL rule management, built with Sails.js
License: MIT License
A REST API for EMQ user and ACL rule management, built with Sails.js
License: MIT License
Unable to authenticate with username: admin; password: test12345
- 403 response code.
Running Sails app via:
sails_permissions__adminUsername='admin' sails_permissions__adminPassword='test12345' sails lift --models.migrate='alter' --port=1339
Check that item was created:
If creating different admin user, e.g. admin1
, following error pops up:
info: sails-permissions: admin user does not exist; creating...
debug: Error (E_VALIDATION) :: 1 attribute is invalid
error: duplicate key value violates unique constraint "user_email_key"
at Connection.parseE (/home/damir/apps/emq-rest-api/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:539:11)
at Connection.parseMessage (/home/damir/apps/emq-rest-api/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:366:17)
at Socket.<anonymous> (/home/damir/apps/emq-rest-api/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:105:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:551:20)
Invalid attributes sent to undefined:
• email
• A record with that `email` already exists (`[email protected]`).
error: { [Error]
originalError:
Error (E_VALIDATION) :: 1 attribute is invalid
error: duplicate key value violates unique constraint "user_email_key"
at Connection.parseE (/home/damir/apps/emq-rest-api/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:539:11)
at Connection.parseMessage (/home/damir/apps/emq-rest-api/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:366:17)
at Socket.<anonymous> (/home/damir/apps/emq-rest-api/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:105:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:551:20)
Invalid attributes sent to undefined:
• email
• A record with that `email` already exists (`[email protected]`).
,
reason: 'NaN attributes are invalid',
code: 'E_VALIDATION',
status: 400,
invalidAttributes: { email: [ [Object] ] } }
Quoting Micheal C Feathers in his book
To me, legacy code is simply code without tests. I’ve gotten some grief for this definition. What do tests have to do with whether code is bad? To me, the answer is straightforward, and it is a point that I elaborate throughout the book:
Code without tests is bad code. It doesn’t matter how well written it is; it doesn’t mat-
ter how pretty or object-oriented or well-encapsulated it is. With tests, we can change
the behavior of our code quickly and verifiably. Without them, we really don’t know
if our code is getting better or worse
We need at least some unit testing coverage in this repository.
There are a few examples on how to write unit tests for a sails application.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.