@digilogiclabs/platform-core 1.28.0 → 1.28.1
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/dist/auth.d.mts +2 -2
- package/dist/auth.d.ts +2 -2
- package/dist/auth.js +18 -5
- package/dist/auth.js.map +1 -1
- package/dist/auth.mjs +18 -5
- package/dist/auth.mjs.map +1 -1
- package/dist/{env-Cgwf8ZG2.d.mts → env-CHg-CUuD.d.mts} +6 -0
- package/dist/{env-Cgwf8ZG2.d.ts → env-CHg-CUuD.d.ts} +6 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +23 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/auth.mjs
CHANGED
|
@@ -698,11 +698,24 @@ async function checkRateLimit(operation, identifier, rule, options = {}) {
|
|
|
698
698
|
retryAfterSeconds: 0
|
|
699
699
|
};
|
|
700
700
|
} catch (error) {
|
|
701
|
-
options.logger?.error(
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
701
|
+
options.logger?.error(
|
|
702
|
+
rule.failClosed ? "Rate limit check failed, denying request (fail-closed rule)" : "Rate limit check failed, allowing request",
|
|
703
|
+
{
|
|
704
|
+
error: error instanceof Error ? error.message : String(error),
|
|
705
|
+
operation,
|
|
706
|
+
identifier
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
if (rule.failClosed) {
|
|
710
|
+
return {
|
|
711
|
+
allowed: false,
|
|
712
|
+
remaining: 0,
|
|
713
|
+
resetAt,
|
|
714
|
+
current: 0,
|
|
715
|
+
limit,
|
|
716
|
+
retryAfterSeconds: 30
|
|
717
|
+
};
|
|
718
|
+
}
|
|
706
719
|
return {
|
|
707
720
|
allowed: true,
|
|
708
721
|
remaining: limit,
|