Skip to content

Commit

Permalink
Add example
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkarex committed Oct 11, 2023
1 parent 3247dfc commit bc5b6f8
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 4 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@ It is to be used in conjunction with an [HTTP Input node](https://cookbook.noder
Supports [bcrypt](https://en.wikipedia.org/wiki/Bcrypt) to store passwords
(such as in the [Apache password format](https://httpd.apache.org/docs/current/misc/password_encryptions.html)).

![flow.png](images/flow.png)
## Example

Example of flow, with username `test` and password `test`: [`flow.json`](./examples/flow.json)

[![flow.png](images/flow.png)](./examples/flow.json)

Can be tested with e.g.:

```sh
curl 'https://test:[email protected]/basic-auth-demo'
```

## Config

Expand Down
67 changes: 67 additions & 0 deletions examples/flow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[
{
"id": "f51d5aecb225f818",
"type": "http-basic-auth",
"z": "d9a661f4.ef966",
"name": "",
"file": "",
"cred": "",
"realm": "node-red",
"username": "test",
"password": "$2y$10$5TSZDldoJ7MxDZdtK/SG2O3cwORqLDhHabYlKX9OsM.W/Z/oLwKW6",
"x": 1040,
"y": 100,
"wires": [
[
"6ef8ccf5965075f1"
]
]
},
{
"id": "449f0a654d24daf3",
"type": "http in",
"z": "d9a661f4.ef966",
"name": "",
"url": "/basic-auth-demo",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 810,
"y": 100,
"wires": [
[
"f51d5aecb225f818"
]
]
},
{
"id": "57b04097f0b0647d",
"type": "http response",
"z": "d9a661f4.ef966",
"name": "",
"statusCode": "",
"headers": {},
"x": 1370,
"y": 100,
"wires": []
},
{
"id": "6ef8ccf5965075f1",
"type": "template",
"z": "d9a661f4.ef966",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "html",
"syntax": "plain",
"template": "<p>\nHello world!\n</p>\n",
"output": "str",
"x": 1220,
"y": 100,
"wires": [
[
"57b04097f0b0647d"
]
]
}
]
Binary file modified images/flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alexandrainst/node-red-http-basic-auth",
"version": "2.2.1",
"version": "2.2.2",
"description": "Node-RED node for HTTP Basic Authorization",
"keywords": [
"node-red",
Expand Down

0 comments on commit bc5b6f8

Please sign in to comment.