@atproto/bsky 0.0.191 → 0.0.193
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/CHANGELOG.md +16 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -0
- package/dist/config.js.map +1 -1
- package/dist/hydration/actor.d.ts +9 -0
- package/dist/hydration/actor.d.ts.map +1 -1
- package/dist/hydration/actor.js +6 -0
- package/dist/hydration/actor.js.map +1 -1
- package/dist/hydration/feed.d.ts +7 -0
- package/dist/hydration/feed.d.ts.map +1 -1
- package/dist/hydration/feed.js +2 -0
- package/dist/hydration/feed.js.map +1 -1
- package/dist/hydration/hydrator.d.ts +11 -1
- package/dist/hydration/hydrator.d.ts.map +1 -1
- package/dist/hydration/hydrator.js +16 -1
- package/dist/hydration/hydrator.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +32 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +16 -0
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +12 -0
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts +4 -0
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/defs.js.map +1 -1
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +4 -0
- package/dist/views/index.js.map +1 -1
- package/package.json +4 -4
- package/src/config.ts +10 -0
- package/src/hydration/actor.ts +16 -0
- package/src/hydration/feed.ts +9 -0
- package/src/hydration/hydrator.ts +16 -0
- package/src/index.ts +3 -1
- package/src/lexicon/lexicons.ts +16 -0
- package/src/lexicon/types/app/bsky/actor/defs.ts +6 -0
- package/src/lexicon/types/app/bsky/feed/defs.ts +2 -0
- package/src/views/index.ts +4 -0
- package/tests/views/posts-debug.test.ts +74 -0
- package/tests/views/profile-debug.test.ts +69 -0
- package/tsconfig.tests.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/bsky",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.193",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Reference implementation of app.bsky App View (Bluesky API)",
|
|
6
6
|
"keywords": [
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"undici": "^6.19.8",
|
|
53
53
|
"zod": "3.23.8",
|
|
54
54
|
"@atproto-labs/fetch-node": "0.2.0",
|
|
55
|
-
"@atproto/api": "^0.17.4",
|
|
56
55
|
"@atproto-labs/xrpc-utils": "0.0.22",
|
|
56
|
+
"@atproto/api": "^0.17.6",
|
|
57
57
|
"@atproto/common": "^0.4.12",
|
|
58
58
|
"@atproto/crypto": "^0.4.4",
|
|
59
59
|
"@atproto/did": "^0.2.1",
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
"jest": "^28.1.2",
|
|
78
78
|
"ts-node": "^10.8.2",
|
|
79
79
|
"typescript": "^5.6.3",
|
|
80
|
-
"@atproto/api": "^0.17.
|
|
80
|
+
"@atproto/api": "^0.17.6",
|
|
81
81
|
"@atproto/lex-cli": "^0.9.6",
|
|
82
|
-
"@atproto/pds": "^0.4.
|
|
82
|
+
"@atproto/pds": "^0.4.190",
|
|
83
83
|
"@atproto/xrpc": "^0.7.5"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
package/src/config.ts
CHANGED
|
@@ -84,6 +84,7 @@ export interface ServerConfigValues {
|
|
|
84
84
|
proxyMaxRetries?: number
|
|
85
85
|
proxyPreferCompressed?: boolean
|
|
86
86
|
kws?: KwsConfig
|
|
87
|
+
debugFieldAllowedDids: Set<string>
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
export class ServerConfig {
|
|
@@ -276,6 +277,10 @@ export class ServerConfig {
|
|
|
276
277
|
}
|
|
277
278
|
}
|
|
278
279
|
|
|
280
|
+
const debugFieldAllowedDids = new Set(
|
|
281
|
+
envList(process.env.BSKY_DEBUG_FIELD_ALLOWED_DIDS),
|
|
282
|
+
)
|
|
283
|
+
|
|
279
284
|
return new ServerConfig({
|
|
280
285
|
version,
|
|
281
286
|
debugMode,
|
|
@@ -334,6 +339,7 @@ export class ServerConfig {
|
|
|
334
339
|
proxyMaxRetries,
|
|
335
340
|
proxyPreferCompressed,
|
|
336
341
|
kws,
|
|
342
|
+
debugFieldAllowedDids,
|
|
337
343
|
...stripUndefineds(overrides ?? {}),
|
|
338
344
|
})
|
|
339
345
|
}
|
|
@@ -572,6 +578,10 @@ export class ServerConfig {
|
|
|
572
578
|
get kws() {
|
|
573
579
|
return this.cfg.kws
|
|
574
580
|
}
|
|
581
|
+
|
|
582
|
+
get debugFieldAllowedDids() {
|
|
583
|
+
return this.cfg.debugFieldAllowedDids
|
|
584
|
+
}
|
|
575
585
|
}
|
|
576
586
|
|
|
577
587
|
function stripUndefineds(
|
package/src/hydration/actor.ts
CHANGED
|
@@ -38,6 +38,15 @@ export type Actor = {
|
|
|
38
38
|
verifications: VerificationHydrationState[]
|
|
39
39
|
status?: RecordInfo<StatusRecord>
|
|
40
40
|
allowActivitySubscriptionsFrom: AllowActivitySubscriptions
|
|
41
|
+
/**
|
|
42
|
+
* Debug information for internal development
|
|
43
|
+
*/
|
|
44
|
+
debug?: {
|
|
45
|
+
pagerank?: number
|
|
46
|
+
accountTags?: string[]
|
|
47
|
+
profileTags?: string[]
|
|
48
|
+
[key: string]: unknown
|
|
49
|
+
}
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
export type VerificationHydrationState = {
|
|
@@ -213,6 +222,12 @@ export class ActorHydrator {
|
|
|
213
222
|
}
|
|
214
223
|
}
|
|
215
224
|
|
|
225
|
+
const debug = {
|
|
226
|
+
pagerank: actor.pagerank,
|
|
227
|
+
accountTags: actor.tags,
|
|
228
|
+
profileTags: actor.profileTags,
|
|
229
|
+
}
|
|
230
|
+
|
|
216
231
|
return acc.set(did, {
|
|
217
232
|
did,
|
|
218
233
|
handle: parseString(actor.handle),
|
|
@@ -233,6 +248,7 @@ export class ActorHydrator {
|
|
|
233
248
|
allowActivitySubscriptionsFrom: allowActivitySubscriptionsFrom(
|
|
234
249
|
actor.allowActivitySubscriptionsFrom,
|
|
235
250
|
),
|
|
251
|
+
debug,
|
|
236
252
|
})
|
|
237
253
|
}, new HydrationMap<Actor>())
|
|
238
254
|
}
|
package/src/hydration/feed.ts
CHANGED
|
@@ -26,6 +26,13 @@ export type Post = RecordInfo<PostRecord> & {
|
|
|
26
26
|
hasThreadGate: boolean
|
|
27
27
|
hasPostGate: boolean
|
|
28
28
|
tags: Set<string>
|
|
29
|
+
/**
|
|
30
|
+
* Debug information for internal development
|
|
31
|
+
*/
|
|
32
|
+
debug?: {
|
|
33
|
+
tags?: string[]
|
|
34
|
+
[key: string]: unknown
|
|
35
|
+
}
|
|
29
36
|
}
|
|
30
37
|
export type Posts = HydrationMap<Post>
|
|
31
38
|
|
|
@@ -117,6 +124,7 @@ export class FeedHydrator {
|
|
|
117
124
|
const hasThreadGate = res.meta[i].hasThreadGate
|
|
118
125
|
const hasPostGate = res.meta[i].hasPostGate
|
|
119
126
|
const tags = new Set<string>(res.records[i].tags ?? [])
|
|
127
|
+
const debug = { tags: Array.from(tags) }
|
|
120
128
|
return acc.set(
|
|
121
129
|
uri,
|
|
122
130
|
record
|
|
@@ -127,6 +135,7 @@ export class FeedHydrator {
|
|
|
127
135
|
hasThreadGate,
|
|
128
136
|
hasPostGate,
|
|
129
137
|
tags,
|
|
138
|
+
debug,
|
|
130
139
|
}
|
|
131
140
|
: null,
|
|
132
141
|
)
|
|
@@ -80,6 +80,7 @@ export class HydrateCtx {
|
|
|
80
80
|
includeTakedowns = this.vals.includeTakedowns
|
|
81
81
|
includeActorTakedowns = this.vals.includeActorTakedowns
|
|
82
82
|
include3pBlocks = this.vals.include3pBlocks
|
|
83
|
+
includeDebugField = this.vals.includeDebugField
|
|
83
84
|
constructor(private vals: HydrateCtxVals) {}
|
|
84
85
|
// Convenience with use with dataplane.getActors cache control
|
|
85
86
|
get skipCacheForViewer() {
|
|
@@ -97,6 +98,7 @@ export type HydrateCtxVals = {
|
|
|
97
98
|
includeTakedowns?: boolean
|
|
98
99
|
includeActorTakedowns?: boolean
|
|
99
100
|
include3pBlocks?: boolean
|
|
101
|
+
includeDebugField?: boolean
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
export type HydrationState = {
|
|
@@ -156,17 +158,28 @@ export type BidirectionalBlocks = HydrationMap<HydrationMap<boolean>>
|
|
|
156
158
|
// actor DID -> stash key -> bookmark
|
|
157
159
|
export type Bookmarks = HydrationMap<HydrationMap<Bookmark>>
|
|
158
160
|
|
|
161
|
+
/**
|
|
162
|
+
* Additional config passed from `ServerConfig` to the `Hydrator` instance.
|
|
163
|
+
* Values within this config object may be passed to other sub-hydrators.
|
|
164
|
+
*/
|
|
165
|
+
export type HydratorConfig = {
|
|
166
|
+
debugFieldAllowedDids: Set<string>
|
|
167
|
+
}
|
|
168
|
+
|
|
159
169
|
export class Hydrator {
|
|
160
170
|
actor: ActorHydrator
|
|
161
171
|
feed: FeedHydrator
|
|
162
172
|
graph: GraphHydrator
|
|
163
173
|
label: LabelHydrator
|
|
164
174
|
serviceLabelers: Set<string>
|
|
175
|
+
config: HydratorConfig
|
|
165
176
|
|
|
166
177
|
constructor(
|
|
167
178
|
public dataplane: DataPlaneClient,
|
|
168
179
|
serviceLabelers: string[] = [],
|
|
180
|
+
config: HydratorConfig,
|
|
169
181
|
) {
|
|
182
|
+
this.config = config
|
|
170
183
|
this.actor = new ActorHydrator(dataplane)
|
|
171
184
|
this.feed = new FeedHydrator(dataplane)
|
|
172
185
|
this.graph = new GraphHydrator(dataplane)
|
|
@@ -1283,11 +1296,14 @@ export class Hydrator {
|
|
|
1283
1296
|
dids: availableDids,
|
|
1284
1297
|
redact: vals.labelers.redact,
|
|
1285
1298
|
}
|
|
1299
|
+
const includeDebugField =
|
|
1300
|
+
!!vals.viewer && this.config.debugFieldAllowedDids.has(vals.viewer)
|
|
1286
1301
|
return new HydrateCtx({
|
|
1287
1302
|
labelers: availableLabelers,
|
|
1288
1303
|
viewer: vals.viewer,
|
|
1289
1304
|
includeTakedowns: vals.includeTakedowns,
|
|
1290
1305
|
include3pBlocks: vals.include3pBlocks,
|
|
1306
|
+
includeDebugField,
|
|
1291
1307
|
})
|
|
1292
1308
|
}
|
|
1293
1309
|
|
package/src/index.ts
CHANGED
|
@@ -123,7 +123,9 @@ export class BskyAppView {
|
|
|
123
123
|
httpVersion: config.dataplaneHttpVersion,
|
|
124
124
|
rejectUnauthorized: !config.dataplaneIgnoreBadTls,
|
|
125
125
|
})
|
|
126
|
-
const hydrator = new Hydrator(dataplane, config.labelsFromIssuerDids
|
|
126
|
+
const hydrator = new Hydrator(dataplane, config.labelsFromIssuerDids, {
|
|
127
|
+
debugFieldAllowedDids: config.debugFieldAllowedDids,
|
|
128
|
+
})
|
|
127
129
|
const views = new Views({
|
|
128
130
|
imgUriBuilder: imgUriBuilder,
|
|
129
131
|
videoUriBuilder: videoUriBuilder,
|
package/src/lexicon/lexicons.ts
CHANGED
|
@@ -65,6 +65,10 @@ export const schemaDict = {
|
|
|
65
65
|
type: 'ref',
|
|
66
66
|
ref: 'lex:app.bsky.actor.defs#statusView',
|
|
67
67
|
},
|
|
68
|
+
debug: {
|
|
69
|
+
type: 'unknown',
|
|
70
|
+
description: 'Debug information for internal development',
|
|
71
|
+
},
|
|
68
72
|
},
|
|
69
73
|
},
|
|
70
74
|
profileView: {
|
|
@@ -127,6 +131,10 @@ export const schemaDict = {
|
|
|
127
131
|
type: 'ref',
|
|
128
132
|
ref: 'lex:app.bsky.actor.defs#statusView',
|
|
129
133
|
},
|
|
134
|
+
debug: {
|
|
135
|
+
type: 'unknown',
|
|
136
|
+
description: 'Debug information for internal development',
|
|
137
|
+
},
|
|
130
138
|
},
|
|
131
139
|
},
|
|
132
140
|
profileViewDetailed: {
|
|
@@ -214,6 +222,10 @@ export const schemaDict = {
|
|
|
214
222
|
type: 'ref',
|
|
215
223
|
ref: 'lex:app.bsky.actor.defs#statusView',
|
|
216
224
|
},
|
|
225
|
+
debug: {
|
|
226
|
+
type: 'unknown',
|
|
227
|
+
description: 'Debug information for internal development',
|
|
228
|
+
},
|
|
217
229
|
},
|
|
218
230
|
},
|
|
219
231
|
profileAssociated: {
|
|
@@ -1846,6 +1858,10 @@ export const schemaDict = {
|
|
|
1846
1858
|
type: 'ref',
|
|
1847
1859
|
ref: 'lex:app.bsky.feed.defs#threadgateView',
|
|
1848
1860
|
},
|
|
1861
|
+
debug: {
|
|
1862
|
+
type: 'unknown',
|
|
1863
|
+
description: 'Debug information for internal development',
|
|
1864
|
+
},
|
|
1849
1865
|
},
|
|
1850
1866
|
},
|
|
1851
1867
|
viewerState: {
|
|
@@ -34,6 +34,8 @@ export interface ProfileViewBasic {
|
|
|
34
34
|
createdAt?: string
|
|
35
35
|
verification?: VerificationState
|
|
36
36
|
status?: StatusView
|
|
37
|
+
/** Debug information for internal development */
|
|
38
|
+
debug?: { [_ in string]: unknown }
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
const hashProfileViewBasic = 'profileViewBasic'
|
|
@@ -61,6 +63,8 @@ export interface ProfileView {
|
|
|
61
63
|
labels?: ComAtprotoLabelDefs.Label[]
|
|
62
64
|
verification?: VerificationState
|
|
63
65
|
status?: StatusView
|
|
66
|
+
/** Debug information for internal development */
|
|
67
|
+
debug?: { [_ in string]: unknown }
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
const hashProfileView = 'profileView'
|
|
@@ -95,6 +99,8 @@ export interface ProfileViewDetailed {
|
|
|
95
99
|
pinnedPost?: ComAtprotoRepoStrongRef.Main
|
|
96
100
|
verification?: VerificationState
|
|
97
101
|
status?: StatusView
|
|
102
|
+
/** Debug information for internal development */
|
|
103
|
+
debug?: { [_ in string]: unknown }
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
const hashProfileViewDetailed = 'profileViewDetailed'
|
package/src/views/index.ts
CHANGED
|
@@ -367,6 +367,7 @@ export class Views {
|
|
|
367
367
|
createdAt: actor.createdAt?.toISOString(),
|
|
368
368
|
verification: this.verification(did, state),
|
|
369
369
|
status: this.status(did, state),
|
|
370
|
+
debug: state.ctx?.includeDebugField ? actor.debug : undefined,
|
|
370
371
|
}
|
|
371
372
|
}
|
|
372
373
|
|
|
@@ -945,6 +946,9 @@ export class Views {
|
|
|
945
946
|
threadgate: !post.record.reply // only hydrate gate on root post
|
|
946
947
|
? this.threadgate(threadgateUri, state)
|
|
947
948
|
: undefined,
|
|
949
|
+
debug: state.ctx?.includeDebugField
|
|
950
|
+
? { post: post.debug, author: author.debug }
|
|
951
|
+
: undefined,
|
|
948
952
|
}
|
|
949
953
|
}
|
|
950
954
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { AtpAgent } from '@atproto/api'
|
|
2
|
+
import { SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
3
|
+
import { ids } from '../../src/lexicon/lexicons'
|
|
4
|
+
|
|
5
|
+
describe('post views w/ debug field', () => {
|
|
6
|
+
let network: TestNetwork
|
|
7
|
+
let agent: AtpAgent
|
|
8
|
+
let sc: SeedClient
|
|
9
|
+
|
|
10
|
+
beforeAll(async () => {
|
|
11
|
+
network = await TestNetwork.create({
|
|
12
|
+
dbPostgresSchema: 'bsky_views_posts_debug',
|
|
13
|
+
})
|
|
14
|
+
agent = network.bsky.getClient()
|
|
15
|
+
sc = network.getSeedClient()
|
|
16
|
+
await basicSeed(sc)
|
|
17
|
+
await network.processAll()
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
network.bsky.ctx.cfg.debugFieldAllowedDids.clear()
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
afterAll(async () => {
|
|
25
|
+
await network.close()
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it(`does not include debug field for unauthed requests`, async () => {
|
|
29
|
+
network.bsky.ctx.cfg.debugFieldAllowedDids.add(sc.dids.bob)
|
|
30
|
+
|
|
31
|
+
const uris = [sc.posts[sc.dids.alice][0].ref.uriStr]
|
|
32
|
+
const posts = await agent.api.app.bsky.feed.getPosts({ uris })
|
|
33
|
+
|
|
34
|
+
const post = posts.data.posts.at(0)
|
|
35
|
+
expect(post?.debug).not.toBeDefined()
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it(`includes debug field for configured user`, async () => {
|
|
39
|
+
network.bsky.ctx.cfg.debugFieldAllowedDids.add(sc.dids.bob)
|
|
40
|
+
|
|
41
|
+
const uris = [sc.posts[sc.dids.alice][0].ref.uriStr]
|
|
42
|
+
const posts = await agent.api.app.bsky.feed.getPosts(
|
|
43
|
+
{ uris },
|
|
44
|
+
{
|
|
45
|
+
headers: await network.serviceHeaders(
|
|
46
|
+
sc.dids.bob,
|
|
47
|
+
ids.AppBskyFeedGetPosts,
|
|
48
|
+
),
|
|
49
|
+
},
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
const post = posts.data.posts.at(0)
|
|
53
|
+
expect(post?.debug).toBeDefined()
|
|
54
|
+
expect(typeof post?.debug).toBe('object')
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it(`doesn't include debug field for other users`, async () => {
|
|
58
|
+
network.bsky.ctx.cfg.debugFieldAllowedDids.add(sc.dids.carol)
|
|
59
|
+
|
|
60
|
+
const uris = [sc.posts[sc.dids.alice][0].ref.uriStr]
|
|
61
|
+
const posts = await agent.api.app.bsky.feed.getPosts(
|
|
62
|
+
{ uris },
|
|
63
|
+
{
|
|
64
|
+
headers: await network.serviceHeaders(
|
|
65
|
+
sc.dids.bob,
|
|
66
|
+
ids.AppBskyFeedGetPosts,
|
|
67
|
+
),
|
|
68
|
+
},
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
const post = posts.data.posts.at(0)
|
|
72
|
+
expect(post?.debug).not.toBeDefined()
|
|
73
|
+
})
|
|
74
|
+
})
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { AtpAgent } from '@atproto/api'
|
|
2
|
+
import { SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
3
|
+
import { ids } from '../../src/lexicon/lexicons'
|
|
4
|
+
|
|
5
|
+
describe('profile views w/ debug field', () => {
|
|
6
|
+
let network: TestNetwork
|
|
7
|
+
let agent: AtpAgent
|
|
8
|
+
let sc: SeedClient
|
|
9
|
+
|
|
10
|
+
beforeAll(async () => {
|
|
11
|
+
network = await TestNetwork.create({
|
|
12
|
+
dbPostgresSchema: 'bsky_views_profile_debug',
|
|
13
|
+
})
|
|
14
|
+
agent = network.bsky.getClient()
|
|
15
|
+
sc = network.getSeedClient()
|
|
16
|
+
await basicSeed(sc)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
network.bsky.ctx.cfg.debugFieldAllowedDids.clear()
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
afterAll(async () => {
|
|
24
|
+
await network.close()
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it(`does not include debug field for unauthed requests`, async () => {
|
|
28
|
+
network.bsky.ctx.cfg.debugFieldAllowedDids.add(sc.dids.bob)
|
|
29
|
+
|
|
30
|
+
const { data: profile } = await agent.api.app.bsky.actor.getProfile({
|
|
31
|
+
actor: sc.dids.alice,
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
expect(profile.debug).not.toBeDefined()
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it(`includes debug field for configured user`, async () => {
|
|
38
|
+
network.bsky.ctx.cfg.debugFieldAllowedDids.add(sc.dids.bob)
|
|
39
|
+
|
|
40
|
+
const { data: profile } = await agent.api.app.bsky.actor.getProfile(
|
|
41
|
+
{ actor: sc.dids.alice },
|
|
42
|
+
{
|
|
43
|
+
headers: await network.serviceHeaders(
|
|
44
|
+
sc.dids.bob,
|
|
45
|
+
ids.AppBskyActorGetProfile,
|
|
46
|
+
),
|
|
47
|
+
},
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
expect(profile.debug).toBeDefined()
|
|
51
|
+
expect(typeof profile.debug).toBe('object')
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
it(`doesn't include debug field for other users`, async () => {
|
|
55
|
+
network.bsky.ctx.cfg.debugFieldAllowedDids.add(sc.dids.carol)
|
|
56
|
+
|
|
57
|
+
const { data: profile } = await agent.api.app.bsky.actor.getProfile(
|
|
58
|
+
{ actor: sc.dids.alice },
|
|
59
|
+
{
|
|
60
|
+
headers: await network.serviceHeaders(
|
|
61
|
+
sc.dids.bob,
|
|
62
|
+
ids.AppBskyActorGetProfile,
|
|
63
|
+
),
|
|
64
|
+
},
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
expect(profile.debug).not.toBeDefined()
|
|
68
|
+
})
|
|
69
|
+
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./tests/_util.ts","./tests/auth.test.ts","./tests/blob-resolver.test.ts","./tests/entryway-auth.test.ts","./tests/etcd.test.ts","./tests/feed-generation.test.ts","./tests/label-hydration.test.ts","./tests/postgates.test.ts","./tests/query-labels.test.ts","./tests/redis-cache.test.ts","./tests/server.test.ts","./tests/stash.test.ts","./tests/admin/admin-auth.test.ts","./tests/admin/moderation.test.ts","./tests/data-plane/db.test.ts","./tests/data-plane/duplicate-records.test.ts","./tests/data-plane/handle-invalidation.test.ts","./tests/data-plane/indexing.test.ts","./tests/data-plane/subscription.test.ts","./tests/data-plane/thread-mutes.test.ts","./tests/hydration/util.test.ts","./tests/image/server.test.ts","./tests/image/sharp.test.ts","./tests/image/uri.test.ts","./tests/seed/feed-hidden-replies.ts","./tests/seed/get-suggested-starter-packs.ts","./tests/seed/get-trends.ts","./tests/seed/known-followers.ts","./tests/seed/postgates.ts","./tests/views/account-deactivation.test.ts","./tests/views/actor-likes.test.ts","./tests/views/actor-search.test.ts","./tests/views/age-assurance.test.ts","./tests/views/author-feed.test.ts","./tests/views/block-lists.test.ts","./tests/views/blocks.test.ts","./tests/views/bookmarks.test.ts","./tests/views/feed-hidden-replies.test.ts","./tests/views/feed-view-post.test.ts","./tests/views/follows.test.ts","./tests/views/get-config.test.ts","./tests/views/get-suggested-starter-packs.test.ts","./tests/views/get-trends.test.ts","./tests/views/known-followers.test.ts","./tests/views/labeler-service.test.ts","./tests/views/labels-needs-review.test.ts","./tests/views/labels-takedown.test.ts","./tests/views/likes.test.ts","./tests/views/list-feed.test.ts","./tests/views/lists.test.ts","./tests/views/mute-lists.test.ts","./tests/views/mutes.test.ts","./tests/views/notifications.test.ts","./tests/views/posts.test.ts","./tests/views/profile.test.ts","./tests/views/quotes.test.ts","./tests/views/reposts.test.ts","./tests/views/starter-packs.test.ts","./tests/views/suggested-follows.test.ts","./tests/views/suggestions.test.ts","./tests/views/thread-v2.test.ts","./tests/views/thread.test.ts","./tests/views/threadgating.test.ts","./tests/views/timeline.test.ts","./tests/views/verification.test.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["./tests/_util.ts","./tests/auth.test.ts","./tests/blob-resolver.test.ts","./tests/entryway-auth.test.ts","./tests/etcd.test.ts","./tests/feed-generation.test.ts","./tests/label-hydration.test.ts","./tests/postgates.test.ts","./tests/query-labels.test.ts","./tests/redis-cache.test.ts","./tests/server.test.ts","./tests/stash.test.ts","./tests/admin/admin-auth.test.ts","./tests/admin/moderation.test.ts","./tests/data-plane/db.test.ts","./tests/data-plane/duplicate-records.test.ts","./tests/data-plane/handle-invalidation.test.ts","./tests/data-plane/indexing.test.ts","./tests/data-plane/subscription.test.ts","./tests/data-plane/thread-mutes.test.ts","./tests/hydration/util.test.ts","./tests/image/server.test.ts","./tests/image/sharp.test.ts","./tests/image/uri.test.ts","./tests/seed/feed-hidden-replies.ts","./tests/seed/get-suggested-starter-packs.ts","./tests/seed/get-trends.ts","./tests/seed/known-followers.ts","./tests/seed/postgates.ts","./tests/views/account-deactivation.test.ts","./tests/views/actor-likes.test.ts","./tests/views/actor-search.test.ts","./tests/views/age-assurance.test.ts","./tests/views/author-feed.test.ts","./tests/views/block-lists.test.ts","./tests/views/blocks.test.ts","./tests/views/bookmarks.test.ts","./tests/views/feed-hidden-replies.test.ts","./tests/views/feed-view-post.test.ts","./tests/views/follows.test.ts","./tests/views/get-config.test.ts","./tests/views/get-suggested-starter-packs.test.ts","./tests/views/get-trends.test.ts","./tests/views/known-followers.test.ts","./tests/views/labeler-service.test.ts","./tests/views/labels-needs-review.test.ts","./tests/views/labels-takedown.test.ts","./tests/views/likes.test.ts","./tests/views/list-feed.test.ts","./tests/views/lists.test.ts","./tests/views/mute-lists.test.ts","./tests/views/mutes.test.ts","./tests/views/notifications.test.ts","./tests/views/posts-debug.test.ts","./tests/views/posts.test.ts","./tests/views/profile-debug.test.ts","./tests/views/profile.test.ts","./tests/views/quotes.test.ts","./tests/views/reposts.test.ts","./tests/views/starter-packs.test.ts","./tests/views/suggested-follows.test.ts","./tests/views/suggestions.test.ts","./tests/views/thread-v2.test.ts","./tests/views/thread.test.ts","./tests/views/threadgating.test.ts","./tests/views/timeline.test.ts","./tests/views/verification.test.ts"],"version":"5.8.3"}
|