nestjs-ip-filter 0.1.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/README.md +108 -134
- package/dist/index.d.ts +1 -2
- package/dist/index.js +6 -4
- package/dist/ipfilter-deny.exception.js +0 -1
- package/dist/ipfilter.constants.d.ts +0 -1
- package/dist/ipfilter.constants.js +1 -3
- package/dist/ipfilter.guard.d.ts +2 -3
- package/dist/ipfilter.guard.js +11 -25
- package/dist/ipfilter.interface.d.ts +1 -14
- package/dist/ipfilter.interface.js +0 -1
- package/dist/ipfilter.module-definition.d.ts +8 -0
- package/dist/ipfilter.module-definition.js +19 -0
- package/dist/ipfilter.module.d.ts +2 -5
- package/dist/ipfilter.module.js +21 -17
- package/dist/ipfilter.service.d.ts +7 -4
- package/dist/ipfilter.service.js +61 -13
- package/package.json +36 -60
- package/.eslintrc.js +0 -29
- package/.prettierrc +0 -4
- package/.vscode/settings.json +0 -3
- package/dist/index.js.map +0 -1
- package/dist/ipfilter-core.module.d.ts +0 -24
- package/dist/ipfilter-core.module.js +0 -87
- package/dist/ipfilter-core.module.js.map +0 -1
- package/dist/ipfilter-deny.exception.js.map +0 -1
- package/dist/ipfilter.constants.js.map +0 -1
- package/dist/ipfilter.guard.js.map +0 -1
- package/dist/ipfilter.interface.js.map +0 -1
- package/dist/ipfilter.module.js.map +0 -1
- package/dist/ipfilter.providers.d.ts +0 -3
- package/dist/ipfilter.providers.js +0 -13
- package/dist/ipfilter.providers.js.map +0 -1
- package/dist/ipfilter.service.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/index.js +0 -6
- package/index.ts +0 -1
- package/lib/index.ts +0 -8
- package/lib/ipfilter-core.module.ts +0 -94
- package/lib/ipfilter-deny.exception.ts +0 -7
- package/lib/ipfilter.constants.ts +0 -2
- package/lib/ipfilter.guard.ts +0 -56
- package/lib/ipfilter.interface.ts +0 -28
- package/lib/ipfilter.module.ts +0 -23
- package/lib/ipfilter.providers.ts +0 -13
- package/lib/ipfilter.service.ts +0 -37
- package/nest-cli.json +0 -5
- package/renovate.json +0 -10
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -24
package/dist/ipfilter.service.js
CHANGED
|
@@ -14,32 +14,80 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.IpFilterService = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
|
-
const
|
|
17
|
+
const node_net_1 = require("node:net");
|
|
18
|
+
const ipfilter_module_definition_1 = require("./ipfilter.module-definition");
|
|
19
|
+
const familyOf = (address) => ((0, node_net_1.isIP)(address) === 6 ? 'ipv6' : 'ipv4');
|
|
20
|
+
function toBlockList(rules) {
|
|
21
|
+
if (!Array.isArray(rules)) {
|
|
22
|
+
throw new Error(`IP filter rules must be an array, got ${typeof rules}`);
|
|
23
|
+
}
|
|
24
|
+
const list = new node_net_1.BlockList();
|
|
25
|
+
for (const raw of rules) {
|
|
26
|
+
const [address, prefix, ...rest] = String(raw).trim().split('/');
|
|
27
|
+
const family = (0, node_net_1.isIP)(address);
|
|
28
|
+
const maxPrefix = family === 4 ? 32 : 128;
|
|
29
|
+
if (family === 0 ||
|
|
30
|
+
rest.length > 0 ||
|
|
31
|
+
(prefix !== undefined &&
|
|
32
|
+
(!/^\d+$/.test(prefix) || Number(prefix) > maxPrefix)) ||
|
|
33
|
+
(/^::ffff:/i.test(address) && prefix !== undefined && Number(prefix) < 96)) {
|
|
34
|
+
throw new Error(`Invalid IP filter rule: "${raw}"`);
|
|
35
|
+
}
|
|
36
|
+
if (prefix === undefined) {
|
|
37
|
+
list.addAddress(address, familyOf(address));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
list.addSubnet(address, Number(prefix), familyOf(address));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return list;
|
|
44
|
+
}
|
|
18
45
|
let IpFilterService = class IpFilterService {
|
|
46
|
+
options;
|
|
47
|
+
useDenyException;
|
|
48
|
+
_whitelist;
|
|
49
|
+
_blacklist;
|
|
50
|
+
whitelistRules;
|
|
51
|
+
blacklistRules;
|
|
19
52
|
constructor(options) {
|
|
20
|
-
var _a, _b, _c;
|
|
21
53
|
this.options = options;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
54
|
+
if (options.whitelist == null && options.blacklist == null) {
|
|
55
|
+
throw new Error('IpFilter: configure "whitelist", "blacklist" or both');
|
|
56
|
+
}
|
|
57
|
+
this.useDenyException = options.useDenyException ?? false;
|
|
58
|
+
if (options.whitelist != null)
|
|
59
|
+
this.whitelist = options.whitelist;
|
|
60
|
+
if (options.blacklist != null)
|
|
61
|
+
this.blacklist = options.blacklist;
|
|
25
62
|
}
|
|
26
63
|
get whitelist() {
|
|
27
|
-
return this._whitelist;
|
|
64
|
+
return this._whitelist && [...this._whitelist];
|
|
28
65
|
}
|
|
29
66
|
set whitelist(whitelist) {
|
|
30
|
-
this.
|
|
67
|
+
this.whitelistRules = toBlockList(whitelist);
|
|
68
|
+
this._whitelist = [...whitelist];
|
|
31
69
|
}
|
|
32
70
|
get blacklist() {
|
|
33
|
-
return this._blacklist;
|
|
71
|
+
return this._blacklist && [...this._blacklist];
|
|
34
72
|
}
|
|
35
73
|
set blacklist(blacklist) {
|
|
36
|
-
this.
|
|
74
|
+
this.blacklistRules = toBlockList(blacklist);
|
|
75
|
+
this._blacklist = [...blacklist];
|
|
76
|
+
}
|
|
77
|
+
isAllowed(ip) {
|
|
78
|
+
if (!ip || (0, node_net_1.isIP)(ip) === 0) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
const family = familyOf(ip);
|
|
82
|
+
if (this.blacklistRules?.check(ip, family)) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
return this.whitelistRules?.check(ip, family) ?? true;
|
|
37
86
|
}
|
|
38
87
|
};
|
|
39
|
-
IpFilterService =
|
|
88
|
+
exports.IpFilterService = IpFilterService;
|
|
89
|
+
exports.IpFilterService = IpFilterService = __decorate([
|
|
40
90
|
(0, common_1.Injectable)(),
|
|
41
|
-
__param(0, (0, common_1.Inject)(
|
|
91
|
+
__param(0, (0, common_1.Inject)(ipfilter_module_definition_1.MODULE_OPTIONS_TOKEN)),
|
|
42
92
|
__metadata("design:paramtypes", [Object])
|
|
43
93
|
], IpFilterService);
|
|
44
|
-
exports.IpFilterService = IpFilterService;
|
|
45
|
-
//# sourceMappingURL=ipfilter.service.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestjs-ip-filter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "A NestJS Guard for filtering IP addresses",
|
|
5
5
|
"author": "Deokgyu Yang <secugyu@gmail.com>",
|
|
6
6
|
"keywords": [
|
|
@@ -18,69 +18,45 @@
|
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/awesometic/nestjs-ip-filter/issues"
|
|
20
20
|
},
|
|
21
|
+
"main": "dist/index.js",
|
|
22
|
+
"types": "dist/index.d.ts",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"CHANGELOG.md"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=22.12.0"
|
|
29
|
+
},
|
|
21
30
|
"scripts": {
|
|
22
|
-
"prebuild": "rimraf dist",
|
|
23
31
|
"build": "rm -rf dist && tsc -p tsconfig.json",
|
|
24
|
-
"format": "prettier --write \"{lib,
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"start:dev": "nest start --watch",
|
|
29
|
-
"start:debug": "nest start --debug --watch",
|
|
30
|
-
"lint": "eslint \"{lib,apps,libs,test,example/src}/**/*.ts\" --fix",
|
|
31
|
-
"test": "jest",
|
|
32
|
-
"test:watch": "jest --watch",
|
|
33
|
-
"test:cov": "jest --coverage",
|
|
34
|
-
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand"
|
|
32
|
+
"format": "prettier --write \"{lib,test}/**/*.ts\" \"scripts/*.mts\"",
|
|
33
|
+
"lint": "eslint \"{lib,test}/**/*.ts\" \"scripts/*.mts\"",
|
|
34
|
+
"test": "rm -rf .test-dist && tsc -p test/tsconfig.json && node --test .test-dist/test/ipfilter.spec.js && tsc -p scripts/tsconfig.json && node --experimental-strip-types --test scripts/github-release.test.mts",
|
|
35
|
+
"prepublishOnly": "npm run lint && npm test && npm run build"
|
|
35
36
|
},
|
|
36
|
-
"
|
|
37
|
-
"@nestjs/common": "
|
|
38
|
-
"@nestjs/core": "
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"reflect-metadata": "0.1.13",
|
|
42
|
-
"rimraf": "3.0.2",
|
|
43
|
-
"rxjs": "7.5.5"
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@nestjs/common": "^11.0.0 || ^12.0.0",
|
|
39
|
+
"@nestjs/core": "^11.0.0 || ^12.0.0",
|
|
40
|
+
"reflect-metadata": "^0.1.13 || ^0.2.0",
|
|
41
|
+
"rxjs": "^7.1.0"
|
|
44
42
|
},
|
|
45
43
|
"devDependencies": {
|
|
46
|
-
"@
|
|
47
|
-
"@nestjs/
|
|
48
|
-
"@nestjs/
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"@types/
|
|
52
|
-
"@types/
|
|
53
|
-
"@
|
|
54
|
-
"
|
|
55
|
-
"eslint": "
|
|
56
|
-
"eslint-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"ts-jest": "28.0.5",
|
|
64
|
-
"ts-loader": "9.3.1",
|
|
65
|
-
"ts-node": "10.8.1",
|
|
66
|
-
"tsconfig-paths": "4.0.0",
|
|
67
|
-
"typescript": "4.7.4"
|
|
68
|
-
},
|
|
69
|
-
"jest": {
|
|
70
|
-
"moduleFileExtensions": [
|
|
71
|
-
"js",
|
|
72
|
-
"json",
|
|
73
|
-
"ts"
|
|
74
|
-
],
|
|
75
|
-
"rootDir": "lib",
|
|
76
|
-
"testRegex": ".*\\.spec\\.ts$",
|
|
77
|
-
"transform": {
|
|
78
|
-
"^.+\\.(t|j)s$": "ts-jest"
|
|
79
|
-
},
|
|
80
|
-
"collectCoverageFrom": [
|
|
81
|
-
"**/*.(t|j)s"
|
|
82
|
-
],
|
|
83
|
-
"coverageDirectory": "../coverage",
|
|
84
|
-
"testEnvironment": "node"
|
|
44
|
+
"@eslint/js": "10.0.1",
|
|
45
|
+
"@nestjs/common": "12.4.0",
|
|
46
|
+
"@nestjs/core": "12.4.0",
|
|
47
|
+
"@nestjs/platform-express": "12.4.0",
|
|
48
|
+
"@nestjs/testing": "12.4.0",
|
|
49
|
+
"@types/express": "5.0.6",
|
|
50
|
+
"@types/node": "22.20.5",
|
|
51
|
+
"@types/supertest": "7.2.1",
|
|
52
|
+
"eslint": "10.14.0",
|
|
53
|
+
"eslint-config-prettier": "10.1.8",
|
|
54
|
+
"eslint-plugin-prettier": "5.5.7",
|
|
55
|
+
"prettier": "3.9.10",
|
|
56
|
+
"reflect-metadata": "0.2.2",
|
|
57
|
+
"rxjs": "7.8.2",
|
|
58
|
+
"supertest": "7.3.2",
|
|
59
|
+
"typescript": "6.0.3",
|
|
60
|
+
"typescript-eslint": "8.72.2"
|
|
85
61
|
}
|
|
86
62
|
}
|
package/.eslintrc.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line no-undef
|
|
2
|
-
module.exports = {
|
|
3
|
-
root: true,
|
|
4
|
-
env: {
|
|
5
|
-
node: true,
|
|
6
|
-
es2017: true,
|
|
7
|
-
},
|
|
8
|
-
extends: [
|
|
9
|
-
'google',
|
|
10
|
-
'eslint:recommended',
|
|
11
|
-
'plugin:@typescript-eslint/recommended',
|
|
12
|
-
'plugin:prettier/recommended',
|
|
13
|
-
],
|
|
14
|
-
parser: '@typescript-eslint/parser',
|
|
15
|
-
parserOptions: {
|
|
16
|
-
ecmaVersion: 8,
|
|
17
|
-
sourceType: 'module',
|
|
18
|
-
tsconfigRootDir: __dirname,
|
|
19
|
-
},
|
|
20
|
-
plugins: ['@typescript-eslint'],
|
|
21
|
-
rules: {
|
|
22
|
-
'@typescript-eslint/interface-name-prefix': 0,
|
|
23
|
-
'@typescript-eslint/explicit-function-return-type': 0,
|
|
24
|
-
'@typescript-eslint/explicit-module-boundary-types': 0,
|
|
25
|
-
'@typescript-eslint/no-explicit-any': 0,
|
|
26
|
-
'new-cap': 0,
|
|
27
|
-
'require-jsdoc': 0,
|
|
28
|
-
},
|
|
29
|
-
};
|
package/.prettierrc
DELETED
package/.vscode/settings.json
DELETED
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAuC;AACvC,4DAA0C;AAC1C,uDAAqC;AACrC,mDAAiC;AACjC,uDAAqC;AACrC,oDAAkC;AAClC,uDAAqC;AACrC,qDAAmC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Provider, Type } from '@nestjs/common';
|
|
2
|
-
import { IpFilterModuleAsyncOptions, IpFilterModuleOptions } from './ipfilter.interface';
|
|
3
|
-
import { IpFilterGuard } from './ipfilter.guard';
|
|
4
|
-
export declare class IpFilterCoreModule {
|
|
5
|
-
static forRoot(options: IpFilterModuleOptions): {
|
|
6
|
-
module: typeof IpFilterCoreModule;
|
|
7
|
-
providers: (Provider<any> | {
|
|
8
|
-
provide: string;
|
|
9
|
-
useClass: typeof IpFilterGuard;
|
|
10
|
-
})[];
|
|
11
|
-
exports: Provider<any>[];
|
|
12
|
-
};
|
|
13
|
-
static forRootAsync(options: IpFilterModuleAsyncOptions): {
|
|
14
|
-
module: typeof IpFilterCoreModule;
|
|
15
|
-
imports: (Type<any> | import("@nestjs/common").DynamicModule | Promise<import("@nestjs/common").DynamicModule> | import("@nestjs/common").ForwardReference<any>)[];
|
|
16
|
-
providers: (Provider<any> | {
|
|
17
|
-
provide: string;
|
|
18
|
-
useClass: typeof IpFilterGuard;
|
|
19
|
-
})[];
|
|
20
|
-
exports: import("@nestjs/common").FactoryProvider<any>[];
|
|
21
|
-
};
|
|
22
|
-
private static createAsyncProviders;
|
|
23
|
-
private static createAsyncOptionsProvider;
|
|
24
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var IpFilterCoreModule_1;
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.IpFilterCoreModule = void 0;
|
|
11
|
-
const common_1 = require("@nestjs/common");
|
|
12
|
-
const ipfilter_constants_1 = require("./ipfilter.constants");
|
|
13
|
-
const ipfilter_providers_1 = require("./ipfilter.providers");
|
|
14
|
-
const ipfilter_service_1 = require("./ipfilter.service");
|
|
15
|
-
const core_1 = require("@nestjs/core");
|
|
16
|
-
const ipfilter_guard_1 = require("./ipfilter.guard");
|
|
17
|
-
let IpFilterCoreModule = IpFilterCoreModule_1 = class IpFilterCoreModule {
|
|
18
|
-
static forRoot(options) {
|
|
19
|
-
const ipFilterServiceProvider = (0, ipfilter_providers_1.createIpFilterProviders)(options);
|
|
20
|
-
const ipFilterGuardProvider = {
|
|
21
|
-
provide: core_1.APP_GUARD,
|
|
22
|
-
useClass: ipfilter_guard_1.IpFilterGuard,
|
|
23
|
-
};
|
|
24
|
-
return {
|
|
25
|
-
module: IpFilterCoreModule_1,
|
|
26
|
-
providers: [ipFilterGuardProvider, ipFilterServiceProvider],
|
|
27
|
-
exports: [ipFilterServiceProvider],
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
static forRootAsync(options) {
|
|
31
|
-
const provider = {
|
|
32
|
-
inject: [ipfilter_constants_1.IPFILTER_MODULE_OPTIONS],
|
|
33
|
-
provide: ipfilter_constants_1.IPFILTER_TOKEN,
|
|
34
|
-
useFactory: (options) => new ipfilter_service_1.IpFilterService(options),
|
|
35
|
-
};
|
|
36
|
-
const ipFilterGuardProvider = {
|
|
37
|
-
provide: core_1.APP_GUARD,
|
|
38
|
-
useClass: ipfilter_guard_1.IpFilterGuard,
|
|
39
|
-
};
|
|
40
|
-
return {
|
|
41
|
-
module: IpFilterCoreModule_1,
|
|
42
|
-
imports: options.imports,
|
|
43
|
-
providers: [
|
|
44
|
-
...this.createAsyncProviders(options),
|
|
45
|
-
ipFilterGuardProvider,
|
|
46
|
-
provider,
|
|
47
|
-
],
|
|
48
|
-
exports: [provider],
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
static createAsyncProviders(options) {
|
|
52
|
-
if (options.useExisting || options.useFactory) {
|
|
53
|
-
return [this.createAsyncOptionsProvider(options)];
|
|
54
|
-
}
|
|
55
|
-
const useClass = options.useClass;
|
|
56
|
-
return [
|
|
57
|
-
this.createAsyncOptionsProvider(options),
|
|
58
|
-
{
|
|
59
|
-
provide: useClass,
|
|
60
|
-
useClass,
|
|
61
|
-
},
|
|
62
|
-
];
|
|
63
|
-
}
|
|
64
|
-
static createAsyncOptionsProvider(options) {
|
|
65
|
-
if (options.useFactory) {
|
|
66
|
-
return {
|
|
67
|
-
inject: options.inject || [],
|
|
68
|
-
provide: ipfilter_constants_1.IPFILTER_MODULE_OPTIONS,
|
|
69
|
-
useFactory: options.useFactory,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
const inject = [
|
|
73
|
-
(options.useClass || options.useExisting),
|
|
74
|
-
];
|
|
75
|
-
return {
|
|
76
|
-
provide: ipfilter_constants_1.IPFILTER_MODULE_OPTIONS,
|
|
77
|
-
useFactory: async (optionsFactory) => await optionsFactory.createIpFilterModuleOptions(),
|
|
78
|
-
inject,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
IpFilterCoreModule = IpFilterCoreModule_1 = __decorate([
|
|
83
|
-
(0, common_1.Global)(),
|
|
84
|
-
(0, common_1.Module)({})
|
|
85
|
-
], IpFilterCoreModule);
|
|
86
|
-
exports.IpFilterCoreModule = IpFilterCoreModule;
|
|
87
|
-
//# sourceMappingURL=ipfilter-core.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ipfilter-core.module.js","sourceRoot":"","sources":["../lib/ipfilter-core.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAgE;AAMhE,6DAA+E;AAC/E,6DAA+D;AAC/D,yDAAqD;AACrD,uCAAyC;AACzC,qDAAiD;AAIjD,IAAa,kBAAkB,0BAA/B,MAAa,kBAAkB;IAC7B,MAAM,CAAC,OAAO,CAAC,OAA8B;QAC3C,MAAM,uBAAuB,GAAG,IAAA,4CAAuB,EAAC,OAAO,CAAC,CAAC;QACjE,MAAM,qBAAqB,GAAG;YAC5B,OAAO,EAAE,gBAAS;YAClB,QAAQ,EAAE,8BAAa;SACxB,CAAC;QAEF,OAAO;YACL,MAAM,EAAE,oBAAkB;YAC1B,SAAS,EAAE,CAAC,qBAAqB,EAAE,uBAAuB,CAAC;YAC3D,OAAO,EAAE,CAAC,uBAAuB,CAAC;SACnC,CAAC;IACJ,CAAC;IAED,MAAM,CAA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AAE,4CAAuB;YAChC,UAAU,EAAE,KAAK,EAAE,cAAsC,EAAE,EAAE,CAC3D,MAAM,cAAc,CAAC,2BAA2B,EAAE;YACpD,MAAM;SACP,CAAC;IACJ,CAAC;CACF,CAAA;AA/EY,kBAAkB;IAF9B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,kBAAkB,CA+E9B;AA/EY,gDAAkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ipfilter-deny.exception.js","sourceRoot":"","sources":["../lib/ipfilter-deny.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAE/C,MAAa,qBAAsB,SAAQ,sBAAa;IACtD,YAAY,QAAsC,EAAE,MAAc;QAChE,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC1B,CAAC;CACF;AAJD,sDAIC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ipfilter.constants.js","sourceRoot":"","sources":["../lib/ipfilter.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,uBAAuB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAC1D,QAAA,cAAc,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ipfilter.guard.js","sourceRoot":"","sources":["../lib/ipfilter.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAKwB;AAExB,qDAAqD;AACrD,yDAAqD;AACrD,6DAAsD;AACtD,uEAAkE;AAGlE,IAAa,aAAa,GAA1B,MAAa,aAAa;IACxB,YAEmB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAChD,CAAC;IAEJ,WAAW,CACT,OAAyB;QAEzB,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,SAAS,GAAW,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAEzD,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC;QACjD,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC;QAEjD,IAAI,QAAQ,GAAG,KAAK,CAAC;QAErB,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;gBACjC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;SACJ;QAED,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,QAAQ,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;gBAClC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;SACJ;QAED,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE;YACtD,MAAM,IAAI,+CAAqB,CAC7B;gBACE,QAAQ,EAAE,SAAS;gBACnB,SAAS,EAAE,SAAS;gBACpB,SAAS,EAAE,SAAS;aACrB,EACD,GAAG,CACJ,CAAC;SACH;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAA;AA1CY,aAAa;IADzB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,mCAAc,CAAC,CAAA;qCACW,kCAAe;GAHxC,aAAa,CA0CzB;AA1CY,sCAAa"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ipfilter.interface.js","sourceRoot":"","sources":["../lib/ipfilter.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ipfilter.module.js","sourceRoot":"","sources":["../lib/ipfilter.module.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,iEAA4D;AAM5D,IAAA,eAAM,EAAC,EAAE,CAAC,CAAC;AACX,MAAa,QAAQ;IACnB,MAAM,CAAC,OAAO,CAAC,OAA8B;QAC3C,OAAO;YACL,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,CAAC,yCAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;SAC/C,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,OAAmC;QACrD,OAAO;YACL,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,CAAC,yCAAkB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;SACpD,CAAC;IACJ,CAAC;CACF;AAdD,4BAcC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createIpFilterProviders = void 0;
|
|
4
|
-
const ipfilter_constants_1 = require("./ipfilter.constants");
|
|
5
|
-
const ipfilter_service_1 = require("./ipfilter.service");
|
|
6
|
-
function createIpFilterProviders(options) {
|
|
7
|
-
return {
|
|
8
|
-
provide: ipfilter_constants_1.IPFILTER_TOKEN,
|
|
9
|
-
useValue: new ipfilter_service_1.IpFilterService(options),
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
exports.createIpFilterProviders = createIpFilterProviders;
|
|
13
|
-
//# sourceMappingURL=ipfilter.providers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ipfilter.providers.js","sourceRoot":"","sources":["../lib/ipfilter.providers.ts"],"names":[],"mappings":";;;AAEA,6DAAsD;AACtD,yDAAqD;AAErD,SAAgB,uBAAuB,CACrC,OAA8B;IAE9B,OAAO;QACL,OAAO,EAAE,mCAAc;QACvB,QAAQ,EAAE,IAAI,kCAAe,CAAC,OAAO,CAAC;KACvC,CAAC;AACJ,CAAC;AAPD,0DAOC"}
|
|
@@ -1 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