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

moleculer-web

Package Overview
Dependencies
Maintainers
3
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moleculer-web - npm Package Versions

1
7

0.9.0-beta3

Diff

icebob
published 0.9.0-beta2 •

icebob
published 0.9.0-beta1 •

icebob
published 0.8.5 •

Changelog

Source

0.8.5 (2018-11-28)

Changes

  • allow multiple whitespaces between method & path in aliases.

<a name="0.8.4"></a>

icebob
published 0.8.4 •

Changelog

Source

0.8.4 (2018-11-18)

Changes

  • fix req.url, add req.originalUrl and req.baseUrl for better middleware support (e.g. support static serving in subpath).
  • update deps

<a name="0.8.3"></a>

icebob
published 0.8.3 •

Changelog

Source

0.8.3 (2018-11-11)

Changes

  • use Promise in started & stopped handlers.
  • disable 4xx errors with log4XXResponses setting.

<a name="0.8.2"></a>

icebob
published 0.8.2 •

Changelog

Source

0.8.2 (2018-10-04)

New authenticate method.

This authenticate method is similar to authorize. You have access to req, res and route objects and you can authenticate the user from the request. The returned data is saved to the ctx.meta.user. To enable this logic set authentication: true in route options.

Example

module.exports = {
    name: "api",
    mixins: [ApiGatewayService],

    settings: {
        routes: [
            {
                // Enable authentication
                authentication: true
            }
        ]
    },

    methods: {
        authenticate(ctx, route, req, res) {
            let accessToken = req.query["access_token"];
            if (accessToken) {
                if (accessToken === "12345") {
                    return Promise.resolve({ id: 1, username: "john.doe", name: "John Doe" });
                } else {
                    return Promise.reject();
                }
            } else {
                return Promise.resolve(null);
            }
        }
    }
});

Changes

  • update dependencies.
  • added .npmignore

<a name="0.8.1"></a>

icebob
published 0.8.1 •

Changelog

Source

0.8.1 (2018-08-04)

Changes

  • fix missing dependency.
  • fix middleware array promise-chaining bug
  • handle terminated requests in middlewares
  • update webpack-vue example to be up-to-date.

<a name="0.8.0"></a>

icebob
published 0.8.0 •

Changelog

Source

0.8.0 (2018-07-08)

Breaking changes

The onAfterCall hook has changed

In previous versions of Moleculer Web, you couldn't manipulate the data in onAfterCall. Now you can, but you must always return the new or original data.

Modify only headers

broker.createService(ApiGatewayService, {
    settings: {
        routes: [{
            onAfterCall(ctx, route, req, res, data) {
                res.setHeader("X-Custom-Header", "123456");

                // Must return the original `data`
                return data;
            }
        }]
    }
});

Modify (wrap) the original data

broker.createService(ApiGatewayService, {
    settings: {
        routes: [{
            onAfterCall(ctx, route, req, res, data) {
                // Wrap the original data to a new object
                return {
                    other: "things",
                    data: data
                };
            }
        }]
    }
});

Custom alias hooks

The onBeforeCall and authorize hooks are called before custom alias functions too. And you have access to Context as req.$ctx or res.$ctx

Whitelist string matcher changed

In early versions the * match string is enabled to call all services & actions. The matcher changed, in new versions use the ** (double star) match string for the same function.

New

icebob
published 0.8.0-rc1 •

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