Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hyperledger/cactus-core

Package Overview
Dependencies
Maintainers
7
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hyperledger/cactus-core - npm Package Compare versions

Comparing version 0.4.2-main.b067fdd.29 to 0.5.0-alpha.0

dist/lib/main/typescript/consensus-has-transaction-finality.js

13

CHANGELOG.md

@@ -6,2 +6,15 @@ # Change Log

# [0.5.0-alpha.0](https://github.com/hyperledger/cactus/compare/v0.4.1...v0.5.0-alpha.0) (2021-05-06)
### Features
* **core:** add plugin registry log level constructor arg ([1652b33](https://github.com/hyperledger/cactus/commit/1652b33255c211e87e33ceb3e421cb9fb4182502))
* **core-api:** hasTransactionFinality() on connector API [#354](https://github.com/hyperledger/cactus/issues/354) ([a2d0582](https://github.com/hyperledger/cactus/commit/a2d058218780e5e4c81e5f847cc875879a946e3f))
* **core-api:** jwt authorization [#770](https://github.com/hyperledger/cactus/issues/770) ([2016750](https://github.com/hyperledger/cactus/commit/2016750849b4333bb4dd78897468771f0642a4f5))
## [0.4.1](https://github.com/hyperledger/cactus/compare/v0.4.0...v0.4.1) (2021-04-02)

@@ -8,0 +21,0 @@

8

dist/lib/main/typescript/public-api.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConsortiumRepository = exports.PluginRegistry = exports.registerWebServiceEndpoint = void 0;
exports.consensusHasTransactionFinality = exports.AuthorizationOptionsProvider = exports.ConsortiumRepository = exports.PluginRegistry = exports.registerWebServiceEndpoint = void 0;
var register_web_service_endpoint_1 = require("./web-services/register-web-service-endpoint");

@@ -10,2 +10,6 @@ Object.defineProperty(exports, "registerWebServiceEndpoint", { enumerable: true, get: function () { return register_web_service_endpoint_1.registerWebServiceEndpoint; } });

Object.defineProperty(exports, "ConsortiumRepository", { enumerable: true, get: function () { return consortium_repository_1.ConsortiumRepository; } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tYWluL3R5cGVzY3JpcHQvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw4RkFBMEY7QUFBakYsMklBQUEsMEJBQTBCLE9BQUE7QUFDbkMscURBQTJFO0FBQTFDLGlIQUFBLGNBQWMsT0FBQTtBQUMvQyxpRUFHaUM7QUFGL0IsNkhBQUEsb0JBQW9CLE9BQUEifQ==
var authorization_options_provider_1 = require("./web-services/authorization-options-provider");
Object.defineProperty(exports, "AuthorizationOptionsProvider", { enumerable: true, get: function () { return authorization_options_provider_1.AuthorizationOptionsProvider; } });
var consensus_has_transaction_finality_1 = require("./consensus-has-transaction-finality");
Object.defineProperty(exports, "consensusHasTransactionFinality", { enumerable: true, get: function () { return consensus_has_transaction_finality_1.consensusHasTransactionFinality; } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tYWluL3R5cGVzY3JpcHQvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw4RkFBMEY7QUFBakYsMklBQUEsMEJBQTBCLE9BQUE7QUFDbkMscURBQTJFO0FBQTFDLGlIQUFBLGNBQWMsT0FBQTtBQUMvQyxpRUFHaUM7QUFGL0IsNkhBQUEsb0JBQW9CLE9BQUE7QUFJdEIsZ0dBR3VEO0FBRnJELDhJQUFBLDRCQUE0QixPQUFBO0FBSTlCLDJGQUF1RjtBQUE5RSxxSkFBQSwrQkFBK0IsT0FBQSJ9
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.registerWebServiceEndpoint = void 0;
const express_jwt_authz_1 = __importDefault(require("express-jwt-authz"));
/**

@@ -10,3 +14,3 @@ * Hooks up an endpoint instance to an ExpressJS web app object.

*/
function registerWebServiceEndpoint(webApp, endpoint) {
async function registerWebServiceEndpoint(webApp, endpoint) {
const fnTag = "registerWebServiceEndpoint";

@@ -16,5 +20,13 @@ const httpVerb = endpoint.getVerbLowerCase();

const requestHandler = endpoint.getExpressRequestHandler();
const provider = endpoint.getAuthorizationOptionsProvider();
const { isProtected, requiredRoles } = await provider.get();
const registrationMethod = webApp[httpVerb].bind(webApp);
try {
registrationMethod(httpPath, requestHandler);
if (isProtected) {
const scopeCheckMiddleware = express_jwt_authz_1.default(requiredRoles);
registrationMethod(httpPath, scopeCheckMiddleware, requestHandler);
}
else {
registrationMethod(httpPath, requestHandler);
}
}

@@ -27,2 +39,2 @@ catch (ex) {

exports.registerWebServiceEndpoint = registerWebServiceEndpoint;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVnaXN0ZXItd2ViLXNlcnZpY2UtZW5kcG9pbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvbWFpbi90eXBlc2NyaXB0L3dlYi1zZXJ2aWNlcy9yZWdpc3Rlci13ZWItc2VydmljZS1lbmRwb2ludC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFJQTs7Ozs7R0FLRztBQUNILFNBQWdCLDBCQUEwQixDQUN4QyxNQUFlLEVBQ2YsUUFBNkI7SUFFN0IsTUFBTSxLQUFLLEdBQUcsNEJBQTRCLENBQUM7SUFDM0MsTUFBTSxRQUFRLEdBQUcsUUFBUSxDQUFDLGdCQUFnQixFQUFFLENBQUM7SUFDN0MsTUFBTSxRQUFRLEdBQUcsUUFBUSxDQUFDLE9BQU8sRUFBRSxDQUFDO0lBQ3BDLE1BQU0s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QUFRLEdBQUcsUUFBUSxDQUFDLCtCQUErQixFQUFFLENBQUM7SUFDNUQsTUFBTSxFQUFFLFdBQVcsRUFBRSxhQUFhLEVBQUUsR0FBRyxNQUFNLFFBQVEsQ0FBQyxHQUFHLEVBQUUsQ0FBQztJQUU1RCxNQUFNLGtCQUFrQixHQUFJLE1BQWMsQ0FBQyxRQUFRLENBQUMsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDbEUsSUFBSTtRQUNGLElBQUksV0FBVyxFQUFFO1lBQ2YsTUFBTSxvQkFBb0IsR0FBRywyQkFBZSxDQUFDLGFBQWEsQ0FBQyxDQUFDO1lBQzVELGtCQUFrQixDQUFDLFFBQVEsRUFBRSxvQkFBb0IsRUFBRSxjQUFjLENBQUMsQ0FBQztTQUNwRTthQUFNO1lBQ0wsa0JBQWtCLENBQUMsUUFBUSxFQUFFLGNBQWMsQ0FBQyxDQUFDO1NBQzlDO0tBQ0Y7SUFBQyxPQUFPLEVBQUUsRUFBRTtRQUNYLE1BQU0sSUFBSSxLQUFLLENBQ2IsR0FBRyxLQUFLLHdCQUF3QixRQUFRLFNBQVM7WUFDL0MsZ0NBQWdDLEVBQUUsQ0FBQyxPQUFPLEVBQUUsQ0FDL0MsQ0FBQztLQUNIO0FBQ0gsQ0FBQztBQTFCRCxnRUEwQkMifQ==
export { registerWebServiceEndpoint } from "./web-services/register-web-service-endpoint";
export { IPluginRegistryOptions, PluginRegistry } from "./plugin-registry";
export { ConsortiumRepository, IConsortiumRepositoryOptions, } from "./consortium-repository";
export { AuthorizationOptionsProvider, IEndpointAuthzOptionsProviderOptions, } from "./web-services/authorization-options-provider";
export { consensusHasTransactionFinality } from "./consensus-has-transaction-finality";

@@ -9,2 +9,2 @@ import { Express } from "express";

*/
export declare function registerWebServiceEndpoint(webApp: Express, endpoint: IWebServiceEndpoint): void;
export declare function registerWebServiceEndpoint(webApp: Express, endpoint: IWebServiceEndpoint): Promise<void>;
{
"name": "@hyperledger/cactus-core",
"version": "0.4.2-main.b067fdd.29+b067fdd",
"version": "0.5.0-alpha.0",
"description": "Contains lower level abstractions/implementation that is to be shared by multiple other, higher level packages of the project.",

@@ -84,5 +84,6 @@ "main": "dist/lib/main/typescript/index.js",

"dependencies": {
"@hyperledger/cactus-common": "^0.4.2-main.b067fdd.29+b067fdd",
"@hyperledger/cactus-core-api": "^0.4.2-main.b067fdd.29+b067fdd",
"@hyperledger/cactus-common": "0.5.0-alpha.0",
"@hyperledger/cactus-core-api": "0.5.0-alpha.0",
"express": "4.17.1",
"express-jwt-authz": "2.4.1",
"typescript-optional": "2.0.1"

@@ -94,3 +95,3 @@ },

},
"gitHead": "b067fdd1e7e9fbae4a18fa8efdba19bf977d86df"
"gitHead": "26fd7f54ccdfee0c37586c51a1fdfd0746a9a512"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc