profile
viewpoint
Icebob icebob Hungary http://icebob.info/ Full stack javascript programmer.

gothinkster/moleculer-node-realworld-example-app 86

Exemplary real world application built with Moleculer

icebob/codepen_offline 16

Codepen's pen offline coding with livereload

icebob/benchmarkify 15

:zap: Benchmark framework for NodeJS

icebob/coffeescript_cheatsheet 14

CoffeeScript cheatsheet

icebob/docker-chromium-armhf 5

Docker container with Chromium browser for Raspberry Pi

icebob/covid19 4

Coronavirus daily report, updated hourly

icebob/bench-bot 2

:construction_worker: Benchmark runner robot. Continuous benchmarking

icebob/cpu 2

node module for cpu usage based on `os` module

icebob/awesome-microservices 1

A curated list of Microservice Architecture related principles and technologies.

icebob/catalyst 1

Typescript NodeJS Microservices Boilerplate with Generator CLI - Moleculer, GraphQL, REST, OAuth2, Jaeger, Grafana, Prometheus, Ory Hydra, Ory Keto w/ Access Control middleware, Moleculer-DB GraphQL mixin, Pug, Redis, sibling client repo (login, persistance layer, react-native-web, ios, android)

startedkettanaito/naming-cheatsheet

started time in 4 hours

startedicebob/fastest-validator

started time in 9 hours

issue commentmoleculerjs/moleculer

Kubernetes deployment in Docs?

@dkuida I have checked your article, kudos! But i'm bit confused about why have you created 3 separate repos with moleculer. What if all of these services are incorporated in one moleculer project created by moleculer-cli. How will the services be incorporated as separate docker images and kubernetes?

jbonnett92

comment created time in 12 hours

startedfelixrieseberg/macintosh.js

started time in 14 hours

startedicebob/vue-express-mongo-boilerplate

started time in 20 hours

PR opened icebob/fakerator

Update lodash to version 4.17.20
+4 -4

0 comment

2 changed files

pr created time in a day

startedicebob/fakerator

started time in a day

Pull request review commentmoleculerjs/moleculer

Fix version string build when an integer value is passed in string form

 class Service { 	 * @param {String|Number?} version 	 */ 	static getVersionedFullName(name, version) {-		if (version != null)-			return (typeof(version) == "number" ? "v" + version : version) + "." + name;+		if (version != null) {+			if (typeof(version) === 'number' || !isNaN(parseInt(version))) {

That's also true, I would think this would be a "good" breaking change from my perspective. Let me update the PR to flag that this is breaking and let @icebob think on it 🙂

slinkardbrandon

comment created time in 2 days

startedicebob/fastest-validator

started time in 2 days

issue openedicebob/fastest-validator

Combine multiple validators with optional?

Is it possible to express the idea that a field is optional, but when it is present then it must satisfy one of multiple validators?

As I understand the docs, the property descriptor can either be an object (representing a single validator that can have "optional" field) or an array (containing multiple such validators). In the latter case there seems to be no way to "attach" the optionality information to that array. Am I overlooking something?

created time in 2 days

PR opened icebob/vue-express-mongo-boilerplate

[Snyk] Fix for 3 vulnerabilities

<h3>Snyk has created this PR to fix one or more vulnerable packages in the yarn dependencies of this project.</h3>

Changes included in this PR

  • Changes to the following files to upgrade the vulnerable dependencies to a fixed version:
    • package.json
    • yarn.lock

Vulnerabilities that will be fixed

With an upgrade:
Severity Priority Score (*) Issue Breaking Change Exploit Maturity
high severity 768/1000 <br/> Why? Proof of Concept exploit, Recently disclosed, Has a fix available, CVSS 7.5 Denial of Service (DoS) <br/>SNYK-JS-ENGINEIO-1056749 Yes Proof of Concept
medium severity 551/1000 <br/> Why? Recently disclosed, Has a fix available, CVSS 5.3 Improper Certificate Validation <br/>SNYK-JS-NODESASS-1059081 No No Known Exploit
high severity 768/1000 <br/> Why? Proof of Concept exploit, Recently disclosed, Has a fix available, CVSS 7.5 Denial of Service (DoS) <br/>SNYK-JS-SOCKETIOPARSER-1056752 No Proof of Concept

(*) Note that the real score may have changed since the PR was raised.

Check the changes in this PR to ensure they won't cause issues with your project.


Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

For more information: <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJkMjk0YmI1Yy02MDA5LTRlMjctODk4NS1kYTdjY2JkYjA5YjkiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImQyOTRiYjVjLTYwMDktNGUyNy04OTg1LWRhN2NjYmRiMDliOSJ9fQ==" width="0" height="0"/> 🧐 View latest project report

🛠 Adjust project settings

📚 Read more about Snyk's upgrade and patch logic

+2326 -603

0 comment

2 changed files

pr created time in 2 days

Pull request review commentmoleculerjs/moleculer

Fix version string build when an integer value is passed in string form

 class Service { 	 * @param {String|Number?} version 	 */ 	static getVersionedFullName(name, version) {-		if (version != null)-			return (typeof(version) == "number" ? "v" + version : version) + "." + name;+		if (version != null) {+			if (typeof(version) === 'number' || !isNaN(parseInt(version))) {

It's technically also breaking for anyone who is using version = "5" intentionally... I understand your pain here though.

slinkardbrandon

comment created time in 2 days

Pull request review commentmoleculerjs/moleculer

Fix version string build when an integer value is passed in string form

 class Service { 	 * @param {String|Number?} version 	 */ 	static getVersionedFullName(name, version) {-		if (version != null)-			return (typeof(version) == "number" ? "v" + version : version) + "." + name;+		if (version != null) {+			if (typeof(version) === 'number' || !isNaN(parseInt(version))) {

Good call, I just updated this to use the Number constructor instead and I added a test case to validate that it works the way we would expect.

Thanks!

slinkardbrandon

comment created time in 2 days

Pull request review commentmoleculerjs/moleculer

Fix version string build when an integer value is passed in string form

 class Service { 	 * @param {String|Number?} version 	 */ 	static getVersionedFullName(name, version) {-		if (version != null)-			return (typeof(version) == "number" ? "v" + version : version) + "." + name;+		if (version != null) {+			if (typeof(version) === 'number' || !isNaN(parseInt(version))) {

This is a breaking change if version = "123abc".

slinkardbrandon

comment created time in 2 days

PR opened moleculerjs/moleculer

Fix version string build when an integer value is passed in string form

:memo: Description

<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->

I got tripped up on something (that was my fault) when using the broker.waitForServices() method and passing an array of objects. In my case, serviceVersion was a string even though I thought it was a number. Below is an example as to how you can see how that might have occurred. I'm just hoping this change might prevent the pain for anyone else in the future.

    await broker.waitForServices([
      { name: serviceName, version: serviceVersion },
    ]);

:dart: Relevant issues

<!-- Please add relevant opened issues --> N/A

:gem: Type of change

<!-- Please delete options that are not relevant. -->

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

:scroll: Example code

  /**
   * This will now await for the following services to become available:
   * v1.foo & v2.bar
   * 
   * Previously this would wait for
   * v1.foo & 2.bar
   */ 
    await broker.waitForServices([
      { name: 'foo', version: 1 },
      { name: 'bar', version: '2` }
    ]);

:vertical_traffic_light: How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [x] Test A - I added to the version string building static method tests with a case that demonstrated the problem, then made it work

:checkered_flag: Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [ ] I have commented my code, particularly in hard-to-understand areas
+7 -2

0 comment

2 changed files

pr created time in 2 days

pull request commentmoleculerjs/moleculer

Add default Context Meta properties

Yes I would tend to agree. Since moleculer-web is an add-on, I don't feel like the types necessarily belong in moleculer proper. I wouldn't be opposed to that type being added to moleculer-web as a type alias that could be imported as a helper though. A user who wanted that type could replace the generic in Context with it or augment the Context interface if they wanted it throughout their environment.

HazemKhaled

comment created time in 2 days

PR opened moleculerjs/moleculer

Add default Context Meta properties

:memo: Description

<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->

:dart: Relevant issues

<!-- Please add relevant opened issues -->

:gem: Type of change

<!-- Please delete options that are not relevant. -->

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

:scroll: Example code


:vertical_traffic_light: How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [ ] Test A
  • [ ] Test B

:checkered_flag: Checklist:

  • [ ] My code follows the style guidelines of this project
  • [ ] I have performed a self-review of my own code
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally with my changes
  • [ ] I have commented my code, particularly in hard-to-understand areas
+11 -2

0 comment

1 changed file

pr created time in 3 days

issue openedmoleculerjs/moleculer-db

The Sequelize adapter doesn't seem to work when you use the base structure specified on the docs.

The examples provided on the docs regarding the Sequelize adapter implementation maybe don't take into count the probability that somebody may be using Moler Runner to execute its code. The following example can be found in the readme of the project:


const { ServiceBroker } = require("moleculer");
const DbService = require("moleculer-db");
const SqlAdapter = require("moleculer-db-adapter-sequelize");
const Sequelize = require("sequelize");

const broker = new ServiceBroker();

// Create a Sequelize service for `post` entities
broker.createService({
    name: "posts",
    mixins: [DbService],
    adapter: new SqlAdapter("sqlite://:memory:"),
    model: {
        name: "post",
        define: {
            title: Sequelize.STRING,
            content: Sequelize.TEXT,
            votes: Sequelize.INTEGER,
            author: Sequelize.INTEGER,
            status: Sequelize.BOOLEAN
        },
        options: {
            // Options from http://docs.sequelizejs.com/manual/tutorial/models-definition.html
        }
    },
});


broker.start()
// Create a new post
.then(() => broker.call("posts.create", {
    title: "My first post",
    content: "Lorem ipsum...",
    votes: 0
}))

// Get all posts
.then(() => broker.call("posts.find").then(console.log)); 

Everything seems to be alright, but if you try to execute code based on such an example, you'll get the following error: Service name can't be empty! Maybe it is not a valid Service schema. Maybe is it not a service schema?.

Based on what I've read on similar issues, the error comes out when you run your code through Molecular Runner since it doesn't require you to start brokers in service files. If you want to get over the problem, you just have to rewrite the service as follows and everything should work as expected:


const { ServiceBroker } = require("moleculer");
const DbService = require("moleculer-db");
const SqlAdapter = require("moleculer-db-adapter-sequelize");
const Sequelize = require("sequelize");


//Generating a new Service.
module.exports = {
	name: "posts",
  	mixins: [DbService],
	adapter: new SqlAdapter("sqlite://:memory:"),
  	model: {
	  name: "post",
	  define: {
		  title: Sequelize.STRING,
		  content: Sequelize.TEXT,
		  votes: Sequelize.INTEGER,
		  status: Sequelize.BOOLEAN
	  },
	  options: {}
  }, 
  settings: ["id", "title", "content", "votes", "status"],
}; ```

A little explanatory note under (or over) the examples regarding the Sequelize adapter could be really useful, since it may save a lot of debugging time. 

created time in 3 days

Pull request review commentmoleculerjs/moleculer-web

(feat) allow cors to reflect origin

 describe("Test CORS", () => { 			}).then(() => broker.stop()).catch(err => broker.stop().then(() => { throw err; })); 	}); -	it("errors on mismatching origin header", () => {+	// breaking change /!\ default is super secure now. no cors means... no cors.+	it("with default settings", () => { 		[broker, service, server] = setup({-			cors: {-				origin: "a"-			}+			cors: {}, 		});-		return broker.start()-			.then(() => request(server)-				.get("/test/hello")-				.set("Origin", "http://localhost:3000"))-			.then(res => {++		return broker+			.start()+			.then(() =>+				request(server)+					.get("/test/hello")+					.set("Origin", "http://localhost:3000")+			)+			.then((res) => { 				expect(res.statusCode).toBe(403); 				expect(res.body).toEqual({-					"message": "Forbidden",-					"code": 403,-					"type": "ORIGIN_NOT_ALLOWED",-					"name": "ForbiddenError"+					message: "Forbidden",+					code: 403,+					type: "ORIGIN_NOT_ALLOWED",+					name: "ForbiddenError", 				});-			}).then(() => broker.stop()).catch(err => broker.stop().then(() => { throw err; }));+			})+			.then(() => broker.stop())+			.catch((err) =>+				broker.stop().then(() => {+					throw err;+				})+			); 	}); -	it("with default settings", () => {+	it("with custom global settings (boolean)", () => { 		[broker, service, server] = setup({-			cors: {}+			cors: {+				origin: true,+			}, 		}); -		return broker.start()-			.then(() => request(server)-				.get("/test/hello")-				.set("Origin", "http://localhost:3000"))-			.then(res => {+		return broker+			.start()+			.then(() =>+				request(server)+					.get("/test/hello")+					.set("Origin", "http://localhost:3000")+			)+			.then((res) => { 				expect(res.statusCode).toBe(200);-				expect(res.headers["content-type"]).toBe("application/json; charset=utf-8"); 				expect(res.headers["access-control-allow-origin"]).toBe("*");--				expect(res.body).toBe("Hello Moleculer"); 			})-			.then(() => broker.stop()).catch(err => broker.stop().then(() => { throw err; }));+			.then(() => broker.stop())+			.catch((err) =>+				broker.stop().then(() => {+					throw err;+				})+			); 	});  	it("with custom global settings (string)", () => { 		[broker, service, server] = setup({ 			cors: { 				origin: "http://localhost:3000",-				exposedHeaders: "X-Response-Time",-				credentials: true-			}+			}, 		}); -		return broker.start()-			.then(() => request(server)-				.get("/test/hello")-				.set("Origin", "http://localhost:3000"))-			.then(res => {+		return broker+			.start()+			.then(() =>+				request(server)+					.get("/test/hello")+					.set("Origin", "http://localhost:3000")+			)+			.then((res) => { 				expect(res.statusCode).toBe(200);-				expect(res.headers["content-type"]).toBe("application/json; charset=utf-8"); 				expect(res.headers["access-control-allow-origin"]).toBe("http://localhost:3000");-				expect(res.headers["access-control-allow-credentials"]).toBe("true");-				expect(res.headers["access-control-expose-headers"]).toBe("X-Response-Time");

I took to remove them because I think they're not what the test is testing for. In my opinion the test cases for this feature (cors policy) should be for checking that "given a cors settings and an http request as input, the proper "allow-origin" header is returned." ; so then those headers are not necessary to be included in the test.

Please let me know if you want them back :)

y-nk

comment created time in 4 days

Pull request review commentmoleculerjs/moleculer-web

(feat) allow cors to reflect origin

 describe("Test CORS", () => { 			.then(() => broker.stop()).catch(err => broker.stop().then(() => { throw err; })); 	}); -	it("returns matching CORS origin wildcard with single origin", () => {-		[broker, service, server] = setup({

I generally deleted few of the testcases because they overlap in testing with the new ones, but if you want i can restore them. I just thought that, since other test cases are here already, this would create noise in your test suite (as in: double testing a single feature/case + slowing down the suite)

y-nk

comment created time in 4 days

issue commentmoleculerjs/moleculer

Who is using Moleculer?

We are using moleculer in Qwip!! Great performance <3

https://qwip-app.com https://play.google.com/store/apps/details?id=com.qwip.io https://apps.apple.com/mx/app/qwip-comunidad-y-transporte/id1546033198

logo

icebob

comment created time in 4 days

PR opened moleculerjs/moleculer

Issue 849: log decryption failure

:memo: Description

log the error if decryption fails <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->

:dart: Relevant issues

<!-- Please add relevant opened issues -->

:gem: Type of change

<!-- Please delete options that are not relevant. -->

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

:scroll: Example code


:vertical_traffic_light: How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [ ] Test A
  • [ ] Test B

:checkered_flag: Checklist:

  • [ ] My code follows the style guidelines of this project
  • [ ] I have performed a self-review of my own code
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally with my changes
  • [ ] I have commented my code, particularly in hard-to-understand areas
+7 -3

0 comment

1 changed file

pr created time in 4 days

fork RenHung/vue-express-mongo-boilerplate

:star: MEVN Full stack JS web app boilerplate with NodeJS, Express, Mongo and VueJS

http://vemapp.moleculer.services/

fork in 4 days

startedicebob/vue-express-mongo-boilerplate

started time in 4 days

PR opened mfornos/awesome-microservices

Added Linx

Linx: https://linx.software/ - Visual IDE and server to develop and host API's, backend logic, automations and integrations.

Type of change

<!-- Mark with an x the type of change: -->

  • [ ] Add an entry to an existing category.
  • [ ] Remove an existing entry. Provide rationale
  • [ ] Modify an existing entry. Provide rationale
  • [ ] Add/modify/remove a category or subcategory. Provide rationale
  • [ ] Other fixes or amendments.

Rationale

<!-- Provide a rationale if applies for the type of change :) -->

Checklist

<!-- Please, mark with an x all the boxes that apply: -->

Regarding the suggested entry: <!-- Please, mark with an x all the boxes that apply: -->

  • [ ] It is sorted alphabetically in its section.
  • [ ] It does not exist already in the list.
  • [ ] It is not for marketing purposes.
+1 -0

0 comment

1 changed file

pr created time in 4 days

PR opened moleculerjs/site

Update networking.md

Fix typo in networking.md doc

+1 -1

0 comment

1 changed file

pr created time in 5 days

PR opened icebob/kantab

fix: reset password endpoint
+1 -1

0 comment

1 changed file

pr created time in 6 days

fork ismail9k/kantab

[WIP] Kanban board application. Powered by Moleculer & Vue.JS

fork in 6 days

pull request commentmfornos/awesome-microservices

Add bunkerized-nginx to API Gateways / Edge Services

Thanks! :)

bunkerity

comment created time in 6 days

more