Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@atproto/bsync

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atproto/bsync - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

9

CHANGELOG.md
# @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 @@

5

dist/logger.d.ts

@@ -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

39

dist/logger.js
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc