-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Automatic test * Complete test * npm update
- Loading branch information
Showing
5 changed files
with
87 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
/** | ||
* Command-line interface for Node-RED nodes. | ||
* | ||
* Script to run our Node-RED nodes from terminal without Node-RED and using STDIN / STDOUT. | ||
* | ||
* @author Alexandre Alapetite <https://github.com/Alkarex> | ||
* @copyright Alexandra Institute <https://alexandra.dk> for the SynchroniCity European project <https://synchronicity-iot.eu> | ||
* as a contribution to FIWARE <https://www.fiware.org> | ||
* @license MIT | ||
* @date 2019-11-28 / 2022-02-02 | ||
*/ | ||
|
||
// Load fake/mocked Node-RED | ||
const RED = require('node-red-contrib-mock-cli'); | ||
const noderedNode = RED.load(require.main); | ||
|
||
if (noderedNode) { | ||
RED.run(); | ||
} else { | ||
console.error('Error loading Node-RED node!'); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/sh | ||
|
||
test=$( | ||
cat <<'EOF' | node ./index.js http-basic-auth --realm='"node-red"' --username='"test"' --password='"$2y$10$5TSZDldoJ7MxDZdtK/SG2O3cwORqLDhHabYlKX9OsM.W/Z/oLwKW6"' | ||
{"req":{"headers":{"authorization":"Basic dGVzdDp0ZXN0"}}} | ||
EOF | ||
) | ||
|
||
if [ "$test" = "" ]; then | ||
echo 'ERROR 1' | ||
exit 1 | ||
fi | ||
|
||
test=$( | ||
cat <<'EOF' | node ./index.js http-basic-auth --realm='"node-red"' --username='"test"' --password='"test"' | ||
{"req":{"headers":{"authorization":"Basic dGVzdDp0ZXN0"}}} | ||
EOF | ||
) | ||
|
||
if [ "$test" = "" ]; then | ||
echo 'ERROR 2' | ||
exit 1 | ||
fi | ||
|
||
test=$( | ||
cat <<'EOF' | node ./index.js http-basic-auth --realm='"node-red"' --username='"wrong"' --password='"$2y$10$5TSZDldoJ7MxDZdtK/SG2O3cwORqLDhHabYlKX9OsM.W/Z/oLwKW6"' | ||
{"req":{"headers":{"authorization":"Basic dGVzdDp0ZXN0"}}} | ||
EOF | ||
) | ||
|
||
if [ "$test" != "" ]; then | ||
echo 'ERROR 3' | ||
exit 1 | ||
fi | ||
|
||
test=$( | ||
cat <<'EOF' | node ./index.js http-basic-auth --realm='"node-red"' --username='"test"' --password='"wrong"' | ||
{"req":{"headers":{"authorization":"Basic dGVzdDp0ZXN0"}}} | ||
EOF | ||
) | ||
|
||
if [ "$test" != "" ]; then | ||
echo 'ERROR 4' | ||
exit 1 | ||
fi |