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

ldap-filters

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldap-filters - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

test.js

43

lib/parser.js

@@ -75,8 +75,8 @@ /* parser generated by jison 0.4.15 */

var parser = (function(){
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,29],$V2=[1,31],$V3=[7,27];
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,28],$V2=[1,30],$V3=[7,26];
var parser = {trace: function trace() { },
yy: {},
symbols_: {"error":2,"done":3,"filter":4,"LEFT_PAREN":5,"filter_comp":6,"RIGHT_PAREN":7,"and":8,"or":9,"not":10,"operation":11,"AND":12,"filter_list":13,"OR":14,"NOT":15,"some_op":16,"present":17,"ATTR_STR":18,"filter_type":19,"value_str":20,"filter_type_ambiguous":21,"APPROX":22,"GREATER_EQ":23,"LESS_EQ":24,"EQUAL":25,"EQ_STAR":26,"VALUE_STR":27,"$accept":0,"$end":1},
terminals_: {2:"error",5:"LEFT_PAREN",7:"RIGHT_PAREN",12:"AND",14:"OR",15:"NOT",18:"ATTR_STR",22:"APPROX",23:"GREATER_EQ",24:"LESS_EQ",25:"EQUAL",26:"EQ_STAR",27:"VALUE_STR"},
productions_: [0,[3,1],[4,3],[6,1],[6,1],[6,1],[6,1],[8,2],[9,2],[10,2],[13,1],[13,2],[11,1],[11,1],[16,3],[16,3],[19,1],[19,1],[19,1],[21,1],[17,2],[20,1],[20,2]],
symbols_: {"error":2,"done":3,"filter":4,"LEFT_PAREN":5,"filter_comp":6,"RIGHT_PAREN":7,"and":8,"or":9,"not":10,"operation":11,"AND":12,"filter_list":13,"OR":14,"NOT":15,"some_op":16,"present":17,"ATTR_STR":18,"filter_type":19,"value_str":20,"filter_type_ambiguous":21,"APPROX":22,"GREATER_EQ":23,"LESS_EQ":24,"EQUAL":25,"VALUE_STR":26,"$accept":0,"$end":1},
terminals_: {2:"error",5:"LEFT_PAREN",7:"RIGHT_PAREN",12:"AND",14:"OR",15:"NOT",17:"present",18:"ATTR_STR",22:"APPROX",23:"GREATER_EQ",24:"LESS_EQ",25:"EQUAL",26:"VALUE_STR"},
productions_: [0,[3,1],[4,3],[6,1],[6,1],[6,1],[6,1],[8,2],[9,2],[10,2],[13,1],[13,2],[11,1],[11,1],[16,3],[16,3],[19,1],[19,1],[19,1],[21,1],[20,1],[20,2]],
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {

@@ -128,3 +128,3 @@ /* this == yyval */

break;
case 12: case 13: case 21:
case 12: case 13: case 20:

@@ -159,9 +159,4 @@ this.$ = $$[$0];

break;
case 20:
case 21:
this.$ = Filter.attribute($$[$0-1]).present();
break;
case 22:
this.$ = $$[$0-1] + $$[$0];

@@ -172,4 +167,4 @@

},
table: [{3:1,4:2,5:$V0},{1:[3]},{1:[2,1]},{6:4,8:5,9:6,10:7,11:8,12:[1,9],14:[1,10],15:[1,11],16:12,17:13,18:[1,14]},{7:[1,15]},{7:[2,3]},{7:[2,4]},{7:[2,5]},{7:[2,6]},{4:17,5:$V0,13:16},{4:17,5:$V0,13:18},{4:19,5:$V0},{7:[2,12]},{7:[2,13]},{19:20,21:21,22:[1,23],23:[1,24],24:[1,25],25:[1,26],26:[1,22]},o([1,5,7],[2,2]),{7:[2,7]},{4:17,5:$V0,7:[2,10],13:27},{7:[2,8]},{7:[2,9]},{20:28,27:$V1},{20:30,27:$V1},{7:[2,20]},{27:[2,16]},{27:[2,17]},{27:[2,18]},{27:[2,19]},{7:[2,11]},{7:[2,14],27:$V2},o($V3,[2,21]),{7:[2,15],27:$V2},o($V3,[2,22])],
defaultActions: {2:[2,1],5:[2,3],6:[2,4],7:[2,5],8:[2,6],12:[2,12],13:[2,13],16:[2,7],18:[2,8],19:[2,9],22:[2,20],23:[2,16],24:[2,17],25:[2,18],26:[2,19],27:[2,11]},
table: [{3:1,4:2,5:$V0},{1:[3]},{1:[2,1]},{6:4,8:5,9:6,10:7,11:8,12:[1,9],14:[1,10],15:[1,11],16:12,17:[1,13],18:[1,14]},{7:[1,15]},{7:[2,3]},{7:[2,4]},{7:[2,5]},{7:[2,6]},{4:17,5:$V0,13:16},{4:17,5:$V0,13:18},{4:19,5:$V0},{7:[2,12]},{7:[2,13]},{19:20,21:21,22:[1,22],23:[1,23],24:[1,24],25:[1,25]},o([1,5,7],[2,2]),{7:[2,7]},{4:17,5:$V0,7:[2,10],13:26},{7:[2,8]},{7:[2,9]},{20:27,26:$V1},{20:29,26:$V1},{26:[2,16]},{26:[2,17]},{26:[2,18]},{26:[2,19]},{7:[2,11]},{7:[2,14],26:$V2},o($V3,[2,20]),{7:[2,15],26:$V2},o($V3,[2,21])],
defaultActions: {2:[2,1],5:[2,3],6:[2,4],7:[2,5],8:[2,6],12:[2,12],13:[2,13],16:[2,7],18:[2,8],19:[2,9],22:[2,16],23:[2,17],24:[2,18],25:[2,19],26:[2,11]},
parseError: function parseError(str, hash) {

@@ -676,13 +671,13 @@ if (hash.recoverable) {

break;
case 6:return "EQ_STAR";
case 6:this.begin("VALUE"); return "APPROX";
break;
case 7:this.begin("VALUE"); return "APPROX";
case 7:this.begin("VALUE"); return "GREATER_EQ";
break;
case 8:this.begin("VALUE"); return "GREATER_EQ";
case 8:this.begin("VALUE"); return "LESS_EQ";
break;
case 9:this.begin("VALUE"); return "LESS_EQ";
case 9:this.begin("VALUE"); return "EQUAL";
break;
case 10:this.begin("VALUE"); return "EQUAL";
case 10:return "STAR";
break;
case 11:return "STAR";
case 11:return "VALUE_STR";
break;

@@ -697,12 +692,10 @@ case 12:return "VALUE_STR";

break;
case 16:return "VALUE_STR";
case 16:this.popState(); return "RIGHT_PAREN";
break;
case 17:this.popState(); return "RIGHT_PAREN";
case 17:this.popState(); return "ATTR_STR";
break;
case 18:this.popState(); return "ATTR_STR";
break;
}
},
rules: [/^(?:\s+)/,/^(?:\()/,/^(?:\))/,/^(?:&)/,/^(?:\|)/,/^(?:!)/,/^(?:=\*)/,/^(?:~=)/,/^(?:>=)/,/^(?:<=)/,/^(?:=)/,/^(?:\*)/,/^(?:[^\\()]+)/,/^(?:\\\()/,/^(?:\\\))/,/^(?:\\\\)/,/^(?:\\\*)/,/^(?:\))/,/^(?:[^=><~()]+)/],
conditions: {"VALUE":{"rules":[12,13,14,15,16,17],"inclusive":true},"ATTR":{"rules":[18],"inclusive":true},"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11],"inclusive":true}}
rules: [/^(?:\s+)/,/^(?:\()/,/^(?:\))/,/^(?:&)/,/^(?:\|)/,/^(?:!)/,/^(?:~=)/,/^(?:>=)/,/^(?:<=)/,/^(?:=)/,/^(?:\*)/,/^(?:[^\\()]+)/,/^(?:\\\()/,/^(?:\\\))/,/^(?:\\\\)/,/^(?:\\\*)/,/^(?:\))/,/^(?:[^=><~()]+)/],
conditions: {"VALUE":{"rules":[11,12,13,14,15,16],"inclusive":true},"ATTR":{"rules":[17],"inclusive":true},"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10],"inclusive":true}}
});

@@ -709,0 +702,0 @@ return lexer;

{
"name": "ldap-filters",
"version": "0.1.5",
"version": "0.1.6",
"description": "Library for generating, parsing, and evaluating LDAP filters",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -29,2 +29,6 @@ var should = require('chai').should();

expect(filter.match({gn:'jim'})).to.be.false;
filter = Filter.parse('(sn=*)');
expect(filter.match({sn:'smith'})).to.be.true;
expect(filter.match({sn:'jones'})).to.be.true;
expect(filter.match({gn:'jim'})).to.be.false;
done();

@@ -31,0 +35,0 @@ });

@@ -47,3 +47,14 @@ var should = require('chai').should();

/* Issue #1 */
it('parses substring matches beginning with asterisk',function(done){
var filter = '(sn=*smith*)';
var parsed = Filter.parse(filter);
parsed.type.should.equal('filter');
parsed.attrib.should.equal('sn');
parsed.comp.should.equal('=');
parsed.value.should.equal('*smith*');
done();
});
});

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