Code Monkey home page Code Monkey logo

brie's People

Contributors

benpatterson2 avatar cm-siteui avatar dependabot[bot] avatar jasonallencorns avatar jasoncorns-avalara avatar psheraton avatar trabus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

brie's Issues

Potential Vulnerabilities in Network Dependencies

Most packages are safe from vulnerabilities, if out-of-date. GitHub have alerted us to a known security vulnerability:

Dependency Vul. Notes
visionmedia / debug Known security vulnerability in 2.6.0
gotwarlost / istanbul ^ 0.4.5
lodash / lodash 4.15.0
mochajs / mocha ^ 3.2.0
BadgeLabs / mocha-eslint ^ 3.0.1

Pls. update dependencies and correct vulnerabilities.

Add range-check for numbers

in addition to equals, above, below, please add a validation method for "between", such that

          "criteria": [
            {
              "has": {
                "trait": "hasNumberValue",
                "comparison": "between",
                "start": 1,
                "end": 10
              }
            }
          ]
        },

This would cut improve on the compound criteria that includes an "above" and a "below" with an "all" match.

Use of DEBUG is incorrect

There are several instances of debug using multiple : to try and prefix debug logs (for instance brie:criteria:has) further than one level. Unfortunately this does not work, resulting in no logs at all.

https://github.com/visionmedia/debug#conventions

While it would be nice to be able to filter using multiple levels of prefixes, debug doesn't support this usage. We should remove all instances of multi-level prefixing, and replace it with a strategy of using underscores instead: brie:criteria_has.

has criteria does not support traits with nested keys

We list nested key support for is, but has does not properly support traits pointing to nested keys. For instance:

let data = {
    ua: {
        os: {
            name: 'Mac OS',
            version: '10.11.6'
        }
    }
};
let flagsIn = {
    "isMac": {
        "criteria" : [ 
            {
                "has": {
                    "trait": "ua.os.name",
                    "comparison": "equals",
                    "value": "Mac OS"
                }
            }
        ]
    }
};

The current identification of traits does not allow for nested keys, and fails:
brie:criteria Evaluation data has trait (ua.os.name)? false +0ms

We should add support for nested trait keys, which would allow for more flexibility in data and criteria.

NPM audit reveals upgrade potential

npm audit security report

Run npm install --save-dev [email protected] to resolve 2 vulnerabilities

SEMVER WARNING: Recommended action is a potentially breaking change

Concern Detail
Low Regular Expression Denial of Service
Package debug
Dependency of mocha [dev]
Path mocha > debug
More info https://nodesecurity.io/advisories/534
Concern Detail
Critical Command Injection
Package growl
Dependency of mocha [dev]
Path mocha > growl
More info https://nodesecurity.io/advisories/146

Run npm install [email protected] to resolve 1 vulnerability

Concern Detail
Low Prototype Pollution
Package lodash
Dependency of lodash
Path lodash
More info https://nodesecurity.io/advisories/577

Run npm install [email protected] to resolve 1 vulnerability

SEMVER WARNING: Recommended action is a potentially breaking change

Concern Detail
Low Regular Expression Denial of Service
Package debug
Dependency of debug
Path debug
More info https://nodesecurity.io/advisories/534

Run npm update lodash --depth 4 to resolve 3 vulnerabilities

Concern Detail
Low Prototype Pollution
Package lodash
Dependency of mocha-eslint
Path mocha-eslint > eslint > inquirer > lodash
More info https://nodesecurity.io/advisories/577
Concern Detail
Low Prototype Pollution
Package lodash
Dependency of mocha-eslint
Path mocha-eslint > eslint > lodash
More info https://nodesecurity.io/advisories/577
Concern Detail
Low Prototype Pollution
Package lodash
Dependency of mocha-eslint
Path mocha-eslint > eslint > table > lodash
More info https://nodesecurity.io/advisories/577

Run npm update debug --depth 3 to resolve 1 vulnerability

Concern Detail
Low Regular Expression Denial of Service
Package debug
Dependency of mocha-eslint
Path mocha-eslint > eslint > debug
More info https://nodesecurity.io/advisories/534

Enhance date comparison to include date-like strings

Given a data object like

{
  id: 1234567,
  importantDateValue: '12-12-2022'
}

and given a criteria value like

"isNewerThanImportantDate": {
  "criteria": [
    {
      "has": {
        "trait": "importantDateValue",
        "comparison": "younger",
        "value": "12-01-2022"
      }
    }
  ]
}

Expected result should be true since the human-readable dates are different and since the data object date of December 12 is newer than the comparison date of December 1.

Note:

new Date('12-12-2022') ==> Mon Dec 12 2022 00:00:00 GMT-0800 (Pacific Standard Time)
new Date('12-Dec-2022') ==> Mon Dec 12 2022 00:00:00 GMT-0800 (Pacific Standard Time)
new Date('12/12/2022') ==> Mon Dec 12 2022 00:00:00 GMT-0800 (Pacific Standard Time)
new Date('12.12.22') ==> Mon Dec 12 2022 00:00:00 GMT-0800 (Pacific Standard Time)

Date comparison strings could be try'd before comparison. Since younger and older are limited to Date access, some pre-validation could be implemented.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.