@nestlab/google-recaptcha 3.5.0 → 3.7.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +53 -0
  3. package/decorators/recaptcha-result.js +0 -1
  4. package/decorators/recaptcha.js +0 -1
  5. package/decorators/set-recaptcha-options.js +0 -1
  6. package/enums/classification-reason.js +0 -1
  7. package/enums/error-code.js +0 -1
  8. package/enums/google-recaptcha-context.js +0 -1
  9. package/enums/google-recaptcha-enterprise-reason.js +0 -1
  10. package/enums/google-recaptcha-network.js +0 -1
  11. package/exceptions/google-recaptcha-network.exception.js +0 -1
  12. package/exceptions/google-recaptcha.exception.js +0 -1
  13. package/google-recaptcha.module.js +10 -1
  14. package/guards/google-recaptcha.guard.d.ts +3 -3
  15. package/guards/google-recaptcha.guard.js +14 -10
  16. package/helpers/get-error-info.js +0 -1
  17. package/helpers/load-module.js +0 -1
  18. package/helpers/xor.js +0 -1
  19. package/index.d.ts +1 -0
  20. package/index.js +3 -2
  21. package/interfaces/google-recaptcha-enterprise-options.js +0 -1
  22. package/interfaces/google-recaptcha-guard-options.d.ts +3 -2
  23. package/interfaces/google-recaptcha-guard-options.js +0 -1
  24. package/interfaces/google-recaptcha-module-options.js +0 -1
  25. package/interfaces/google-recaptcha-validator-options.js +0 -1
  26. package/interfaces/literal-object.js +0 -1
  27. package/interfaces/verify-response-decorator-options.d.ts +3 -1
  28. package/interfaces/verify-response-decorator-options.js +0 -1
  29. package/interfaces/verify-response-enterprise.d.ts +1 -0
  30. package/interfaces/verify-response-enterprise.js +0 -1
  31. package/interfaces/verify-response.js +0 -1
  32. package/models/recaptcha-config-ref.d.ts +12 -0
  33. package/models/recaptcha-config-ref.js +30 -0
  34. package/models/recaptcha-verification-result.d.ts +2 -0
  35. package/models/recaptcha-verification-result.js +2 -1
  36. package/package.json +7 -7
  37. package/provider.declarations.js +0 -1
  38. package/services/enterprise-reason.transformer.js +0 -1
  39. package/services/recaptcha-request.resolver.js +0 -1
  40. package/services/recaptcha-validator.resolver.d.ts +3 -3
  41. package/services/recaptcha-validator.resolver.js +8 -11
  42. package/services/validators/abstract-google-recaptcha-validator.d.ts +3 -3
  43. package/services/validators/abstract-google-recaptcha-validator.js +2 -3
  44. package/services/validators/google-recaptcha-enterprise.validator.d.ts +2 -2
  45. package/services/validators/google-recaptcha-enterprise.validator.js +16 -13
  46. package/services/validators/google-recaptcha.validator.d.ts +2 -2
  47. package/services/validators/google-recaptcha.validator.js +14 -12
  48. package/types.d.ts +5 -3
  49. package/types.js +0 -1
  50. package/decorators/recaptcha-result.js.map +0 -1
  51. package/decorators/recaptcha.js.map +0 -1
  52. package/decorators/set-recaptcha-options.js.map +0 -1
  53. package/enums/classification-reason.js.map +0 -1
  54. package/enums/error-code.js.map +0 -1
  55. package/enums/google-recaptcha-context.js.map +0 -1
  56. package/enums/google-recaptcha-enterprise-reason.js.map +0 -1
  57. package/enums/google-recaptcha-network.js.map +0 -1
  58. package/exceptions/google-recaptcha-network.exception.js.map +0 -1
  59. package/exceptions/google-recaptcha.exception.js.map +0 -1
  60. package/google-recaptcha.module.js.map +0 -1
  61. package/guards/google-recaptcha.guard.js.map +0 -1
  62. package/helpers/get-error-info.js.map +0 -1
  63. package/helpers/load-module.js.map +0 -1
  64. package/helpers/xor.js.map +0 -1
  65. package/index.js.map +0 -1
  66. package/interfaces/google-recaptcha-enterprise-options.js.map +0 -1
  67. package/interfaces/google-recaptcha-guard-options.js.map +0 -1
  68. package/interfaces/google-recaptcha-module-options.js.map +0 -1
  69. package/interfaces/google-recaptcha-validator-options.js.map +0 -1
  70. package/interfaces/literal-object.js.map +0 -1
  71. package/interfaces/verify-response-decorator-options.js.map +0 -1
  72. package/interfaces/verify-response-enterprise.js.map +0 -1
  73. package/interfaces/verify-response.js.map +0 -1
  74. package/models/recaptcha-verification-result.js.map +0 -1
  75. package/provider.declarations.js.map +0 -1
  76. package/services/enterprise-reason.transformer.js.map +0 -1
  77. package/services/recaptcha-request.resolver.js.map +0 -1
  78. package/services/recaptcha-validator.resolver.js.map +0 -1
  79. package/services/validators/abstract-google-recaptcha-validator.js.map +0 -1
  80. package/services/validators/google-recaptcha-enterprise.validator.js.map +0 -1
  81. package/services/validators/google-recaptcha.validator.js.map +0 -1
  82. package/types.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## v3.7.0
4
+ - Added `RecaptchaConfigRef` for dynamic configuration
5
+
6
+ ## v3.6.0
7
+ - Added `remoteIp?: (req) => string` option into:
8
+ - Module options
9
+ - Decorator options to override default
10
+ - Validator options
11
+
3
12
  ## v3.5.0
4
13
  - Added `global?: boolean` module option
5
14
 
package/README.md CHANGED
@@ -27,6 +27,7 @@ This package provides protection for endpoints using [reCAPTCHA](https://www.goo
27
27
  * [Graphql application](#usage-in-graphql-application)
28
28
  * [Validate in service](#validate-in-service)
29
29
  * [Validate in service (Enterprise)](#validate-in-service-enterprise)
30
+ * [Dynamic Recaptcha configuration](#dynamic-recaptcha-configuration)
30
31
  * [Error handling](#error-handling)
31
32
  * [Contribution](#contribution)
32
33
  * [License](#license)
@@ -61,6 +62,7 @@ The list of changes made in the project can be found in the [CHANGELOG.md](./CHA
61
62
  | `network` | Optional.<br> Type: `GoogleRecaptchaNetwork` \| `string`<br> Default: `GoogleRecaptchaNetwork.Google` <br> If your server has trouble connecting to https://google.com then you can set networks:<br> `GoogleRecaptchaNetwork.Google` = 'https://www.google.com/recaptcha/api/siteverify'<br>`GoogleRecaptchaNetwork.Recaptcha` = 'https://recaptcha.net/recaptcha/api/siteverify'<br> or set any api url |
62
63
  | `score` | Optional.<br> Type: `number` \| `(score: number) => boolean`<br> Score validator for reCAPTCHA v3 or enterprise. <br> `number` - minimum available score. <br> `(score: number) => boolean` - function with custom validation rules. |
63
64
  | `actions` | Optional.<br> Type: `string[]`<br> Available action list for reCAPTCHA v3 or enterprise. <br> You can make this check stricter by passing the action property parameter to `@Recaptcha(...)` decorator. |
65
+ | `remoteIp` | Optional.<br> Type: `(request) => string`<br> A function that returns a remote IP address from the request |
64
66
  | `axiosConfig` | Optional.<br> Type: `AxiosRequestConfig`<br> Allows to setup proxy, response timeout, https agent etc... |
65
67
  | `global` | Optional.<br> Type: `boolean` <br> Default: `false` Defines a module in the [global scope](https://docs.nestjs.com/modules#global-modules). |
66
68
 
@@ -470,6 +472,57 @@ export class SomeService {
470
472
  }
471
473
  ```
472
474
 
475
+ ### Dynamic Recaptcha configuration
476
+ The `RecaptchaConfigRef` class provides a convenient way to modify Recaptcha validation parameters within your application.
477
+ This can be particularly useful in scenarios where the administration of Recaptcha is managed dynamically, such as by an administrator.
478
+ The class exposes methods that allow the customization of various Recaptcha options.
479
+
480
+
481
+ **RecaptchaConfigRef API:**
482
+
483
+ ```typescript
484
+ @Injectable()
485
+ class RecaptchaConfigRef {
486
+ // Sets the secret key for Recaptcha validation.
487
+ setSecretKey(secretKey: string): this;
488
+
489
+ // Sets enterprise-specific options for Recaptcha validation
490
+ setEnterpriseOptions(options: GoogleRecaptchaEnterpriseOptions): this;
491
+
492
+ // Sets the score threshold for Recaptcha validation.
493
+ setScore(score: ScoreValidator): this;
494
+
495
+ // Sets conditions under which Recaptcha validation should be skipped.
496
+ setSkipIf(skipIf: SkipIfValue): this;
497
+ }
498
+ ```
499
+
500
+ **Usage example:**
501
+
502
+ ```typescript
503
+ @Injectable()
504
+ export class RecaptchaAdminService implements OnApplicationBootstrap {
505
+ constructor(private readonly recaptchaConfigRef: RecaptchaConfigRef) {
506
+ }
507
+
508
+ async onApplicationBootstrap(): Promise<void> {
509
+ // TODO: Pull recaptcha configs from your database
510
+
511
+ this.recaptchaConfigRef
512
+ .setSecretKey('SECRET_KEY_VALUE')
513
+ .setScore(0.3);
514
+ }
515
+
516
+ async updateSecretKey(secretKey: string): Promise<void> {
517
+ // TODO: Save new secret key to your database
518
+
519
+ this.recaptchaConfigRef.setSecretKey(secretKey);
520
+ }
521
+ }
522
+ ```
523
+
524
+ After call `this.recaptchaConfigRef.setSecretKey(...)` - `@Recaptcha` guard and `GoogleRecaptchaValidator` will use new secret key.
525
+
473
526
  ### Error handling
474
527
 
475
528
  **GoogleRecaptchaException**
@@ -12,4 +12,3 @@ exports.RecaptchaResult = (0, common_1.createParamDecorator)((data, context) =>
12
12
  return (_d = (_c = (_b = (_a = (0, load_module_1.loadModule)('@nestjs/graphql', true).GqlExecutionContext.create(context).getContext().req) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b._httpMessage) === null || _c === void 0 ? void 0 : _c.req) === null || _d === void 0 ? void 0 : _d.recaptchaValidationResult;
13
13
  }
14
14
  });
15
- //# sourceMappingURL=recaptcha-result.js.map
@@ -8,4 +8,3 @@ function Recaptcha(options) {
8
8
  return (0, common_1.applyDecorators)((0, set_recaptcha_options_1.SetRecaptchaOptions)(options), (0, common_1.UseGuards)(google_recaptcha_guard_1.GoogleRecaptchaGuard));
9
9
  }
10
10
  exports.Recaptcha = Recaptcha;
11
- //# sourceMappingURL=recaptcha.js.map
@@ -7,4 +7,3 @@ function SetRecaptchaOptions(options) {
7
7
  return (0, common_1.SetMetadata)(provider_declarations_1.RECAPTCHA_VALIDATION_OPTIONS, options);
8
8
  }
9
9
  exports.SetRecaptchaOptions = SetRecaptchaOptions;
10
- //# sourceMappingURL=set-recaptcha-options.js.map
@@ -10,4 +10,3 @@ var ClassificationReason;
10
10
  ClassificationReason["UNEXPECTED_USAGE_PATTERNS"] = "UNEXPECTED_USAGE_PATTERNS";
11
11
  ClassificationReason["LOW_CONFIDENCE_SCORE"] = "LOW_CONFIDENCE_SCORE";
12
12
  })(ClassificationReason = exports.ClassificationReason || (exports.ClassificationReason = {}));
13
- //# sourceMappingURL=classification-reason.js.map
@@ -19,4 +19,3 @@ var ErrorCode;
19
19
  ErrorCode["SiteMismatch"] = "site-mismatch";
20
20
  ErrorCode["BrowserError"] = "browser-error";
21
21
  })(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
22
- //# sourceMappingURL=error-code.js.map
@@ -6,4 +6,3 @@ var GoogleRecaptchaContext;
6
6
  GoogleRecaptchaContext["GoogleRecaptcha"] = "GoogleRecaptcha";
7
7
  GoogleRecaptchaContext["GoogleRecaptchaEnterprise"] = "GoogleRecaptchaEnterprise";
8
8
  })(GoogleRecaptchaContext = exports.GoogleRecaptchaContext || (exports.GoogleRecaptchaContext = {}));
9
- //# sourceMappingURL=google-recaptcha-context.js.map
@@ -12,4 +12,3 @@ var GoogleRecaptchaEnterpriseReason;
12
12
  GoogleRecaptchaEnterpriseReason["Missing"] = "MISSING";
13
13
  GoogleRecaptchaEnterpriseReason["BrowserError"] = "BROWSER_ERROR";
14
14
  })(GoogleRecaptchaEnterpriseReason = exports.GoogleRecaptchaEnterpriseReason || (exports.GoogleRecaptchaEnterpriseReason = {}));
15
- //# sourceMappingURL=google-recaptcha-enterprise-reason.js.map
@@ -6,4 +6,3 @@ var GoogleRecaptchaNetwork;
6
6
  GoogleRecaptchaNetwork["Google"] = "https://www.google.com/recaptcha/api/siteverify";
7
7
  GoogleRecaptchaNetwork["Recaptcha"] = "https://recaptcha.net/recaptcha/api/siteverify";
8
8
  })(GoogleRecaptchaNetwork = exports.GoogleRecaptchaNetwork || (exports.GoogleRecaptchaNetwork = {}));
9
- //# sourceMappingURL=google-recaptcha-network.js.map
@@ -10,4 +10,3 @@ class GoogleRecaptchaNetworkException extends google_recaptcha_exception_1.Googl
10
10
  }
11
11
  }
12
12
  exports.GoogleRecaptchaNetworkException = GoogleRecaptchaNetworkException;
13
- //# sourceMappingURL=google-recaptcha-network.exception.js.map
@@ -52,4 +52,3 @@ class GoogleRecaptchaException extends common_1.HttpException {
52
52
  }
53
53
  }
54
54
  exports.GoogleRecaptchaException = GoogleRecaptchaException;
55
- //# sourceMappingURL=google-recaptcha.exception.js.map
@@ -13,6 +13,7 @@ const https_1 = require("https");
13
13
  const recaptcha_validator_resolver_1 = require("./services/recaptcha-validator.resolver");
14
14
  const enterprise_reason_transformer_1 = require("./services/enterprise-reason.transformer");
15
15
  const xor_1 = require("./helpers/xor");
16
+ const recaptcha_config_ref_1 = require("./models/recaptcha-config-ref");
16
17
  class GoogleRecaptchaModule {
17
18
  static forRoot(options) {
18
19
  const providers = [
@@ -31,6 +32,10 @@ class GoogleRecaptchaModule {
31
32
  provide: provider_declarations_1.RECAPTCHA_LOGGER,
32
33
  useFactory: () => options.logger || new common_1.Logger(),
33
34
  },
35
+ {
36
+ provide: recaptcha_config_ref_1.RecaptchaConfigRef,
37
+ useFactory: () => new recaptcha_config_ref_1.RecaptchaConfigRef(options),
38
+ },
34
39
  ];
35
40
  this.validateOptions(options);
36
41
  const internalProviders = [
@@ -54,6 +59,11 @@ class GoogleRecaptchaModule {
54
59
  useFactory: (options) => options.logger || new common_1.Logger(),
55
60
  inject: [provider_declarations_1.RECAPTCHA_OPTIONS],
56
61
  },
62
+ {
63
+ provide: recaptcha_config_ref_1.RecaptchaConfigRef,
64
+ useFactory: (opts) => new recaptcha_config_ref_1.RecaptchaConfigRef(opts),
65
+ inject: [provider_declarations_1.RECAPTCHA_OPTIONS],
66
+ },
57
67
  google_recaptcha_guard_1.GoogleRecaptchaGuard,
58
68
  google_recaptcha_validator_1.GoogleRecaptchaValidator,
59
69
  google_recaptcha_enterprise_validator_1.GoogleRecaptchaEnterpriseValidator,
@@ -139,4 +149,3 @@ GoogleRecaptchaModule.axiosDefaultConfig = {
139
149
  timeout: 60000,
140
150
  httpsAgent: new https_1.Agent({ keepAlive: true }),
141
151
  };
142
- //# sourceMappingURL=google-recaptcha.module.js.map
@@ -1,15 +1,15 @@
1
1
  import { CanActivate, ExecutionContext, Logger } from '@nestjs/common';
2
2
  import { Reflector } from '@nestjs/core';
3
3
  import { RecaptchaRequestResolver } from '../services/recaptcha-request.resolver';
4
- import { GoogleRecaptchaModuleOptions } from '../interfaces/google-recaptcha-module-options';
5
4
  import { RecaptchaValidatorResolver } from '../services/recaptcha-validator.resolver';
5
+ import { RecaptchaConfigRef } from '../models/recaptcha-config-ref';
6
6
  export declare class GoogleRecaptchaGuard implements CanActivate {
7
7
  private readonly reflector;
8
8
  private readonly requestResolver;
9
9
  private readonly validatorResolver;
10
10
  private readonly logger;
11
- private readonly options;
12
- constructor(reflector: Reflector, requestResolver: RecaptchaRequestResolver, validatorResolver: RecaptchaValidatorResolver, logger: Logger, options: GoogleRecaptchaModuleOptions);
11
+ private readonly configRef;
12
+ constructor(reflector: Reflector, requestResolver: RecaptchaRequestResolver, validatorResolver: RecaptchaValidatorResolver, logger: Logger, configRef: RecaptchaConfigRef);
13
13
  canActivate(context: ExecutionContext): Promise<true | never>;
14
14
  private resolveLogContext;
15
15
  }
@@ -21,27 +21,32 @@ const recaptcha_request_resolver_1 = require("../services/recaptcha-request.reso
21
21
  const recaptcha_validator_resolver_1 = require("../services/recaptcha-validator.resolver");
22
22
  const google_recaptcha_context_1 = require("../enums/google-recaptcha-context");
23
23
  const google_recaptcha_enterprise_validator_1 = require("../services/validators/google-recaptcha-enterprise.validator");
24
+ const recaptcha_config_ref_1 = require("../models/recaptcha-config-ref");
24
25
  let GoogleRecaptchaGuard = class GoogleRecaptchaGuard {
25
- constructor(reflector, requestResolver, validatorResolver, logger, options) {
26
+ constructor(reflector, requestResolver, validatorResolver, logger, configRef) {
26
27
  this.reflector = reflector;
27
28
  this.requestResolver = requestResolver;
28
29
  this.validatorResolver = validatorResolver;
29
30
  this.logger = logger;
30
- this.options = options;
31
+ this.configRef = configRef;
31
32
  }
32
33
  async canActivate(context) {
33
34
  const request = this.requestResolver.resolve(context);
34
- const skip = typeof this.options.skipIf === 'function' ? await this.options.skipIf(request) : !!this.options.skipIf;
35
+ const skipIfValue = this.configRef.valueOf.skipIf;
36
+ const skip = typeof skipIfValue === 'function' ? await skipIfValue(request) : !!skipIfValue;
35
37
  if (skip) {
36
38
  return true;
37
39
  }
38
40
  const options = this.reflector.get(provider_declarations_1.RECAPTCHA_VALIDATION_OPTIONS, context.getHandler());
39
- const response = (options === null || options === void 0 ? void 0 : options.response) ? await options.response(request) : await this.options.response(request);
40
- const score = (options === null || options === void 0 ? void 0 : options.score) || this.options.score;
41
+ const [response, remoteIp] = await Promise.all([
42
+ (options === null || options === void 0 ? void 0 : options.response) ? await options.response(request) : await this.configRef.valueOf.response(request),
43
+ (options === null || options === void 0 ? void 0 : options.remoteIp) ? await options.remoteIp(request) : await this.configRef.valueOf.remoteIp && this.configRef.valueOf.remoteIp(request),
44
+ ]);
45
+ const score = (options === null || options === void 0 ? void 0 : options.score) || this.configRef.valueOf.score;
41
46
  const action = options === null || options === void 0 ? void 0 : options.action;
42
47
  const validator = this.validatorResolver.resolve();
43
- request.recaptchaValidationResult = await validator.validate({ response, score, action });
44
- if (this.options.debug) {
48
+ request.recaptchaValidationResult = await validator.validate({ response, remoteIp, score, action });
49
+ if (this.configRef.valueOf.debug) {
45
50
  const loggerCtx = this.resolveLogContext(validator);
46
51
  this.logger.debug(request.recaptchaValidationResult.toObject(), `${loggerCtx}.result`);
47
52
  }
@@ -59,11 +64,10 @@ let GoogleRecaptchaGuard = class GoogleRecaptchaGuard {
59
64
  GoogleRecaptchaGuard = __decorate([
60
65
  (0, common_1.Injectable)(),
61
66
  __param(3, (0, common_1.Inject)(provider_declarations_1.RECAPTCHA_LOGGER)),
62
- __param(4, (0, common_1.Inject)(provider_declarations_1.RECAPTCHA_OPTIONS)),
63
67
  __metadata("design:paramtypes", [core_1.Reflector,
64
68
  recaptcha_request_resolver_1.RecaptchaRequestResolver,
65
69
  recaptcha_validator_resolver_1.RecaptchaValidatorResolver,
66
- common_1.Logger, Object])
70
+ common_1.Logger,
71
+ recaptcha_config_ref_1.RecaptchaConfigRef])
67
72
  ], GoogleRecaptchaGuard);
68
73
  exports.GoogleRecaptchaGuard = GoogleRecaptchaGuard;
69
- //# sourceMappingURL=google-recaptcha.guard.js.map
@@ -13,4 +13,3 @@ function getErrorInfo(error) {
13
13
  return { error: error.name, message: error.message, stack: error.stack };
14
14
  }
15
15
  exports.getErrorInfo = getErrorInfo;
16
- //# sourceMappingURL=get-error-info.js.map
@@ -14,4 +14,3 @@ function loadModule(moduleName, logError = false) {
14
14
  }
15
15
  }
16
16
  exports.loadModule = loadModule;
17
- //# sourceMappingURL=load-module.js.map
package/helpers/xor.js CHANGED
@@ -5,4 +5,3 @@ function xor(a, b) {
5
5
  return !!a !== !!b;
6
6
  }
7
7
  exports.xor = xor;
8
- //# sourceMappingURL=xor.js.map
package/index.d.ts CHANGED
@@ -12,3 +12,4 @@ export { GoogleRecaptchaValidator } from './services/validators/google-recaptcha
12
12
  export { GoogleRecaptchaEnterpriseValidator } from './services/validators/google-recaptcha-enterprise.validator';
13
13
  export { RecaptchaVerificationResult } from './models/recaptcha-verification-result';
14
14
  export { ClassificationReason } from './enums/classification-reason';
15
+ export { RecaptchaConfigRef } from './models/recaptcha-config-ref';
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClassificationReason = exports.RecaptchaVerificationResult = exports.GoogleRecaptchaEnterpriseValidator = exports.GoogleRecaptchaValidator = exports.GoogleRecaptchaNetworkException = exports.GoogleRecaptchaException = exports.GoogleRecaptchaNetwork = exports.ErrorCode = exports.GoogleRecaptchaModule = exports.GoogleRecaptchaGuard = exports.RecaptchaResult = exports.SetRecaptchaOptions = exports.Recaptcha = void 0;
3
+ exports.RecaptchaConfigRef = exports.ClassificationReason = exports.RecaptchaVerificationResult = exports.GoogleRecaptchaEnterpriseValidator = exports.GoogleRecaptchaValidator = exports.GoogleRecaptchaNetworkException = exports.GoogleRecaptchaException = exports.GoogleRecaptchaNetwork = exports.ErrorCode = exports.GoogleRecaptchaModule = exports.GoogleRecaptchaGuard = exports.RecaptchaResult = exports.SetRecaptchaOptions = exports.Recaptcha = void 0;
4
4
  var recaptcha_1 = require("./decorators/recaptcha");
5
5
  Object.defineProperty(exports, "Recaptcha", { enumerable: true, get: function () { return recaptcha_1.Recaptcha; } });
6
6
  var set_recaptcha_options_1 = require("./decorators/set-recaptcha-options");
@@ -27,4 +27,5 @@ var recaptcha_verification_result_1 = require("./models/recaptcha-verification-r
27
27
  Object.defineProperty(exports, "RecaptchaVerificationResult", { enumerable: true, get: function () { return recaptcha_verification_result_1.RecaptchaVerificationResult; } });
28
28
  var classification_reason_1 = require("./enums/classification-reason");
29
29
  Object.defineProperty(exports, "ClassificationReason", { enumerable: true, get: function () { return classification_reason_1.ClassificationReason; } });
30
- //# sourceMappingURL=index.js.map
30
+ var recaptcha_config_ref_1 = require("./models/recaptcha-config-ref");
31
+ Object.defineProperty(exports, "RecaptchaConfigRef", { enumerable: true, get: function () { return recaptcha_config_ref_1.RecaptchaConfigRef; } });
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=google-recaptcha-enterprise-options.js.map
@@ -1,6 +1,7 @@
1
- import { RecaptchaResponseProvider, ScoreValidator } from '../types';
1
+ import { RecaptchaRemoteIpProvider, RecaptchaResponseProvider, ScoreValidator, SkipIfValue } from '../types';
2
2
  export interface GoogleRecaptchaGuardOptions {
3
3
  response: RecaptchaResponseProvider;
4
- skipIf?: boolean | (<Req = unknown>(request: Req) => boolean | Promise<boolean>);
4
+ remoteIp?: RecaptchaRemoteIpProvider;
5
+ skipIf?: SkipIfValue;
5
6
  score?: ScoreValidator;
6
7
  }
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=google-recaptcha-guard-options.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=google-recaptcha-module-options.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=google-recaptcha-validator-options.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=literal-object.js.map
@@ -1,11 +1,13 @@
1
- import { RecaptchaResponseProvider, ScoreValidator } from '../types';
1
+ import { RecaptchaRemoteIpProvider, RecaptchaResponseProvider, ScoreValidator } from '../types';
2
2
  export interface VerifyResponseDecoratorOptions {
3
3
  response?: RecaptchaResponseProvider;
4
+ remoteIp?: RecaptchaRemoteIpProvider;
4
5
  score?: ScoreValidator;
5
6
  action?: string;
6
7
  }
7
8
  export interface VerifyResponseOptions {
8
9
  response: string;
10
+ remoteIp?: string;
9
11
  score?: ScoreValidator;
10
12
  action?: string;
11
13
  }
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=verify-response-decorator-options.js.map
@@ -10,6 +10,7 @@ export interface VerifyTokenEnterpriseEvent {
10
10
  token: string;
11
11
  siteKey: string;
12
12
  expectedAction: string;
13
+ userIpAddress?: string;
13
14
  }
14
15
  export interface VerifyTokenEnterpriseResponseEvent extends VerifyTokenEnterpriseEvent {
15
16
  userAgent: string;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=verify-response-enterprise.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=verify-response.js.map
@@ -0,0 +1,12 @@
1
+ import { GoogleRecaptchaModuleOptions } from '../interfaces/google-recaptcha-module-options';
2
+ import { GoogleRecaptchaEnterpriseOptions } from '../interfaces/google-recaptcha-enterprise-options';
3
+ import { ScoreValidator, SkipIfValue } from '../types';
4
+ export declare class RecaptchaConfigRef {
5
+ private readonly value;
6
+ get valueOf(): GoogleRecaptchaModuleOptions;
7
+ constructor(value: GoogleRecaptchaModuleOptions);
8
+ setSecretKey(secretKey: string): this;
9
+ setEnterpriseOptions(options: GoogleRecaptchaEnterpriseOptions): this;
10
+ setScore(score: ScoreValidator): this;
11
+ setSkipIf(skipIf: SkipIfValue): this;
12
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RecaptchaConfigRef = void 0;
4
+ class RecaptchaConfigRef {
5
+ constructor(value) {
6
+ this.value = value;
7
+ }
8
+ get valueOf() {
9
+ return this.value;
10
+ }
11
+ setSecretKey(secretKey) {
12
+ this.value.secretKey = secretKey;
13
+ this.value.enterprise = undefined;
14
+ return this;
15
+ }
16
+ setEnterpriseOptions(options) {
17
+ this.value.secretKey = undefined;
18
+ this.value.enterprise = options;
19
+ return this;
20
+ }
21
+ setScore(score) {
22
+ this.value.score = score;
23
+ return this;
24
+ }
25
+ setSkipIf(skipIf) {
26
+ this.value.skipIf = skipIf;
27
+ return this;
28
+ }
29
+ }
30
+ exports.RecaptchaConfigRef = RecaptchaConfigRef;
@@ -7,12 +7,14 @@ export interface RecaptchaVerificationResultOptions<Res> {
7
7
  hostname: string;
8
8
  action?: string;
9
9
  score?: number;
10
+ remoteIp?: string;
10
11
  errors: ErrorCode[];
11
12
  }
12
13
  export declare class RecaptchaVerificationResult<Res = LiteralObject> {
13
14
  private readonly options;
14
15
  readonly success: boolean;
15
16
  readonly hostname: string;
17
+ readonly remoteIp: string | undefined;
16
18
  readonly action: string | undefined;
17
19
  readonly score: number | undefined;
18
20
  readonly nativeResponse: Res;
@@ -7,6 +7,7 @@ class RecaptchaVerificationResult {
7
7
  this.success = options.success;
8
8
  this.hostname = options.hostname;
9
9
  this.action = options.action;
10
+ this.remoteIp = options.remoteIp;
10
11
  this.score = options.score;
11
12
  this.errors = options.errors;
12
13
  this.nativeResponse = options.nativeResponse;
@@ -17,6 +18,7 @@ class RecaptchaVerificationResult {
17
18
  hostname: this.hostname,
18
19
  action: this.action,
19
20
  score: this.score,
21
+ remoteIp: this.remoteIp,
20
22
  errors: this.errors,
21
23
  nativeResponse: this.nativeResponse,
22
24
  };
@@ -30,4 +32,3 @@ class RecaptchaVerificationResult {
30
32
  }
31
33
  }
32
34
  exports.RecaptchaVerificationResult = RecaptchaVerificationResult;
33
- //# sourceMappingURL=recaptcha-verification-result.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestlab/google-recaptcha",
3
- "version": "3.5.0",
3
+ "version": "3.7.0",
4
4
  "description": "Google recaptcha module for NestJS.",
5
5
  "keywords": [
6
6
  "nestjs",
@@ -43,13 +43,13 @@
43
43
  }
44
44
  },
45
45
  "devDependencies": {
46
- "@nestjs/apollo": "^12.0.1",
46
+ "@nestjs/apollo": "^12.0.9",
47
47
  "@nestjs/axios": "^3.0.0",
48
- "@nestjs/common": "^10.0.1",
49
- "@nestjs/core": "^10.0.1",
50
- "@nestjs/graphql": "^12.0.1",
51
- "@nestjs/platform-express": "^10.0.1",
52
- "@nestjs/testing": "^10.0.1",
48
+ "@nestjs/common": "^10.2.7",
49
+ "@nestjs/core": "^10.2.7",
50
+ "@nestjs/graphql": "^12.0.9",
51
+ "@nestjs/platform-express": "^10.2.7",
52
+ "@nestjs/testing": "^10.2.7",
53
53
  "@types/express": "^4.17.13",
54
54
  "@types/jest": "^29.0.0",
55
55
  "@types/node": "^18.7.14",
@@ -5,4 +5,3 @@ exports.RECAPTCHA_OPTIONS = Symbol('RECAPTCHA_OPTIONS');
5
5
  exports.RECAPTCHA_VALIDATION_OPTIONS = Symbol('RECAPTCHA_VALIDATION_OPTIONS');
6
6
  exports.RECAPTCHA_AXIOS_INSTANCE = 'RECAPTCHA_AXIOS_INSTANCE';
7
7
  exports.RECAPTCHA_LOGGER = 'RECAPTCHA_LOGGER';
8
- //# sourceMappingURL=provider.declarations.js.map
@@ -36,4 +36,3 @@ EnterpriseReasonTransformer = __decorate([
36
36
  (0, common_1.Injectable)()
37
37
  ], EnterpriseReasonTransformer);
38
38
  exports.EnterpriseReasonTransformer = EnterpriseReasonTransformer;
39
- //# sourceMappingURL=enterprise-reason.transformer.js.map
@@ -27,4 +27,3 @@ RecaptchaRequestResolver = __decorate([
27
27
  (0, common_1.Injectable)()
28
28
  ], RecaptchaRequestResolver);
29
29
  exports.RecaptchaRequestResolver = RecaptchaRequestResolver;
30
- //# sourceMappingURL=recaptcha-request.resolver.js.map
@@ -1,11 +1,11 @@
1
1
  import { AbstractGoogleRecaptchaValidator } from './validators/abstract-google-recaptcha-validator';
2
- import { GoogleRecaptchaModuleOptions } from '../interfaces/google-recaptcha-module-options';
3
2
  import { GoogleRecaptchaValidator } from './validators/google-recaptcha.validator';
4
3
  import { GoogleRecaptchaEnterpriseValidator } from './validators/google-recaptcha-enterprise.validator';
4
+ import { RecaptchaConfigRef } from '../models/recaptcha-config-ref';
5
5
  export declare class RecaptchaValidatorResolver {
6
- private readonly options;
6
+ private readonly configRef;
7
7
  protected readonly googleRecaptchaValidator: GoogleRecaptchaValidator;
8
8
  protected readonly googleRecaptchaEnterpriseValidator: GoogleRecaptchaEnterpriseValidator;
9
- constructor(options: GoogleRecaptchaModuleOptions, googleRecaptchaValidator: GoogleRecaptchaValidator, googleRecaptchaEnterpriseValidator: GoogleRecaptchaEnterpriseValidator);
9
+ constructor(configRef: RecaptchaConfigRef, googleRecaptchaValidator: GoogleRecaptchaValidator, googleRecaptchaEnterpriseValidator: GoogleRecaptchaEnterpriseValidator);
10
10
  resolve(): AbstractGoogleRecaptchaValidator<unknown>;
11
11
  }
@@ -8,26 +8,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
12
  exports.RecaptchaValidatorResolver = void 0;
16
13
  const common_1 = require("@nestjs/common");
17
- const provider_declarations_1 = require("../provider.declarations");
18
14
  const google_recaptcha_validator_1 = require("./validators/google-recaptcha.validator");
19
15
  const google_recaptcha_enterprise_validator_1 = require("./validators/google-recaptcha-enterprise.validator");
16
+ const recaptcha_config_ref_1 = require("../models/recaptcha-config-ref");
20
17
  let RecaptchaValidatorResolver = class RecaptchaValidatorResolver {
21
- constructor(options, googleRecaptchaValidator, googleRecaptchaEnterpriseValidator) {
22
- this.options = options;
18
+ constructor(configRef, googleRecaptchaValidator, googleRecaptchaEnterpriseValidator) {
19
+ this.configRef = configRef;
23
20
  this.googleRecaptchaValidator = googleRecaptchaValidator;
24
21
  this.googleRecaptchaEnterpriseValidator = googleRecaptchaEnterpriseValidator;
25
22
  }
26
23
  resolve() {
27
- if (this.options.secretKey) {
24
+ const configValue = this.configRef.valueOf;
25
+ if (configValue.secretKey) {
28
26
  return this.googleRecaptchaValidator;
29
27
  }
30
- if (Object.keys(this.options.enterprise || {}).length) {
28
+ if (Object.keys(configValue.enterprise || {}).length) {
31
29
  return this.googleRecaptchaEnterpriseValidator;
32
30
  }
33
31
  throw new Error('Cannot resolve google recaptcha validator');
@@ -35,9 +33,8 @@ let RecaptchaValidatorResolver = class RecaptchaValidatorResolver {
35
33
  };
36
34
  RecaptchaValidatorResolver = __decorate([
37
35
  (0, common_1.Injectable)(),
38
- __param(0, (0, common_1.Inject)(provider_declarations_1.RECAPTCHA_OPTIONS)),
39
- __metadata("design:paramtypes", [Object, google_recaptcha_validator_1.GoogleRecaptchaValidator,
36
+ __metadata("design:paramtypes", [recaptcha_config_ref_1.RecaptchaConfigRef,
37
+ google_recaptcha_validator_1.GoogleRecaptchaValidator,
40
38
  google_recaptcha_enterprise_validator_1.GoogleRecaptchaEnterpriseValidator])
41
39
  ], RecaptchaValidatorResolver);
42
40
  exports.RecaptchaValidatorResolver = RecaptchaValidatorResolver;
43
- //# sourceMappingURL=recaptcha-validator.resolver.js.map
@@ -1,10 +1,10 @@
1
1
  import { VerifyResponseOptions } from '../../interfaces/verify-response-decorator-options';
2
2
  import { ScoreValidator } from '../../types';
3
- import { GoogleRecaptchaModuleOptions } from '../../interfaces/google-recaptcha-module-options';
4
3
  import { RecaptchaVerificationResult } from '../../models/recaptcha-verification-result';
4
+ import { RecaptchaConfigRef } from '../../models/recaptcha-config-ref';
5
5
  export declare abstract class AbstractGoogleRecaptchaValidator<Res> {
6
- protected readonly options: GoogleRecaptchaModuleOptions;
7
- protected constructor(options: GoogleRecaptchaModuleOptions);
6
+ protected readonly options: RecaptchaConfigRef;
7
+ protected constructor(options: RecaptchaConfigRef);
8
8
  abstract validate(options: VerifyResponseOptions): Promise<RecaptchaVerificationResult<Res>>;
9
9
  protected isValidAction(action: string, options?: VerifyResponseOptions): boolean;
10
10
  protected isValidScore(score: number, validator?: ScoreValidator): boolean;
@@ -9,10 +9,10 @@ class AbstractGoogleRecaptchaValidator {
9
9
  if (options.action) {
10
10
  return options.action === action;
11
11
  }
12
- return this.options.actions ? this.options.actions.includes(action) : true;
12
+ return this.options.valueOf.actions ? this.options.valueOf.actions.includes(action) : true;
13
13
  }
14
14
  isValidScore(score, validator) {
15
- const finalValidator = validator || this.options.score;
15
+ const finalValidator = validator || this.options.valueOf.score;
16
16
  if (finalValidator) {
17
17
  if (typeof finalValidator === 'function') {
18
18
  return finalValidator(score);
@@ -23,4 +23,3 @@ class AbstractGoogleRecaptchaValidator {
23
23
  }
24
24
  }
25
25
  exports.AbstractGoogleRecaptchaValidator = AbstractGoogleRecaptchaValidator;
26
- //# sourceMappingURL=abstract-google-recaptcha-validator.js.map
@@ -1,17 +1,17 @@
1
1
  import { Logger } from '@nestjs/common';
2
- import { GoogleRecaptchaModuleOptions } from '../../interfaces/google-recaptcha-module-options';
3
2
  import { VerifyResponseOptions } from '../../interfaces/verify-response-decorator-options';
4
3
  import { AbstractGoogleRecaptchaValidator } from './abstract-google-recaptcha-validator';
5
4
  import { RecaptchaVerificationResult } from '../../models/recaptcha-verification-result';
6
5
  import { VerifyResponseEnterprise } from '../../interfaces/verify-response-enterprise';
7
6
  import { EnterpriseReasonTransformer } from '../enterprise-reason.transformer';
8
7
  import { AxiosInstance } from 'axios';
8
+ import { RecaptchaConfigRef } from '../../models/recaptcha-config-ref';
9
9
  export declare class GoogleRecaptchaEnterpriseValidator extends AbstractGoogleRecaptchaValidator<VerifyResponseEnterprise> {
10
10
  private readonly axios;
11
11
  private readonly logger;
12
12
  private readonly enterpriseReasonTransformer;
13
13
  private readonly headers;
14
- constructor(axios: AxiosInstance, logger: Logger, options: GoogleRecaptchaModuleOptions, enterpriseReasonTransformer: EnterpriseReasonTransformer);
14
+ constructor(axios: AxiosInstance, logger: Logger, configRef: RecaptchaConfigRef, enterpriseReasonTransformer: EnterpriseReasonTransformer);
15
15
  validate(options: VerifyResponseOptions): Promise<RecaptchaVerificationResult<VerifyResponseEnterprise>>;
16
16
  private verifyResponse;
17
17
  }
@@ -22,9 +22,10 @@ const google_recaptcha_network_exception_1 = require("../../exceptions/google-re
22
22
  const google_recaptcha_context_1 = require("../../enums/google-recaptcha-context");
23
23
  const enterprise_reason_transformer_1 = require("../enterprise-reason.transformer");
24
24
  const get_error_info_1 = require("../../helpers/get-error-info");
25
+ const recaptcha_config_ref_1 = require("../../models/recaptcha-config-ref");
25
26
  let GoogleRecaptchaEnterpriseValidator = class GoogleRecaptchaEnterpriseValidator extends abstract_google_recaptcha_validator_1.AbstractGoogleRecaptchaValidator {
26
- constructor(axios, logger, options, enterpriseReasonTransformer) {
27
- super(options);
27
+ constructor(axios, logger, configRef, enterpriseReasonTransformer) {
28
+ super(configRef);
28
29
  this.axios = axios;
29
30
  this.logger = logger;
30
31
  this.enterpriseReasonTransformer = enterpriseReasonTransformer;
@@ -32,7 +33,7 @@ let GoogleRecaptchaEnterpriseValidator = class GoogleRecaptchaEnterpriseValidato
32
33
  }
33
34
  async validate(options) {
34
35
  var _a, _b, _c, _d;
35
- const [result, errorDetails] = await this.verifyResponse(options.response, options.action);
36
+ const [result, errorDetails] = await this.verifyResponse(options.response, options.action, options.remoteIp);
36
37
  const errors = [];
37
38
  let success = ((_a = result === null || result === void 0 ? void 0 : result.tokenProperties) === null || _a === void 0 ? void 0 : _a.valid) || false;
38
39
  if (!errorDetails) {
@@ -60,40 +61,42 @@ let GoogleRecaptchaEnterpriseValidator = class GoogleRecaptchaEnterpriseValidato
60
61
  success,
61
62
  errors,
62
63
  nativeResponse: result,
64
+ remoteIp: options.remoteIp,
63
65
  score: (_b = result === null || result === void 0 ? void 0 : result.riskAnalysis) === null || _b === void 0 ? void 0 : _b.score,
64
66
  action: (_c = result === null || result === void 0 ? void 0 : result.tokenProperties) === null || _c === void 0 ? void 0 : _c.action,
65
67
  hostname: ((_d = result === null || result === void 0 ? void 0 : result.tokenProperties) === null || _d === void 0 ? void 0 : _d.hostname) || '',
66
68
  });
67
69
  }
68
- verifyResponse(response, expectedAction) {
69
- const projectId = this.options.enterprise.projectId;
70
+ verifyResponse(response, expectedAction, remoteIp) {
71
+ const projectId = this.options.valueOf.enterprise.projectId;
70
72
  const body = {
71
73
  event: {
72
74
  expectedAction,
73
- siteKey: this.options.enterprise.siteKey,
75
+ siteKey: this.options.valueOf.enterprise.siteKey,
74
76
  token: response,
77
+ userIpAddress: remoteIp,
75
78
  },
76
79
  };
77
80
  const url = `https://recaptchaenterprise.googleapis.com/v1/projects/${projectId}/assessments`;
78
81
  const config = {
79
82
  headers: this.headers,
80
83
  params: {
81
- key: this.options.enterprise.apiKey,
84
+ key: this.options.valueOf.enterprise.apiKey,
82
85
  },
83
86
  };
84
- if (this.options.debug) {
87
+ if (this.options.valueOf.debug) {
85
88
  this.logger.debug({ body }, `${google_recaptcha_context_1.GoogleRecaptchaContext.GoogleRecaptchaEnterprise}.request`);
86
89
  }
87
90
  return this.axios.post(url, body, config)
88
91
  .then((res) => res.data)
89
92
  .then((data) => {
90
- if (this.options.debug) {
93
+ if (this.options.valueOf.debug) {
91
94
  this.logger.debug(data, `${google_recaptcha_context_1.GoogleRecaptchaContext.GoogleRecaptchaEnterprise}.response`);
92
95
  }
93
96
  return [data, null];
94
97
  })
95
98
  .catch((err) => {
96
- if (this.options.debug) {
99
+ if (this.options.valueOf.debug) {
97
100
  this.logger.debug((0, get_error_info_1.getErrorInfo)(err), `${google_recaptcha_context_1.GoogleRecaptchaContext.GoogleRecaptchaEnterprise}.error`);
98
101
  }
99
102
  const networkErrorCode = err.isAxiosError && err.code;
@@ -112,8 +115,8 @@ GoogleRecaptchaEnterpriseValidator = __decorate([
112
115
  (0, common_1.Injectable)(),
113
116
  __param(0, (0, common_1.Inject)(provider_declarations_1.RECAPTCHA_AXIOS_INSTANCE)),
114
117
  __param(1, (0, common_1.Inject)(provider_declarations_1.RECAPTCHA_LOGGER)),
115
- __param(2, (0, common_1.Inject)(provider_declarations_1.RECAPTCHA_OPTIONS)),
116
- __metadata("design:paramtypes", [Function, common_1.Logger, Object, enterprise_reason_transformer_1.EnterpriseReasonTransformer])
118
+ __metadata("design:paramtypes", [Function, common_1.Logger,
119
+ recaptcha_config_ref_1.RecaptchaConfigRef,
120
+ enterprise_reason_transformer_1.EnterpriseReasonTransformer])
117
121
  ], GoogleRecaptchaEnterpriseValidator);
118
122
  exports.GoogleRecaptchaEnterpriseValidator = GoogleRecaptchaEnterpriseValidator;
119
- //# sourceMappingURL=google-recaptcha-enterprise.validator.js.map
@@ -1,16 +1,16 @@
1
1
  import { Logger } from '@nestjs/common';
2
2
  import { VerifyResponseOptions } from '../../interfaces/verify-response-decorator-options';
3
3
  import { VerifyResponseV3 } from '../../interfaces/verify-response';
4
- import { GoogleRecaptchaModuleOptions } from '../../interfaces/google-recaptcha-module-options';
5
4
  import { AbstractGoogleRecaptchaValidator } from './abstract-google-recaptcha-validator';
6
5
  import { RecaptchaVerificationResult } from '../../models/recaptcha-verification-result';
7
6
  import { AxiosInstance } from 'axios';
7
+ import { RecaptchaConfigRef } from "../../models/recaptcha-config-ref";
8
8
  export declare class GoogleRecaptchaValidator extends AbstractGoogleRecaptchaValidator<VerifyResponseV3> {
9
9
  private readonly axios;
10
10
  private readonly logger;
11
11
  private readonly defaultNetwork;
12
12
  private readonly headers;
13
- constructor(axios: AxiosInstance, logger: Logger, options: GoogleRecaptchaModuleOptions);
13
+ constructor(axios: AxiosInstance, logger: Logger, configRef: RecaptchaConfigRef);
14
14
  /**
15
15
  * @throws GoogleRecaptchaNetworkException
16
16
  * @param {VerifyResponseOptions} options
@@ -23,9 +23,10 @@ const abstract_google_recaptcha_validator_1 = require("./abstract-google-recaptc
23
23
  const recaptcha_verification_result_1 = require("../../models/recaptcha-verification-result");
24
24
  const google_recaptcha_context_1 = require("../../enums/google-recaptcha-context");
25
25
  const get_error_info_1 = require("../../helpers/get-error-info");
26
+ const recaptcha_config_ref_1 = require("../../models/recaptcha-config-ref");
26
27
  let GoogleRecaptchaValidator = class GoogleRecaptchaValidator extends abstract_google_recaptcha_validator_1.AbstractGoogleRecaptchaValidator {
27
- constructor(axios, logger, options) {
28
- super(options);
28
+ constructor(axios, logger, configRef) {
29
+ super(configRef);
29
30
  this.axios = axios;
30
31
  this.logger = logger;
31
32
  this.defaultNetwork = google_recaptcha_network_1.GoogleRecaptchaNetwork.Google;
@@ -36,11 +37,12 @@ let GoogleRecaptchaValidator = class GoogleRecaptchaValidator extends abstract_g
36
37
  * @param {VerifyResponseOptions} options
37
38
  */
38
39
  async validate(options) {
39
- const result = await this.verifyResponse(options.response);
40
+ const result = await this.verifyResponse(options.response, options.remoteIp);
40
41
  if (!this.isUseV3(result)) {
41
42
  const resV2 = result;
42
43
  return new recaptcha_verification_result_1.RecaptchaVerificationResult({
43
44
  nativeResponse: resV2,
45
+ remoteIp: options.remoteIp,
44
46
  score: undefined,
45
47
  action: undefined,
46
48
  errors: resV2.errors,
@@ -59,6 +61,7 @@ let GoogleRecaptchaValidator = class GoogleRecaptchaValidator extends abstract_g
59
61
  const nativeResponse = Object.assign({}, result);
60
62
  return new recaptcha_verification_result_1.RecaptchaVerificationResult({
61
63
  nativeResponse: nativeResponse,
64
+ remoteIp: options.remoteIp,
62
65
  score: result.score,
63
66
  errors: result.errors,
64
67
  success: result.success,
@@ -66,19 +69,19 @@ let GoogleRecaptchaValidator = class GoogleRecaptchaValidator extends abstract_g
66
69
  hostname: result.hostname,
67
70
  });
68
71
  }
69
- verifyResponse(response) {
70
- const body = qs.stringify({ secret: this.options.secretKey, response });
71
- const url = this.options.network || this.defaultNetwork;
72
+ verifyResponse(response, remoteIp) {
73
+ const body = qs.stringify({ secret: this.options.valueOf.secretKey, response, remoteip: remoteIp });
74
+ const url = this.options.valueOf.network || this.defaultNetwork;
72
75
  const config = {
73
76
  headers: this.headers,
74
77
  };
75
- if (this.options.debug) {
78
+ if (this.options.valueOf.debug) {
76
79
  this.logger.debug({ body }, `${google_recaptcha_context_1.GoogleRecaptchaContext.GoogleRecaptcha}.request`);
77
80
  }
78
81
  return this.axios.post(url, body, config)
79
82
  .then((res) => res.data)
80
83
  .then((data) => {
81
- if (this.options.debug) {
84
+ if (this.options.valueOf.debug) {
82
85
  this.logger.debug(data, `${google_recaptcha_context_1.GoogleRecaptchaContext.GoogleRecaptcha}.response`);
83
86
  }
84
87
  return data;
@@ -89,7 +92,7 @@ let GoogleRecaptchaValidator = class GoogleRecaptchaValidator extends abstract_g
89
92
  return result;
90
93
  })
91
94
  .catch((err) => {
92
- if (this.options.debug) {
95
+ if (this.options.valueOf.debug) {
93
96
  this.logger.debug((0, get_error_info_1.getErrorInfo)(err), `${google_recaptcha_context_1.GoogleRecaptchaContext.GoogleRecaptcha}.error`);
94
97
  }
95
98
  const networkErrorCode = err.isAxiosError && err.code;
@@ -110,8 +113,7 @@ GoogleRecaptchaValidator = __decorate([
110
113
  (0, common_1.Injectable)(),
111
114
  __param(0, (0, common_1.Inject)(provider_declarations_1.RECAPTCHA_AXIOS_INSTANCE)),
112
115
  __param(1, (0, common_1.Inject)(provider_declarations_1.RECAPTCHA_LOGGER)),
113
- __param(2, (0, common_1.Inject)(provider_declarations_1.RECAPTCHA_OPTIONS)),
114
- __metadata("design:paramtypes", [Function, common_1.Logger, Object])
116
+ __metadata("design:paramtypes", [Function, common_1.Logger,
117
+ recaptcha_config_ref_1.RecaptchaConfigRef])
115
118
  ], GoogleRecaptchaValidator);
116
119
  exports.GoogleRecaptchaValidator = GoogleRecaptchaValidator;
117
- //# sourceMappingURL=google-recaptcha.validator.js.map
package/types.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { ContextType } from '@nestjs/common';
2
- export type RecaptchaResponseProvider = (req: any) => string | Promise<string>;
3
- export type ScoreValidator = number | ((score: number) => boolean);
4
- export type RecaptchaContextType = ContextType | 'graphql';
2
+ export declare type RecaptchaResponseProvider = (req: any) => string | Promise<string>;
3
+ export declare type RecaptchaRemoteIpProvider = (req: any) => string | Promise<string>;
4
+ export declare type ScoreValidator = number | ((score: number) => boolean);
5
+ export declare type SkipIfValue = boolean | (<Req = unknown>(request: Req) => boolean | Promise<boolean>);
6
+ export declare type RecaptchaContextType = ContextType | 'graphql';
package/types.js CHANGED
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recaptcha-result.js","sourceRoot":"","sources":["../../src/decorators/recaptcha-result.ts"],"names":[],"mappings":";;;AAAA,2CAAwE;AACxE,wDAAoD;AAEvC,QAAA,eAAe,GAAG,IAAA,6BAAoB,EAAC,CAAC,IAAI,EAAE,OAAyB,EAAE,EAAE;;IACvF,QAAQ,OAAO,CAAC,OAAO,EAAsB,EAAE;QAC9C,KAAK,MAAM;YACV,OAAO,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC,yBAAyB,CAAC;QACtE,KAAK,SAAS;YACb,OAAO,MAAA,MAAA,MAAA,MAAA,IAAA,wBAAU,EAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC,GAAG,0CAAE,UAAU,0CAAE,YAAY,0CAAE,GAAG,0CAC3H,yBAAyB,CAAC;KAC9B;AACF,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"recaptcha.js","sourceRoot":"","sources":["../../src/decorators/recaptcha.ts"],"names":[],"mappings":";;;AAAA,2CAA4D;AAC5D,6EAAwE;AAExE,mEAA8D;AAE9D,SAAgB,SAAS,CAAC,OAAwC;IACjE,OAAO,IAAA,wBAAe,EAAC,IAAA,2CAAmB,EAAC,OAAO,CAAC,EAAE,IAAA,kBAAS,EAAC,6CAAoB,CAAC,CAAC,CAAC;AACvF,CAAC;AAFD,8BAEC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"set-recaptcha-options.js","sourceRoot":"","sources":["../../src/decorators/set-recaptcha-options.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAE7C,oEAAwE;AAExE,SAAgB,mBAAmB,CAAC,OAAwC;IAC3E,OAAO,IAAA,oBAAW,EAAC,oDAA4B,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC;AAFD,kDAEC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"classification-reason.js","sourceRoot":"","sources":["../../src/enums/classification-reason.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC/B,+FAAuE,CAAA;IACvE,iDAAyB,CAAA;IACzB,yEAAiD,CAAA;IACjD,6DAAqC,CAAA;IACrC,+EAAuD,CAAA;IACvD,qEAA6C,CAAA;AAC9C,CAAC,EAPW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAO/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-code.js","sourceRoot":"","sources":["../../src/enums/error-code.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAgBX;AAhBD,WAAY,SAAS;IACpB,wDAA2C,CAAA;IAC3C,wDAA2C,CAAA;IAC3C,4DAA+C,CAAA;IAC/C,4DAA+C,CAAA;IAC/C,uCAA0B,CAAA;IAC1B,wDAA2C,CAAA;IAC3C,2CAA8B,CAAA;IAC9B,iDAAoC,CAAA;IACpC,mCAAsB,CAAA;IACtB,yCAA4B,CAAA;IAC5B,0DAA6C,CAAA;IAC7C,2CAA8B,CAAA;IAC9B,aAAa;IACb,2CAA8B,CAAA;IAC9B,2CAA8B,CAAA;AAC/B,CAAC,EAhBW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAgBpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-recaptcha-context.js","sourceRoot":"","sources":["../../src/enums/google-recaptcha-context.ts"],"names":[],"mappings":";;;AAAA,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IACjC,6DAAmC,CAAA;IACnC,iFAAuD,CAAA;AACxD,CAAC,EAHW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAGjC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-recaptcha-enterprise-reason.js","sourceRoot":"","sources":["../../src/enums/google-recaptcha-enterprise-reason.ts"],"names":[],"mappings":";;;AAAA,IAAY,+BASX;AATD,WAAY,+BAA+B;IAC1C,0FAAuD,CAAA;IACvD,kFAA+C,CAAA;IAC/C,0DAAuB,CAAA;IACvB,sDAAmB,CAAA;IACnB,gDAAa,CAAA;IACb,iEAA8B,CAAA;IAC9B,sDAAmB,CAAA;IACnB,iEAA8B,CAAA;AAC/B,CAAC,EATW,+BAA+B,GAA/B,uCAA+B,KAA/B,uCAA+B,QAS1C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-recaptcha-network.js","sourceRoot":"","sources":["../../src/enums/google-recaptcha-network.ts"],"names":[],"mappings":";;;AAAA,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IACjC,oFAA0D,CAAA;IAC1D,sFAA4D,CAAA;AAC7D,CAAC,EAHW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAGjC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-recaptcha-network.exception.js","sourceRoot":"","sources":["../../src/exceptions/google-recaptcha-network.exception.ts"],"names":[],"mappings":";;;AAAA,6EAAwE;AACxE,oDAAgD;AAEhD,MAAa,+BAAgC,SAAQ,qDAAwB;IAC5E,YAA4B,gBAAyB;QACpD,KAAK,CAAC,CAAC,sBAAS,CAAC,YAAY,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,kBAAkB,gBAAgB,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC;QAD3F,qBAAgB,GAAhB,gBAAgB,CAAS;IAErD,CAAC;CACD;AAJD,0EAIC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-recaptcha.exception.js","sourceRoot":"","sources":["../../src/exceptions/google-recaptcha.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA2D;AAC3D,oDAAgD;AAEhD,MAAa,wBAAyB,SAAQ,sBAAa;IAC1D,YAA4B,UAAuB,EAAE,YAAqB;QACzE,KAAK,CACJ,YAAY,IAAI,wBAAwB,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EACvE,wBAAwB,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CACtD,CAAC;QAJyB,eAAU,GAAV,UAAU,CAAa;IAKnD,CAAC;IAEO,MAAM,CAAC,eAAe,CAAC,SAAoB;QAClD,QAAQ,SAAS,EAAE;YAClB,KAAK,sBAAS,CAAC,oBAAoB;gBAClC,OAAO,iDAAiD,CAAC;YAE1D,KAAK,sBAAS,CAAC,oBAAoB;gBAClC,OAAO,oCAAoC,CAAC;YAC7C,KAAK,sBAAS,CAAC,kBAAkB;gBAChC,OAAO,iFAAiF,CAAC;YAE1F,KAAK,sBAAS,CAAC,kBAAkB,CAAC;YAClC,KAAK,sBAAS,CAAC,kBAAkB;gBAChC,OAAO,gEAAgE,CAAC;YAEzE,KAAK,sBAAS,CAAC,WAAW;gBACzB,OAAO,gDAAgD,CAAC;YAEzD,KAAK,sBAAS,CAAC,QAAQ;gBACtB,OAAO,sBAAsB,CA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A;AA9CY,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAMV,WAAA,IAAA,eAAM,EAAC,wCAAgB,CAAC,CAAA;IACxB,WAAA,IAAA,eAAM,EAAC,yCAAiB,CAAC,CAAA;qCAJE,gBAAS;QACH,qDAAwB;QACtB,yDAA0B;QACX,eAAM;GAL9C,oBAAoB,CA8ChC;AA9CY,oDAAoB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-error-info.js","sourceRoot":"","sources":["../../src/helpers/get-error-info.ts"],"names":[],"mappings":";;;AAIA,SAAgB,YAAY,CAAC,KAA+B;IAC3D,OAA0B,KAAM,CAAC,YAAY,CAAC;AAC/C,CAAC;AAFD,oCAEC;AAED,SAAgB,YAAY,CAAC,KAAY;;IACxC,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,KAAI,KAAK,CAAC,IAAI,IAAI,qBAAqB,CAAC;KACnE;IAED,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;AAC1E,CAAC;AAND,oCAMC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"load-module.js","sourceRoot":"","sources":["../../src/helpers/load-module.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAGxC,SAAgB,UAAU,CAAC,UAAkB,EAAE,QAAQ,GAAG,KAAK;IAC9D,IAAI;QACH,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;KAC3B;IAAC,OAAO,CAAC,EAAE;QACX,IAAI,QAAQ,EAAE;YACb,eAAM,CAAC,KAAK,CAAC,WAAW,UAAU,4CAA4C,UAAU,EAAE,CAAC,CAAC;SAC5F;QACD,MAAM,CAAC,CAAC;KACR;AACF,CAAC;AATD,gCASC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"xor.js","sourceRoot":"","sources":["../../src/helpers/xor.ts"],"names":[],"mappings":";;;AAAA,SAAgB,GAAG,CAAC,CAAU,EAAE,CAAU;IACzC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAFD,kBAEC"}
package/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,oDAAmD;AAA1C,sGAAA,SAAS,OAAA;AAClB,4EAAyE;AAAhE,4HAAA,mBAAmB,OAAA;AAC5B,kEAAgE;AAAvD,mHAAA,eAAe,OAAA;AACxB,0EAAuE;AAA9D,8HAAA,oBAAoB,OAAA;AAC7B,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAE9B,iDAA+C;AAAtC,uGAAA,SAAS,OAAA;AAClB,6EAA0E;AAAjE,kIAAA,sBAAsB,OAAA;AAC/B,sFAAmF;AAA1E,sIAAA,wBAAwB,OAAA;AACjC,sGAAkG;AAAzF,qJAAA,+BAA+B,OAAA;AACxC,+FAA4F;AAAnF,sIAAA,wBAAwB,OAAA;AACjC,qHAAiH;AAAxG,2JAAA,kCAAkC,OAAA;AAC3C,wFAAqF;AAA5E,4IAAA,2BAA2B,OAAA;AACpC,uEAAqE;AAA5D,6HAAA,oBAAoB,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-recaptcha-enterprise-options.js","sourceRoot":"","sources":["../../src/interfaces/google-recaptcha-enterprise-options.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-recaptcha-guard-options.js","sourceRoot":"","sources":["../../src/interfaces/google-recaptcha-guard-options.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-recaptcha-module-options.js","sourceRoot":"","sources":["../../src/interfaces/google-recaptcha-module-options.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-recaptcha-validator-options.js","sourceRoot":"","sources":["../../src/interfaces/google-recaptcha-validator-options.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"literal-object.js","sourceRoot":"","sources":["../../src/interfaces/literal-object.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify-response-decorator-options.js","sourceRoot":"","sources":["../../src/interfaces/verify-response-decorator-options.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify-response-enterprise.js","sourceRoot":"","sources":["../../src/interfaces/verify-response-enterprise.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify-response.js","sourceRoot":"","sources":["../../src/interfaces/verify-response.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"recaptcha-verification-result.js","sourceRoot":"","sources":["../../src/models/recaptcha-verification-result.ts"],"names":[],"mappings":";;;AAaA,MAAa,2BAA2B;IAavC,YAA6B,OAAgD;QAAhD,YAAO,GAAP,OAAO,CAAyC;QAC5E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAC9C,CAAC;IAED,QAAQ;QACP,OAAO;YACN,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,cAAc,EAAE,IAAI,CAAC,cAAc;SACnC,CAAC;IACH,CAAC;IAED,WAAW;QACV,OAAO,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;IAED,0BAA0B;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAE/B,OAAO,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC;IACpC,CAAC;CACD;AA1CD,kEA0CC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.declarations.js","sourceRoot":"","sources":["../src/provider.declarations.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAEhD,QAAA,4BAA4B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;AAEtE,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AAEtD,QAAA,gBAAgB,GAAG,kBAAkB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"enterprise-reason.transformer.js","sourceRoot":"","sources":["../../src/services/enterprise-reason.transformer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,oGAA8F;AAC9F,oDAAgD;AAGzC,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACvC,SAAS,CAAC,OAAwC;QACjD,QAAQ,OAAO,EAAE;YAChB,KAAK,oEAA+B,CAAC,YAAY;gBAChD,OAAO,sBAAS,CAAC,YAAY,CAAC;YAE/B,KAAK,oEAA+B,CAAC,YAAY;gBAChD,OAAO,sBAAS,CAAC,YAAY,CAAC;YAE/B,KAAK,oEAA+B,CAAC,OAAO,CAAC;YAC7C,KAAK,oEAA+B,CAAC,IAAI;gBACxC,OAAO,sBAAS,CAAC,kBAAkB,CAAC;YAErC,KAAK,oEAA+B,CAAC,oBAAoB,CAAC;YAC1D,KAAK,oEAA+B,CAAC,SAAS;gBAC7C,OAAO,sBAAS,CAAC,oBAAoB,CAAC;YAEvC,KAAK,oEAA+B,CAAC,OAAO;gBAC3C,OAAO,sBAAS,CAAC,oBAAoB,CAAC;YAEvC,KAAK,oEAA+B,CAAC,wBAAwB;gBAC5D,OAAO,IAAI,CAAC;YAEb;gBACC,OAAO,sBAAS,CAAC,YAAY,CAAC;SAC/B;IACF,CAAC;CACD,CAAA;AA3BY,2BAA2B;IADvC,IAAA,mBAAU,GAAE;GACA,2BAA2B,CA2BvC;AA3BY,kEAA2B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"recaptcha-request.resolver.js","sourceRoot":"","sources":["../../src/services/recaptcha-request.resolver.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA8D;AAC9D,wDAAoD;AAI7C,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACpC,OAAO,CAAI,OAAyB;;QACnC,MAAM,WAAW,GAAyB,OAAO,CAAC,OAAO,EAAE,CAAC;QAE5D,QAAQ,WAAW,EAAE;YACpB,KAAK,MAAM;gBACV,OAAO,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;YAE5C,KAAK,SAAS;gBACb,OAAO,MAAA,MAAA,MAAA,IAAA,wBAAU,EAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC,GAAG,0CAAE,MAAM,0CAAE,YAAY,0CAAE,GAAG,CAAC;YAC5H;gBACC,MAAM,IAAI,KAAK,CAAC,6BAA6B,WAAW,IAAI,CAAC,CAAC;SAC/D;IACF,CAAC;CACD,CAAA;AAdY,wBAAwB;IADpC,IAAA,mBAAU,GAAE;GACA,wBAAwB,CAcpC;AAdY,4DAAwB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"recaptcha-validator.resolver.js","sourceRoot":"","sources":["../../src/services/recaptcha-validator.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AAEpD,oEAA6D;AAE7D,wFAAmF;AACnF,8GAAwG;AAGjG,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACtC,YAC6C,OAAqC,EAC9D,wBAAkD,EAClD,kCAAsE;QAF7C,YAAO,GAAP,OAAO,CAA8B;QAC9D,6BAAwB,GAAxB,wBAAwB,CAA0B;QAClD,uCAAkC,GAAlC,kCAAkC,CAAoC;IACvF,CAAC;IAEJ,OAAO;QACN,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;YAC3B,OAAO,IAAI,CAAC,wBAAwB,CAAC;SACrC;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;YACtD,OAAO,IAAI,CAAC,kCAAkC,CAAC;SAC/C;QAED,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC9D,CAAC;CACD,CAAA;AAlBY,0BAA0B;IADtC,IAAA,mBAAU,GAAE;IAGV,WAAA,IAAA,eAAM,EAAC,yCAAiB,CAAC,CAAA;6CACmB,qDAAwB;QACd,0EAAkC;GAJ9E,0BAA0B,CAkBtC;AAlBY,gEAA0B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"abstract-google-recaptcha-validator.js","sourceRoot":"","sources":["../../../src/services/validators/abstract-google-recaptcha-validator.ts"],"names":[],"mappings":";;;AAKA,MAAsB,gCAAgC;IACrD,YAAyC,OAAqC;QAArC,YAAO,GAAP,OAAO,CAA8B;IAAG,CAAC;IAIxE,aAAa,CAAC,MAAc,EAAE,OAA+B;QACtE,IAAI,OAAO,CAAC,MAAM,EAAE;YACnB,OAAO,OAAO,CAAC,MAAM,KAAK,MAAM,CAAC;SACjC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5E,CAAC;IAES,YAAY,CAAC,KAAa,EAAE,SAA0B;QAC/D,MAAM,cAAc,GAAG,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAEvD,IAAI,cAAc,EAAE;YACnB,IAAI,OAAO,cAAc,KAAK,UAAU,EAAE;gBACzC,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;aAC7B;YAED,OAAO,KAAK,IAAI,cAAc,CAAC;SAC/B;QAED,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AA1BD,4EA0BC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-recaptcha-enterprise.validator.js","sourceRoot":"","sources":["../../../src/services/validators/google-recaptcha-enterprise.validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,uEAA4G;AAG5G,+FAAyF;AACzF,8FAAyF;AACzF,uDAAmD;AAEnD,4GAAsG;AACtG,mFAA8E;AAE9E,oFAA+E;AAC/E,iEAA4D;AAOrD,IAAM,kCAAkC,GAAxC,MAAM,kCAAmC,SAAQ,sEAA0D;IAGjH,YACoD,KAAoB,EAC5B,MAAc,EAC9B,OAAqC,EAC/C,2BAAwD;QAEzE,KAAK,CAAC,OAAO,CAAC,CAAC;QALoC,UAAK,GAAL,KAAK,CAAe;QAC5B,WAAM,GAAN,MAAM,CAAQ;QAExC,gCAA2B,GAA3B,2BAA2B,CAA6B;QANzD,YAAO,GAAG,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC;IASlE,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAA8B;;QAC5C,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAE3F,MAAM,MAAM,GAAgB,EAAE,CAAC;QAC/B,IAAI,OAAO,GAAG,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,eAAe,0CAAE,KAAK,KAAI,KAAK,CAAC;QAEtD,IAAI,CAAC,YAAY,EAAE;YAClB,IAAI,MAAM,CAAC,eAAe,EAAE;gBAC3B,IAAI,MAAM,CAAC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AAK,CAAC,IAAA,6BAAY,EAAC,GAAG,CAAC,EAAE,GAAG,iDAAsB,CAAC,yBAAyB,QAAQ,CAAC,CAAC;aAClG;YAED,MAAM,gBAAgB,GAAG,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,IAAI,CAAC;YAEtD,IAAI,gBAAgB,EAAE;gBACrB,MAAM,IAAI,oEAA+B,CAAC,gBAAgB,CAAC,CAAC;aAC5D;YAED,MAAM,OAAO,GAAkB;gBAC9B,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,MAAM;gBAC3B,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI;aACvB,CAAC;YAEF,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC;CACD,CAAA;AAzGY,kCAAkC;IAD9C,IAAA,mBAAU,GAAE;IAKV,WAAA,IAAA,eAAM,EAAC,gDAAwB,CAAC,CAAA;IAChC,WAAA,IAAA,eAAM,EAAC,wCAAgB,CAAC,CAAA;IACxB,WAAA,IAAA,eAAM,EAAC,yCAAiB,CAAC,CAAA;+CADyB,eAAM,UAEX,2DAA2B;GAP9D,kCAAkC,CAyG9C;AAzGY,gFAAkC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"google-recaptcha.validator.js","sourceRoot":"","sources":["../../../src/services/validators/google-recaptcha.validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,uEAA4G;AAC5G,kCAAkC;AAElC,mFAA8E;AAG9E,uDAAmD;AACnD,4GAAsG;AAEtG,+FAAyF;AACzF,8FAAyF;AACzF,mFAA8E;AAC9E,iEAA4D;AAIrD,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,sEAAkD;IAK/F,YACoD,KAAoB,EAC5B,MAAc,EAC9B,OAAqC;QAEhE,KAAK,CAAC,OAAO,CAAC,CAAC;QAJoC,UAAK,GAAL,KAAK,CAAe;QAC5B,WAAM,GAAN,M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