From 88b21a43a3139d22f4c1ea96d5ccfc292e8a5121 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 10 Oct 2023 13:20:37 +0200 Subject: [PATCH] Remove Digest method Based on obsolete MD5 --- README.md | 9 +-- nodes/http-auth-cred.html | 12 +--- nodes/http-auth-cred.js | 1 - nodes/http-auth-file.html | 10 +-- nodes/http-auth-file.js | 1 - nodes/http-auth.html | 22 ++----- nodes/http-auth.js | 130 +------------------------------------- 7 files changed, 16 insertions(+), 169 deletions(-) diff --git a/README.md b/README.md index 91fa78a..83e52e2 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # node-red-contrib-httpauth -Node-RED node for HTTP Basic/Digest Auth +Node-RED node for HTTP Basic Auth. -This Node-RED module performs Basic and Digest authentication. -It is to be used in conjunction with an http input node. +This Node-RED module performs HTTP Basic authentication. +It is to be used in conjunction with an HTTP Input node. ![flow.png](images/flow.png) @@ -19,11 +19,8 @@ There are three type of configuration: With all three config types you must specify the following: - - Auth Type: what authentication type will be used: Basic, Digest - Realm: what realm will be used with this node - Hashed: are the passwords in the Password field or in the credentials file hashed. - This field is only relavent if Auth Type is Digest. It has no effect on Basic. - Hash format: MD5(Username:Realm:Password) With Shared and Not Shared config types you must specify the following: diff --git a/nodes/http-auth-cred.html b/nodes/http-auth-cred.html index 6092a34..0192626 100644 --- a/nodes/http-auth-cred.html +++ b/nodes/http-auth-cred.html @@ -4,13 +4,14 @@ category: 'config', defaults: { name: { value: '' }, - authType: { value: 'Basic', required: true }, realm: { value: '', required: true }, username: { value: '', required: true }, password: { value: '', required: true }, hashed: { value: false, required: true }, }, - label: function () { return this.name.trim() || '[' + this.authType + '] ' + this.realm.trim() + ':' + this.username.trim() + ':*****'; }, + label: function () { + return this.name.trim() || this.realm.trim() + ':' + this.username.trim() + ':*****'; + }, }); @@ -19,13 +20,6 @@ -
- - -
diff --git a/nodes/http-auth-cred.js b/nodes/http-auth-cred.js index 3d8f6bf..941ce88 100644 --- a/nodes/http-auth-cred.js +++ b/nodes/http-auth-cred.js @@ -4,7 +4,6 @@ module.exports = function (RED) { function HttpAuthCredNode(config) { RED.nodes.createNode(this, config); - this.authType = config.authType; this.realm = config.realm; this.username = config.username; this.password = config.password; diff --git a/nodes/http-auth-file.html b/nodes/http-auth-file.html index 917cb21..fca4eb4 100644 --- a/nodes/http-auth-file.html +++ b/nodes/http-auth-file.html @@ -4,13 +4,12 @@ category: 'config', defaults: { name: { value: '' }, - authType: { value: 'Basic', required: true }, realm: { value: '', required: true }, filePath: { value: '', required: true }, hashed: { value: false, required: true }, }, label: function () { - return this.name.trim() || '[' + this.authType + '] ' + this.realm.trim() + ':' + this.filePath.trim(); + return this.name.trim() || this.realm.trim() + ':' + this.filePath.trim(); }, }); @@ -20,13 +19,6 @@
-
- - -
diff --git a/nodes/http-auth-file.js b/nodes/http-auth-file.js index 0872882..e2dcab6 100644 --- a/nodes/http-auth-file.js +++ b/nodes/http-auth-file.js @@ -36,7 +36,6 @@ module.exports = function (RED) { } } - this.authType = config.authType; this.realm = config.realm; this.getUser = function (_realm, _username) { const _realmL = _realm.trim().toLowerCase(); diff --git a/nodes/http-auth.html b/nodes/http-auth.html index 14461eb..a242439 100644 --- a/nodes/http-auth.html +++ b/nodes/http-auth.html @@ -8,7 +8,6 @@ name: { value: '' }, file: { value: '', type: 'node-red-contrib-httpauthfile', required: false }, cred: { value: '', type: 'node-red-contrib-httpauthcred', required: false }, - authType: { value: 'Basic' }, realm: { value: '' }, username: { value: '' }, password: { value: '' }, @@ -38,13 +37,6 @@

-
- - -
@@ -64,9 +56,12 @@