@routr/simpleauth 2.0.5-alpha.13 → 2.0.5-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/service.js +5 -5
- package/package.json +15 -5
package/dist/service.js
CHANGED
|
@@ -22,13 +22,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
* See the License for the specific language governing permissions and
|
|
23
23
|
* limitations under the License.
|
|
24
24
|
*/
|
|
25
|
-
const logger_1 = __importDefault(require("@fonoster/logger"));
|
|
26
25
|
const common_1 = require("@routr/common");
|
|
27
|
-
const
|
|
28
|
-
const processor_1 = __importDefault(require("@routr/processor"));
|
|
26
|
+
const tracer = common_1.Tracer.init("simpleauth");
|
|
29
27
|
const api_1 = __importDefault(require("@opentelemetry/api"));
|
|
28
|
+
const logger_1 = __importDefault(require("@fonoster/logger"));
|
|
30
29
|
const common_2 = require("@routr/common");
|
|
31
|
-
const
|
|
30
|
+
const utils_1 = require("./utils");
|
|
31
|
+
const processor_1 = __importDefault(require("@routr/processor"));
|
|
32
32
|
function SimpleAuthProcessor(config) {
|
|
33
33
|
const { bindAddr, users, whiteList } = config;
|
|
34
34
|
new processor_1.default({ bindAddr, name: "simpleauth" })
|
|
@@ -51,7 +51,7 @@ function SimpleAuthProcessor(config) {
|
|
|
51
51
|
const auth = Object.assign({}, req.message.authorization);
|
|
52
52
|
auth.method = req.method;
|
|
53
53
|
// Calculate response and compare with the one send by the endpoint
|
|
54
|
-
const calcRes =
|
|
54
|
+
const calcRes = common_2.calculateAuthResponse(auth, utils_1.getCredentials(auth.username, users));
|
|
55
55
|
if (calcRes !== auth.response) {
|
|
56
56
|
return res.send(utils_1.createUnauthorizedResponse(auth.realm));
|
|
57
57
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/simpleauth",
|
|
3
|
-
"version": "2.0.5-alpha.
|
|
3
|
+
"version": "2.0.5-alpha.14",
|
|
4
4
|
"description": "This middleware delegates authentication to an external service",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -20,9 +20,19 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@fonoster/logger": "^0.3.3",
|
|
23
|
-
"@
|
|
24
|
-
"@
|
|
25
|
-
"@
|
|
23
|
+
"@grpc/grpc-js": "^1.3.7",
|
|
24
|
+
"@opentelemetry/api": "^1.0.2",
|
|
25
|
+
"@opentelemetry/exporter-jaeger": "^1.0.1",
|
|
26
|
+
"@opentelemetry/exporter-zipkin": "^1.0.1",
|
|
27
|
+
"@opentelemetry/instrumentation": "^0.27.0",
|
|
28
|
+
"@opentelemetry/instrumentation-grpc": "^0.27.0",
|
|
29
|
+
"@opentelemetry/resources": "^1.0.1",
|
|
30
|
+
"@opentelemetry/sdk-trace-base": "^1.0.1",
|
|
31
|
+
"@opentelemetry/sdk-trace-node": "^1.0.1",
|
|
32
|
+
"@opentelemetry/semantic-conventions": "^1.0.1",
|
|
33
|
+
"@routr/common": "^2.0.5-alpha.14",
|
|
34
|
+
"@routr/processor": "^2.0.5-alpha.14",
|
|
35
|
+
"google-protobuf": "^3.9.2"
|
|
26
36
|
},
|
|
27
37
|
"files": [
|
|
28
38
|
"dist"
|
|
@@ -37,5 +47,5 @@
|
|
|
37
47
|
"bugs": {
|
|
38
48
|
"url": "https://github.com/fonoster/routr/issues"
|
|
39
49
|
},
|
|
40
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "6dd8fe8ce94c72a1d669c98466bead23400875ce"
|
|
41
51
|
}
|