admin/show-userで公開鍵(リモートユーザー)/秘密鍵公開鍵ペア(ローカルユーザー)を確認できるように
This commit is contained in:
parent
0c9af9a6a5
commit
69bf858bb6
|
@ -11,6 +11,9 @@ import { RoleService } from '@/core/RoleService.js';
|
||||||
import { RoleEntityService } from '@/core/entities/RoleEntityService.js';
|
import { RoleEntityService } from '@/core/entities/RoleEntityService.js';
|
||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { notificationRecieveConfig } from '@/models/json-schema/user.js';
|
import { notificationRecieveConfig } from '@/models/json-schema/user.js';
|
||||||
|
import { ApDbResolverService } from '@/core/activitypub/ApDbResolverService.js';
|
||||||
|
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
||||||
|
import { UserKeypairService } from '@/core/UserKeypairService.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
tags: ['admin'],
|
tags: ['admin'],
|
||||||
|
@ -172,6 +175,14 @@ export const meta = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
publicKeys: {
|
||||||
|
type: 'array',
|
||||||
|
optional: false, nullable: true,
|
||||||
|
},
|
||||||
|
keyPairs: {
|
||||||
|
type: 'object',
|
||||||
|
optional: false, nullable: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -199,6 +210,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
private roleService: RoleService,
|
private roleService: RoleService,
|
||||||
private roleEntityService: RoleEntityService,
|
private roleEntityService: RoleEntityService,
|
||||||
private idService: IdService,
|
private idService: IdService,
|
||||||
|
private apDbResolverService: ApDbResolverService,
|
||||||
|
private userEntityService: UserEntityService,
|
||||||
|
private userKeypairService: UserKeypairService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const [user, profile] = await Promise.all([
|
const [user, profile] = await Promise.all([
|
||||||
|
@ -251,6 +265,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
expiresAt: a.expiresAt ? a.expiresAt.toISOString() : null,
|
expiresAt: a.expiresAt ? a.expiresAt.toISOString() : null,
|
||||||
roleId: a.roleId,
|
roleId: a.roleId,
|
||||||
})),
|
})),
|
||||||
|
publicKeys: this.userEntityService.isRemoteUser(user) ? await this.apDbResolverService.getPublicKeyByUserId(user.id) : null,
|
||||||
|
keyPairs: this.userEntityService.isLocalUser(user) ? await this.userKeypairService.getUserKeypair(user.id) : null,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue