@atproto/xrpc-server 0.4.0 → 0.4.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/xrpc-server",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "license": "MIT",
5
5
  "description": "atproto HTTP API (XRPC) server library",
6
6
  "keywords": [
@@ -24,8 +24,8 @@
24
24
  "ws": "^8.12.0",
25
25
  "zod": "^3.21.4",
26
26
  "@atproto/common": "^0.3.3",
27
- "@atproto/crypto": "^0.2.3",
28
- "@atproto/lexicon": "^0.3.0"
27
+ "@atproto/crypto": "^0.3.0",
28
+ "@atproto/lexicon": "^0.3.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/express": "^4.17.13",
@@ -36,8 +36,8 @@
36
36
  "jose": "^4.15.4",
37
37
  "key-encoder": "^2.0.3",
38
38
  "multiformats": "^9.9.0",
39
- "@atproto/crypto": "^0.2.3",
40
- "@atproto/xrpc": "^0.4.0"
39
+ "@atproto/crypto": "^0.3.0",
40
+ "@atproto/xrpc": "^0.4.1"
41
41
  },
42
42
  "scripts": {
43
43
  "test": "jest",
package/src/auth.ts CHANGED
@@ -71,7 +71,7 @@ export const verifyJwt = async (
71
71
  const sigBytes = ui8.fromString(sig, 'base64url')
72
72
  const verifySignatureWithKey = (key: string) => {
73
73
  return crypto.verifySignature(key, msgBytes, sigBytes, {
74
- lowS: false,
74
+ allowMalleableSig: true,
75
75
  })
76
76
  }
77
77
 
package/src/server.ts CHANGED
@@ -248,11 +248,9 @@ export class Server {
248
248
  }
249
249
 
250
250
  // handle rate limits
251
- if (consumeRateLimit) {
252
- const result = await consumeRateLimit(reqCtx)
253
- if (result instanceof RateLimitExceededError) {
254
- return next(result)
255
- }
251
+ const result = await consumeRateLimit(reqCtx)
252
+ if (result instanceof RateLimitExceededError) {
253
+ return next(result)
256
254
  }
257
255
 
258
256
  // run the handler
package/src/util.ts CHANGED
@@ -60,7 +60,7 @@ export function decodeQueryParam(
60
60
  if (type === 'float') {
61
61
  return Number(String(value))
62
62
  } else if (type === 'integer') {
63
- return Number(String(value)) | 0
63
+ return parseInt(String(value), 10) || 0
64
64
  } else if (type === 'boolean') {
65
65
  return value === 'true'
66
66
  }