[backend] Require admin scope for AP get endpoint
This commit addresses disclosed primitive 18
This commit is contained in:
parent
7542310e3e
commit
aa73a8905d
2 changed files with 10 additions and 7 deletions
|
|
@ -6,6 +6,7 @@ export const meta = {
|
||||||
tags: ["federation"],
|
tags: ["federation"],
|
||||||
|
|
||||||
requireCredential: true,
|
requireCredential: true,
|
||||||
|
requireAdmin: true,
|
||||||
|
|
||||||
limit: {
|
limit: {
|
||||||
duration: HOUR,
|
duration: HOUR,
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@
|
||||||
{{ i18n.ts.updateRemoteUser }}</FormButton
|
{{ i18n.ts.updateRemoteUser }}</FormButton
|
||||||
>
|
>
|
||||||
|
|
||||||
<FormFolder class="_formBlock">
|
<FormFolder class="_formBlock" v-if="iAmAdmin">
|
||||||
<template #label>Raw</template>
|
<template #label>Raw</template>
|
||||||
|
|
||||||
<MkObjectView v-if="ap" tall :value="ap">
|
<MkObjectView v-if="ap" tall :value="ap">
|
||||||
|
|
@ -577,13 +577,15 @@ watch(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
watch($$(user), () => {
|
if (iAmAdmin) {
|
||||||
os.api("ap/get", {
|
watch($$(user), () => {
|
||||||
uri: user.uri ?? `${url}/users/${user.id}`,
|
os.api("ap/get", {
|
||||||
}).then((res) => {
|
uri: user.uri ?? `${url}/users/${user.id}`,
|
||||||
ap = res;
|
}).then((res) => {
|
||||||
|
ap = res;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
const headerActions = $computed(() => []);
|
const headerActions = $computed(() => []);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue