mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge branch 'dev' into i18n-port-label
This commit is contained in:
@@ -159,6 +159,11 @@
|
||||
that.uiSelect.css("margin"+d,m);
|
||||
that.input.css("margin"+d,0);
|
||||
});
|
||||
|
||||
["type","placeholder"].forEach(function(d) {
|
||||
var m = that.element.attr(d);
|
||||
that.input.attr(d,m);
|
||||
});
|
||||
|
||||
this.uiSelect.addClass("red-ui-typedInput-container");
|
||||
|
||||
|
@@ -49,11 +49,19 @@
|
||||
<label for="node-input-useAuth" style="width: 70%;"><span data-i18n="httpin.basicauth"></span></label>
|
||||
<div style="margin-left: 20px" class="node-input-useAuth-row hide">
|
||||
<div class="form-row">
|
||||
<label for="node-input-authType"><i class="fa fa-user-secret "></i> <span data-i18n="httpin.label.authType"></span></label>
|
||||
<select type="text" id="node-input-authType" style="width:70%;">
|
||||
<option value="basic" data-i18n="httpin.basic"></option>
|
||||
<option value="digest" data-i18n="httpin.digest"></option>
|
||||
<option value="bearer" data-i18n="httpin.bearer"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-row node-input-basic-row">
|
||||
<label for="node-input-user"><i class="fa fa-user"></i> <span data-i18n="common.label.username"></span></label>
|
||||
<input type="text" id="node-input-user">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-password"><i class="fa fa-lock"></i> <span data-i18n="common.label.password"></span></label>
|
||||
<label for="node-input-password"> <i class="fa fa-lock"></i> <span data-i18n="common.label.password" id="node-span-password"></span><span data-i18n="httpin.label.bearerToken" id="node-span-token" style="display:none"></span></label>
|
||||
<input type="password" id="node-input-password">
|
||||
</div>
|
||||
</div>
|
||||
@@ -93,7 +101,8 @@
|
||||
paytoqs: {value: false},
|
||||
url:{value:"",validate:function(v) { return (v.trim().length === 0) || (v.indexOf("://") === -1) || (v.trim().indexOf("http") === 0)} },
|
||||
tls: {type:"tls-config",required: false},
|
||||
proxy: {type:"http proxy",required: false}
|
||||
proxy: {type:"http proxy",required: false},
|
||||
authType: {value: "basic"}
|
||||
},
|
||||
credentials: {
|
||||
user: {type:"text"},
|
||||
@@ -119,12 +128,29 @@
|
||||
$("#node-input-useAuth").change(function() {
|
||||
if ($(this).is(":checked")) {
|
||||
$(".node-input-useAuth-row").show();
|
||||
// Nodes (< version 0.20.x) with credentials but without authentication type, need type 'basic'
|
||||
if (!$('#node-input-authType').val()) {
|
||||
$('#node-input-authType').val('basic');
|
||||
}
|
||||
} else {
|
||||
$(".node-input-useAuth-row").hide();
|
||||
$('#node-input-authType').val('');
|
||||
$('#node-input-user').val('');
|
||||
$('#node-input-password').val('');
|
||||
}
|
||||
});
|
||||
$("#node-input-authType").change(function() {
|
||||
if ($(this).val() == "basic" || $(this).val() == "digest") {
|
||||
$(".node-input-basic-row").show();
|
||||
$('#node-span-password').show();
|
||||
$('#node-span-token').hide();
|
||||
} else if ($(this).val() == "bearer") {
|
||||
$(".node-input-basic-row").hide();
|
||||
$('#node-span-password').hide();
|
||||
$('#node-span-token').show();
|
||||
$('#node-input-user').val('');
|
||||
}
|
||||
});
|
||||
$("#node-input-method").change(function() {
|
||||
if ($(this).val() == "GET") {
|
||||
$(".node-input-paytoqs-row").show();
|
||||
|
@@ -33,6 +33,7 @@ module.exports = function(RED) {
|
||||
var tlsNode = RED.nodes.getNode(n.tls);
|
||||
}
|
||||
this.ret = n.ret || "txt";
|
||||
this.authType = n.authType || "basic";
|
||||
if (RED.settings.httpRequestTimeout) { this.reqTimeout = parseInt(RED.settings.httpRequestTimeout) || 120000; }
|
||||
else { this.reqTimeout = 120000; }
|
||||
|
||||
@@ -175,11 +176,29 @@ module.exports = function(RED) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.credentials && this.credentials.user) {
|
||||
opts.auth = {
|
||||
user: this.credentials.user,
|
||||
pass: this.credentials.password||""
|
||||
};
|
||||
if (this.credentials) {
|
||||
if (this.authType === "basic") {
|
||||
if (this.credentials.user) {
|
||||
opts.auth = {
|
||||
user: this.credentials.user,
|
||||
pass: this.credentials.password || ""
|
||||
};
|
||||
}
|
||||
} else if (this.authType === "digest") {
|
||||
if (this.credentials.user) {
|
||||
// The first request will be send without auth information. Based on the 401 response, the library can determine
|
||||
// which auth type is required by the server. Then the request is resubmitted the with the appropriate auth header.
|
||||
opts.auth = {
|
||||
user: this.credentials.user,
|
||||
pass: this.credentials.password || "",
|
||||
sendImmediately: false
|
||||
};
|
||||
}
|
||||
} else if (this.authType === "bearer") {
|
||||
opts.auth = {
|
||||
bearer: this.credentials.password || ""
|
||||
};
|
||||
}
|
||||
}
|
||||
var payload = null;
|
||||
|
||||
|
@@ -402,11 +402,16 @@
|
||||
"utf8String": "UTF8 string",
|
||||
"binaryBuffer": "binary buffer",
|
||||
"jsonObject": "parsed JSON object"
|
||||
"authType": "Type",
|
||||
"bearerToken": "Token"
|
||||
},
|
||||
"setby": "- set by msg.method -",
|
||||
"basicauth": "Use basic authentication",
|
||||
"basicauth": "Use authentication",
|
||||
"use-tls": "Enable secure (SSL/TLS) connection",
|
||||
"tls-config":"TLS Configuration",
|
||||
"basic": "basic authentication",
|
||||
"digest": "digest authentication",
|
||||
"bearer": "bearer authentication",
|
||||
"use-proxy": "Use proxy",
|
||||
"proxy-config": "Proxy Configuration",
|
||||
"use-proxyauth": "Use proxy authentication",
|
||||
|
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* A WebSocket connection between the runtime and the editor.
|
||||
* @typedef CommsConnection
|
||||
* @type {object}
|
||||
* @property {string} session - a unique session identifier
|
||||
|
@@ -388,14 +388,14 @@ function stop(type,diff,muteLog) {
|
||||
if (activeFlows.hasOwnProperty(id)) {
|
||||
var flowStateChanged = diff && (diff.added.indexOf(id) !== -1 || diff.removed.indexOf(id) !== -1);
|
||||
log.debug("red/nodes/flows.stop : stopping flow : "+id);
|
||||
promises = promises.concat(activeFlows[id].stop(flowStateChanged?null:stopList,removedList));
|
||||
promises.push(activeFlows[id].stop(flowStateChanged?null:stopList,removedList));
|
||||
if (type === "full" || flowStateChanged || diff.removed.indexOf(id)!==-1) {
|
||||
delete activeFlows[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.resolve(promises).then(function() {
|
||||
return Promise.all(promises).then(function() {
|
||||
for (id in activeNodesToFlow) {
|
||||
if (activeNodesToFlow.hasOwnProperty(id)) {
|
||||
if (!activeFlows[activeNodesToFlow[id]]) {
|
||||
|
@@ -413,7 +413,7 @@ function setObjectProperty(msg,prop,value,createMissing) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*!
|
||||
* Get value of environment variable.
|
||||
* @param {Node} node - accessing node
|
||||
* @param {String} name - name of variable
|
||||
@@ -439,7 +439,7 @@ function getSetting(node, name) {
|
||||
* @param {String} value - the string to parse
|
||||
* @param {Node} node - the node evaluating the property
|
||||
* @return {String} The parsed string
|
||||
* @memberof @node-red/util_util
|
||||
* @memberof @node-red/util_util
|
||||
*/
|
||||
function evaluateEnvProperty(value, node) {
|
||||
var result;
|
||||
|
Reference in New Issue
Block a user