refactor: use TRANSIENT scope to avoid service bucket relay (#16985)

* refactor: use TRANSIENT scope to avoid service bucket relay

* lint: fix lints

* refactor: use transient for apResolver

* Update packages/backend/src/core/activitypub/models/ApImageService.ts

* fix
This commit is contained in:
anatawa12
2025-12-22 17:01:10 +09:00
committed by GitHub
parent 06657c81d3
commit 74e847a04d
32 changed files with 398 additions and 713 deletions

View File

@@ -43,7 +43,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private apResolverService: ApResolverService,
) {
super(meta, paramDef, async (ps, me) => {
const resolver = this.apResolverService.createResolver();
const resolver = await this.apResolverService.createResolver();
const object = await resolver.resolve(ps.uri);
return object;
});

View File

@@ -148,7 +148,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
if (this.utilityService.isSelfHost(host)) return null;
// リモートから一旦オブジェクトフェッチ
const resolver = this.apResolverService.createResolver();
const resolver = await this.apResolverService.createResolver();
// allow ap/show exclusively to lookup URLs that are cross-origin or non-canonical (like https://alice.example.com/@bob@bob.example.com -> https://bob.example.com/@bob)
const object = await resolver.resolve(uri, FetchAllowSoftFailMask.CrossOrigin | FetchAllowSoftFailMask.NonCanonicalId).catch((err) => {
if (err instanceof IdentifiableError) {