@atproto/bsync
Advanced tools
Comparing version 0.0.3 to 0.0.4
# @atproto/bsync | ||
## 0.0.4 | ||
### Patch Changes | ||
- [#2633](https://github.com/bluesky-social/atproto/pull/2633) [`acc9093d2`](https://github.com/bluesky-social/atproto/commit/acc9093d2845eba02b68fb2f9db33e4f1b59bb10) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Obfuscate request headers in logs using utils from @atproto/common | ||
- Updated dependencies [[`acc9093d2`](https://github.com/bluesky-social/atproto/commit/acc9093d2845eba02b68fb2f9db33e4f1b59bb10)]: | ||
- @atproto/common@0.4.1 | ||
## 0.0.3 | ||
@@ -4,0 +13,0 @@ |
@@ -0,5 +1,8 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="node/http" /> | ||
import { type IncomingMessage } from 'node:http'; | ||
import { subsystemLogger } from '@atproto/common'; | ||
export declare const dbLogger: ReturnType<typeof subsystemLogger>; | ||
export declare const httpLogger: ReturnType<typeof subsystemLogger>; | ||
export declare const loggerMiddleware: import("pino-http").HttpLogger; | ||
export declare const loggerMiddleware: import("pino-http").HttpLogger<IncomingMessage, import("http").ServerResponse<IncomingMessage>, never>; | ||
//# sourceMappingURL=logger.d.ts.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.loggerMiddleware = exports.httpLogger = exports.dbLogger = void 0; | ||
const pino_http_1 = __importDefault(require("pino-http")); | ||
const pino_http_1 = __importStar(require("pino-http")); | ||
const common_1 = require("@atproto/common"); | ||
@@ -17,7 +37,10 @@ exports.dbLogger = (0, common_1.subsystemLogger)('bsync:db'); | ||
serializers: { | ||
err: (err) => { | ||
return { | ||
code: err?.code, | ||
message: err?.message, | ||
}; | ||
err: (err) => ({ | ||
code: err?.['code'], | ||
message: err?.['message'], | ||
}), | ||
req: (req) => { | ||
const serialized = pino_http_1.stdSerializers.req(req); | ||
const headers = (0, common_1.obfuscateHeaders)(serialized.headers); | ||
return { ...serialized, headers }; | ||
}, | ||
@@ -24,0 +47,0 @@ }, |
@@ -105,4 +105,5 @@ "use strict"; | ||
const uri = new syntax_1.AtUri(op.subject); | ||
if (uri.collection !== 'app.bsky.graph.list') { | ||
throw new connect_1.ConnectError('subject aturis must reference a list record', connect_1.Code.InvalidArgument); | ||
if (uri.collection !== 'app.bsky.graph.list' && | ||
uri.collection !== 'app.bsky.feed.post') { | ||
throw new connect_1.ConnectError('subject aturis must reference a list or post record', connect_1.Code.InvalidArgument); | ||
} | ||
@@ -109,0 +110,0 @@ } |
{ | ||
"name": "@atproto/bsync", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"license": "MIT", | ||
@@ -27,3 +27,3 @@ "description": "Sychronizing service for app.bsky App View (Bluesky API)", | ||
"typed-emitter": "^2.1.0", | ||
"@atproto/common": "^0.4.0", | ||
"@atproto/common": "^0.4.1", | ||
"@atproto/syntax": "^0.3.0" | ||
@@ -30,0 +30,0 @@ }, |
@@ -1,3 +0,4 @@ | ||
import pinoHttp from 'pino-http' | ||
import { subsystemLogger } from '@atproto/common' | ||
import { type IncomingMessage } from 'node:http' | ||
import pinoHttp, { stdSerializers } from 'pino-http' | ||
import { obfuscateHeaders, subsystemLogger } from '@atproto/common' | ||
@@ -15,9 +16,12 @@ export const dbLogger: ReturnType<typeof subsystemLogger> = | ||
serializers: { | ||
err: (err) => { | ||
return { | ||
code: err?.code, | ||
message: err?.message, | ||
} | ||
err: (err: unknown) => ({ | ||
code: err?.['code'], | ||
message: err?.['message'], | ||
}), | ||
req: (req: IncomingMessage) => { | ||
const serialized = stdSerializers.req(req) | ||
const headers = obfuscateHeaders(serialized.headers) | ||
return { ...serialized, headers } | ||
}, | ||
}, | ||
}) |
@@ -123,5 +123,8 @@ import { sql } from 'kysely' | ||
const uri = new AtUri(op.subject) | ||
if (uri.collection !== 'app.bsky.graph.list') { | ||
if ( | ||
uri.collection !== 'app.bsky.graph.list' && | ||
uri.collection !== 'app.bsky.feed.post' | ||
) { | ||
throw new ConnectError( | ||
'subject aturis must reference a list record', | ||
'subject aturis must reference a list or post record', | ||
Code.InvalidArgument, | ||
@@ -128,0 +131,0 @@ ) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
166587
3398
1
Updated@atproto/common@^0.4.1