Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

連合に関する情報を隠す #2

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

adzukimame
Copy link
Owner

@adzukimame adzukimame commented Mar 14, 2024

連合に関する情報を取得するAPIの変更

404を返す

  • v1/instance/peers

クレデンシャル必須にする

  • federaion/instances
  • federation/show-instance
  • federation/stats
  • charts/instance

フロントエンドの変更

  • 該当のエンドポイントを使用する部分をmisskeyApiGetからmisskeyApiに
  • 非ログイン時にトップページ下部の連合のリストを削除取得しない
  • 非ログイン時にサーバー情報で連合タブを表示しない
  • 非ログイン時にサーバー情報のチャートタブのFederationを表示しない

Copy link

github-actions bot commented Mar 14, 2024

このPRによるapi.jsonの差分

差分はこちら
--- base
+++ head
@@ -22246,10 +22246,10 @@
       }
     },
     "/charts/instance": {
-      "get": {
+      "post": {
         "operationId": "charts/instance",
         "summary": "charts/instance",
-        "description": "No description provided.\n\n**Credential required**: *No*",
+        "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *read:account*",
         "externalDocs": {
           "description": "Source code",
           "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/charts/instance.ts"
@@ -22257,401 +22257,10 @@
         "tags": [
           "charts"
         ],
-        "requestBody": {
-          "required": true,
-          "content": {
-            "application/json": {
-              "schema": {
-                "type": "object",
-                "properties": {
-                  "span": {
-                    "type": "string",
-                    "enum": [
-                      "day",
-                      "hour"
-                    ]
-                  },
-                  "limit": {
-                    "type": "integer",
-                    "minimum": 1,
-                    "maximum": 500,
-                    "default": 30
-                  },
-                  "offset": {
-                    "type": [
-                      "integer",
-                      "null"
-                    ],
-                    "default": null
-                  },
-                  "host": {
-                    "type": "string"
-                  }
-                },
-                "required": [
-                  "span",
-                  "host"
-                ]
-              }
-            }
-          }
-        },
-        "responses": {
-          "200": {
-            "description": "OK (with results)",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "type": "object",
-                  "properties": {
-                    "requests": {
-                      "type": "object",
-                      "properties": {
-                        "failed": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "succeeded": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "received": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        }
-                      },
-                      "required": [
-                        "failed",
-                        "succeeded",
-                        "received"
-                      ]
-                    },
-                    "notes": {
-                      "type": "object",
-                      "properties": {
-                        "total": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "inc": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "dec": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "diffs": {
-                          "type": "object",
-                          "properties": {
-                            "normal": {
-                              "type": "array",
-                              "items": {
-                                "type": "number"
-                              }
-                            },
-                            "reply": {
-                              "type": "array",
-                              "items": {
-                                "type": "number"
-                              }
-                            },
-                            "renote": {
-                              "type": "array",
-                              "items": {
-                                "type": "number"
-                              }
-                            },
-                            "withFile": {
-                              "type": "array",
-                              "items": {
-                                "type": "number"
-                              }
-                            }
-                          },
-                          "required": [
-                            "normal",
-                            "reply",
-                            "renote",
-                            "withFile"
-                          ]
-                        }
-                      },
-                      "required": [
-                        "total",
-                        "inc",
-                        "dec",
-                        "diffs"
-                      ]
-                    },
-                    "users": {
-                      "type": "object",
-                      "properties": {
-                        "total": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "inc": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "dec": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        }
-                      },
-                      "required": [
-                        "total",
-                        "inc",
-                        "dec"
-                      ]
-                    },
-                    "following": {
-                      "type": "object",
-                      "properties": {
-                        "total": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "inc": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "dec": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        }
-                      },
-                      "required": [
-                        "total",
-                        "inc",
-                        "dec"
-                      ]
-                    },
-                    "followers": {
-                      "type": "object",
-                      "properties": {
-                        "total": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "inc": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "dec": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        }
-                      },
-                      "required": [
-                        "total",
-                        "inc",
-                        "dec"
-                      ]
-                    },
-                    "drive": {
-                      "type": "object",
-                      "properties": {
-                        "totalFiles": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "incFiles": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "decFiles": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "incUsage": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        },
-                        "decUsage": {
-                          "type": "array",
-                          "items": {
-                            "type": "number"
-                          }
-                        }
-                      },
-                      "required": [
-                        "totalFiles",
-                        "incFiles",
-                        "decFiles",
-                        "incUsage",
-                        "decUsage"
-                      ]
-                    }
-                  },
-                  "required": [
-                    "requests",
-                    "notes",
-                    "users",
-                    "following",
-                    "followers",
-                    "drive"
-                  ]
-                }
-              }
-            }
-          },
-          "400": {
-            "description": "Client error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "INVALID_PARAM": {
-                    "value": {
-                      "error": {
-                        "message": "Invalid param.",
-                        "code": "INVALID_PARAM",
-                        "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Authentication error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "CREDENTIAL_REQUIRED": {
-                    "value": {
-                      "error": {
-                        "message": "Credential required.",
-                        "code": "CREDENTIAL_REQUIRED",
-                        "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          },
-          "403": {
-            "description": "Forbidden error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "AUTHENTICATION_FAILED": {
-                    "value": {
-                      "error": {
-                        "message": "Authentication failed. Please ensure your token is correct.",
-                        "code": "AUTHENTICATION_FAILED",
-                        "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          },
-          "418": {
-            "description": "I'm Ai",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "I_AM_AI": {
-                    "value": {
-                      "error": {
-                        "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
-                        "code": "I_AM_AI",
-                        "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          },
-          "500": {
-            "description": "Internal server error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "INTERNAL_ERROR": {
-                    "value": {
-                      "error": {
-                        "message": "Internal error occurred. Please contact us if the error persists.",
-                        "code": "INTERNAL_ERROR",
-                        "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
-                      }
-                    }
-                  }
-                }
-              }
-            }
+        "security": [
+          {
+            "bearerAuth": []
           }
-        }
-      },
-      "post": {
-        "operationId": "charts/instance",
-        "summary": "charts/instance",
-        "description": "No description provided.\n\n**Credential required**: *No*",
-        "externalDocs": {
-          "description": "Source code",
-          "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/charts/instance.ts"
-        },
-        "tags": [
-          "charts"
         ],
         "requestBody": {
           "required": true,
@@ -32490,10 +32099,10 @@
       }
     },
     "/federation/instances": {
-      "get": {
+      "post": {
         "operationId": "federation/instances",
         "summary": "federation/instances",
-        "description": "No description provided.\n\n**Credential required**: *No*",
+        "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *read:account*",
         "externalDocs": {
           "description": "Source code",
           "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/federation/instances.ts"
@@ -32501,232 +32110,10 @@
         "tags": [
           "federation"
         ],
-        "requestBody": {
-          "required": true,
-          "content": {
-            "application/json": {
-              "schema": {
-                "type": "object",
-                "properties": {
-                  "host": {
-                    "type": [
-                      "string",
-                      "null"
-                    ],
-                    "description": "Omit or use `null` to not filter by host."
-                  },
-                  "blocked": {
-                    "type": [
-                      "boolean",
-                      "null"
-                    ]
-                  },
-                  "notResponding": {
-                    "type": [
-                      "boolean",
-                      "null"
-                    ]
-                  },
-                  "suspended": {
-                    "type": [
-                      "boolean",
-                      "null"
-                    ]
-                  },
-                  "silenced": {
-                    "type": [
-                      "boolean",
-                      "null"
-                    ]
-                  },
-                  "federating": {
-                    "type": [
-                      "boolean",
-                      "null"
-                    ]
-                  },
-                  "subscribing": {
-                    "type": [
-                      "boolean",
-                      "null"
-                    ]
-                  },
-                  "publishing": {
-                    "type": [
-                      "boolean",
-                      "null"
-                    ]
-                  },
-                  "limit": {
-                    "type": "integer",
-                    "minimum": 1,
-                    "maximum": 100,
-                    "default": 30
-                  },
-                  "offset": {
-                    "type": "integer",
-                    "default": 0
-                  },
-                  "sort": {
-                    "type": [
-                      "string",
-                      "null"
-                    ],
-                    "enum": [
-                      "+pubSub",
-                      "-pubSub",
-                      "+notes",
-                      "-notes",
-                      "+users",
-                      "-users",
-                      "+following",
-                      "-following",
-                      "+followers",
-                      "-followers",
-                      "+firstRetrievedAt",
-                      "-firstRetrievedAt",
-                      "+latestRequestReceivedAt",
-                      "-latestRequestReceivedAt",
-                      null
-                    ]
-                  }
-                }
-              }
-            }
-          }
-        },
-        "responses": {
-          "200": {
-            "description": "OK (with results)",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "type": "array",
-                  "items": {
-                    "type": "object",
-                    "$ref": "#/components/schemas/FederationInstance"
-                  }
-                }
-              }
-            }
-          },
-          "400": {
-            "description": "Client error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "INVALID_PARAM": {
-                    "value": {
-                      "error": {
-                        "message": "Invalid param.",
-                        "code": "INVALID_PARAM",
-                        "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Authentication error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "CREDENTIAL_REQUIRED": {
-                    "value": {
-                      "error": {
-                        "message": "Credential required.",
-                        "code": "CREDENTIAL_REQUIRED",
-                        "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          },
-          "403": {
-            "description": "Forbidden error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "AUTHENTICATION_FAILED": {
-                    "value": {
-                      "error": {
-                        "message": "Authentication failed. Please ensure your token is correct.",
-                        "code": "AUTHENTICATION_FAILED",
-                        "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          },
-          "418": {
-            "description": "I'm Ai",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "I_AM_AI": {
-                    "value": {
-                      "error": {
-                        "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
-                        "code": "I_AM_AI",
-                        "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          },
-          "500": {
-            "description": "Internal server error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "INTERNAL_ERROR": {
-                    "value": {
-                      "error": {
-                        "message": "Internal error occurred. Please contact us if the error persists.",
-                        "code": "INTERNAL_ERROR",
-                        "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
-                      }
-                    }
-                  }
-                }
-              }
-            }
+        "security": [
+          {
+            "bearerAuth": []
           }
-        }
-      },
-      "post": {
-        "operationId": "federation/instances",
-        "summary": "federation/instances",
-        "description": "No description provided.\n\n**Credential required**: *No*",
-        "externalDocs": {
-          "description": "Source code",
-          "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/federation/instances.ts"
-        },
-        "tags": [
-          "federation"
         ],
         "requestBody": {
           "required": true,
@@ -32949,7 +32336,7 @@
       "post": {
         "operationId": "federation/show-instance",
         "summary": "federation/show-instance",
-        "description": "No description provided.\n\n**Credential required**: *No*",
+        "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *read:account*",
         "externalDocs": {
           "description": "Source code",
           "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/federation/show-instance.ts"
@@ -32957,6 +32344,11 @@
         "tags": [
           "federation"
         ],
+        "security": [
+          {
+            "bearerAuth": []
+          }
+        ],
         "requestBody": {
           "required": true,
           "content": {
@@ -33416,10 +32808,10 @@
       }
     },
     "/federation/stats": {
-      "get": {
+      "post": {
         "operationId": "federation/stats",
         "summary": "federation/stats",
-        "description": "No description provided.\n\n**Credential required**: *No*",
+        "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *read:account*",
         "externalDocs": {
           "description": "Source code",
           "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/federation/stats.ts"
@@ -33427,180 +32819,10 @@
         "tags": [
           "federation"
         ],
-        "requestBody": {
-          "required": true,
-          "content": {
-            "application/json": {
-              "schema": {
-                "type": "object",
-                "properties": {
-                  "limit": {
-                    "type": "integer",
-                    "minimum": 1,
-                    "maximum": 100,
-                    "default": 10
-                  }
-                }
-              }
-            }
-          }
-        },
-        "responses": {
-          "200": {
-            "description": "OK (with results)",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "type": "object",
-                  "properties": {
-                    "topSubInstances": {
-                      "type": "array",
-                      "items": {
-                        "type": "object",
-                        "$ref": "#/components/schemas/FederationInstance"
-                      }
-                    },
-                    "otherFollowersCount": {
-                      "type": "number"
-                    },
-                    "topPubInstances": {
-                      "type": "array",
-                      "items": {
-                        "type": "object",
-                        "$ref": "#/components/schemas/FederationInstance"
-                      }
-                    },
-                    "otherFollowingCount": {
-                      "type": "number"
-                    }
-                  },
-                  "required": [
-                    "topSubInstances",
-                    "otherFollowersCount",
-                    "topPubInstances",
-                    "otherFollowingCount"
-                  ]
-                }
-              }
-            }
-          },
-          "400": {
-            "description": "Client error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "INVALID_PARAM": {
-                    "value": {
-                      "error": {
-                        "message": "Invalid param.",
-                        "code": "INVALID_PARAM",
-                        "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Authentication error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "CREDENTIAL_REQUIRED": {
-                    "value": {
-                      "error": {
-                        "message": "Credential required.",
-                        "code": "CREDENTIAL_REQUIRED",
-                        "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          },
-          "403": {
-            "description": "Forbidden error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "AUTHENTICATION_FAILED": {
-                    "value": {
-                      "error": {
-                        "message": "Authentication failed. Please ensure your token is correct.",
-                        "code": "AUTHENTICATION_FAILED",
-                        "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          },
-          "418": {
-            "description": "I'm Ai",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "I_AM_AI": {
-                    "value": {
-                      "error": {
-                        "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
-                        "code": "I_AM_AI",
-                        "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          },
-          "500": {
-            "description": "Internal server error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/Error"
-                },
-                "examples": {
-                  "INTERNAL_ERROR": {
-                    "value": {
-                      "error": {
-                        "message": "Internal error occurred. Please contact us if the error persists.",
-                        "code": "INTERNAL_ERROR",
-                        "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
-                      }
-                    }
-                  }
-                }
-              }
-            }
+        "security": [
+          {
+            "bearerAuth": []
           }
-        }
-      },
-      "post": {
-        "operationId": "federation/stats",
-        "summary": "federation/stats",
-        "description": "No description provided.\n\n**Credential required**: *No*",
-        "externalDocs": {
-          "description": "Source code",
-          "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/federation/stats.ts"
-        },
-        "tags": [
-          "federation"
         ],
         "requestBody": {
           "required": true,

Get diff files from Workflow Page

Copy link

codecov bot commented Mar 14, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@adzukimame adzukimame merged commit e325acf into develop-mame Mar 14, 2024
22 checks passed
@adzukimame adzukimame deleted the hide-federation-details branch May 12, 2024 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant