@opengis/fastify-table 2.5.70 → 2.5.72

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.
@@ -26,7 +26,9 @@ export default async function authorize(req, reply) {
26
26
  }
27
27
  const ip = getIp(req);
28
28
  const q = `select * from oauth.clients where client_id=$1 and token_endpoint_auth_method=$2 and (allowed_ips is null or $3=any(allowed_ips)) and ${scope ? "$4=any(scopes)" : "1=1"} order by allowed_ips nulls last limit 1`;
29
- const { owner_user_id: userId, client_secret_hash: secret, redirect_uris = [], scopes, allowed_ips: allowedIPs = [], } = pg.pk?.["oauth.clients"]
29
+ const { owner_user_id: userId, client_secret_hash: secret, redirect_uris = [], scopes,
30
+ // allowed_ips: allowedIPs = [],
31
+ } = pg.pk?.["oauth.clients"]
30
32
  ? await pg
31
33
  .query(q, [client_id, "private_key_jwt", ip, scope].filter(Boolean))
32
34
  .then((el) => el.rows?.[0] || {})
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/auth/index.ts"],"names":[],"mappings":"AAgDA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAuGtC;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/auth/index.ts"],"names":[],"mappings":"AA8DA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAsGtC;AAED,eAAe,MAAM,CAAC"}
@@ -23,6 +23,19 @@ import qrCode from "./controllers/2factor/qrcode.js";
23
23
  const tags = ["core", "auth"];
24
24
  const packageName = "fastify-table";
25
25
  const params = { config: { policy: "L0", tags, package: packageName } };
26
+ const loginApiParams = {
27
+ config: {
28
+ policy: "L0",
29
+ tags,
30
+ package: packageName,
31
+ rateLimit: config.rateLimit !== false
32
+ ? {
33
+ max: +(config.rateLimit?.login?.max || 5),
34
+ timeWindow: config.rateLimit?.login?.timeWindow || "1 minute",
35
+ }
36
+ : undefined,
37
+ },
38
+ };
26
39
  const registrationSchema = {
27
40
  body: {
28
41
  type: "object",
@@ -44,13 +57,11 @@ function plugin(app, opt = {}) {
44
57
  app.get("/logout", params, logout);
45
58
  }
46
59
  if (!app.hasRoute({ method: "GET", url: "/api/login" }) &&
47
- process.env.DISABLE_GET_LOGIN !== "true"
48
- // && process.env.platform === "win32"
49
- ) {
50
- app.get("/api/login", params, login);
60
+ process.env.DISABLE_GET_LOGIN !== "true") {
61
+ app.get("/api/login", loginApiParams, login);
51
62
  }
52
63
  if (!app.hasRoute({ method: "POST", url: "/api/login" })) {
53
- app.post("/api/login", params, login);
64
+ app.post("/api/login", loginApiParams, login);
54
65
  }
55
66
  if (!app.hasRoute({ method: "POST", url: "/api/registration" })) {
56
67
  app.post("/api/registration", { ...params, schema: registrationSchema }, registration);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/file/index.ts"],"names":[],"mappings":"AAyBA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAuCtC;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/file/index.ts"],"names":[],"mappings":"AAyBA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAwCtC;AAED,eAAe,MAAM,CAAC"}
@@ -25,7 +25,7 @@ function plugin(app, opt = {}) {
25
25
  url: "/file/resize",
26
26
  config: {
27
27
  ...publicParams.config,
28
- rateLimit: config.rateLimit
28
+ rateLimit: config.rateLimit !== false
29
29
  ? {
30
30
  max: +(config.rateLimit?.resize?.max || 1000),
31
31
  timeWindow: config.rateLimit?.resize?.timeWindow || "1 minute",
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/table/index.ts"],"names":[],"mappings":"AAiCA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAsGtC;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/table/index.ts"],"names":[],"mappings":"AAiCA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAuGtC;AAED,eAAe,MAAM,CAAC"}
@@ -25,7 +25,7 @@ function plugin(app, opt = {}) {
25
25
  tags,
26
26
  package: packageName,
27
27
  policy,
28
- rateLimit: config.rateLimit
28
+ rateLimit: config.rateLimit !== false
29
29
  ? {
30
30
  max: config.rateLimit?.suggest?.max || 10000,
31
31
  timeWindow: config.rateLimit?.suggest?.timeWindow || "1 minute",
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/upload/index.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,GAAG,EAAE,GAAG,QA8GtC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/upload/index.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,GAAG,EAAE,GAAG,QA+GtC"}
@@ -40,7 +40,7 @@ export default function plugin(app) {
40
40
  package: packageName,
41
41
  summary: "Upload chunk of data",
42
42
  policy: uploadPolicy,
43
- rateLimit: config.rateLimit
43
+ rateLimit: config.rateLimit !== false
44
44
  ? {
45
45
  max: +(config.rateLimit?.uploadChunk?.max || 1000),
46
46
  timeWindow: config.rateLimit?.uploadChunk?.timeWindow || "1 minute",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.5.70",
3
+ "version": "2.5.72",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [
@@ -96,4 +96,4 @@
96
96
  },
97
97
  "author": "Softpro",
98
98
  "license": "ISC"
99
- }
99
+ }