misskey icon indicating copy to clipboard operation
misskey copied to clipboard

feat: 外部サイトへのリンクは移動の前に警告を表示するように

Open camilla-ett opened this issue 1 year ago • 10 comments

What

Cherry-picked from https://github.com/MisskeyIO/misskey/pull/558 https://github.com/MisskeyIO/misskey/commit/f7ec503b9ceb34d61a0dbd658858915eb7399c5d

書いてあるとおり

Why

Fix #13614

Additional info (optional)

Checklist

  • [x] Read the contribution guide
  • [ ] Test working in a local environment
  • [ ] (If needed) Add story of storybook
  • [x] (If needed) Update CHANGELOG.md
  • [ ] (If possible) Add tests

camilla-ett avatar Mar 11 '24 13:03 camilla-ett

Codecov Report

Attention: Patch coverage is 83.19672% with 41 lines in your changes missing coverage. Please review.

Project coverage is 66.33%. Comparing base (61978cb) to head (c2fae88). Report is 873 commits behind head on develop.

Files with missing lines Patch % Lines
...s/frontend/src/scripts/warning-external-website.ts 29.78% 33 Missing :warning:
...kend/src/server/api/endpoints/admin/update-meta.ts 50.00% 5 Missing :warning:
...ges/backend/src/core/entities/MetaEntityService.ts 0.00% 1 Missing :warning:
...ges/backend/src/server/api/endpoints/admin/meta.ts 88.88% 1 Missing :warning:
packages/frontend/src/instance.ts 50.00% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #13557       +/-   ##
============================================
- Coverage    77.99%   66.33%   -11.67%     
============================================
  Files          185      991      +806     
  Lines        25443   116414    +90971     
  Branches       485     4448     +3963     
============================================
+ Hits         19845    77219    +57374     
- Misses        5591    39163    +33572     
- Partials         7       32       +25     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 11 '24 13:03 codecov[bot]

↑ひきつぎした

kakkokari-gtyih avatar Mar 22 '24 08:03 kakkokari-gtyih

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

差分はこちら
--- base
+++ head
@@ -416,6 +416,12 @@
                     "notesPerOneAd": {
                       "type": "number"
                     },
+                    "trustedLinkUrlPatterns": {
+                      "type": "array",
+                      "items": {
+                        "type": "string"
+                      }
+                    },
                     "backgroundImageUrl": {
                       "type": [
                         "string",
@@ -627,6 +633,7 @@
                     "perUserHomeTimelineCacheMax",
                     "perUserListTimelineCacheMax",
                     "notesPerOneAd",
+                    "trustedLinkUrlPatterns",
                     "backgroundImageUrl",
                     "deeplAuthKey",
                     "deeplIsPro",
@@ -12957,6 +12964,15 @@
                     ],
                     "description": "[Deprecated] Use \"urlPreviewSummaryProxyUrl\" instead."
                   },
+                  "trustedLinkUrlPatterns": {
+                    "type": [
+                      "array",
+                      "null"
+                    ],
+                    "items": {
+                      "type": "string"
+                    }
+                  },
                   "urlPreviewEnabled": {
                     "type": "boolean"
                   },
@@ -78670,6 +78686,12 @@
               ]
             }
           },
+          "trustedLinkUrlPatterns": {
+            "type": "array",
+            "items": {
+              "type": "string"
+            }
+          },
           "notesPerOneAd": {
             "type": "number",
             "default": 0
@@ -78765,6 +78787,7 @@
           "iconUrl",
           "maxNoteTextLength",
           "ads",
+          "trustedLinkUrlPatterns",
           "notesPerOneAd",
           "enableEmail",
           "enableServiceWorker",

Get diff files from Workflow Page

github-actions[bot] avatar Mar 22 '24 08:03 github-actions[bot]

image

kakkokari-gtyih avatar Mar 22 '24 08:03 kakkokari-gtyih

引き継ぎます

syuilo avatar Mar 25 '24 05:03 syuilo

リンク先の安全性を十分に確認した上で進んでください。

実際に進んでみないと安全かどうか確認できない気もする

syuilo avatar Mar 25 '24 11:03 syuilo

image

syuilo avatar Mar 27 '24 06:03 syuilo

checkRedirectingOtherHost がlocaleに定義されてなさそう (なんで型エラーにならないのかしら)

syuilo avatar Mar 28 '24 09:03 syuilo

そもそも checkRedirectingOtherHost はどこでも使われてないわね

syuilo avatar Mar 29 '24 11:03 syuilo

コンフリクト解消

kakkokari-gtyih avatar Mar 31 '24 02:03 kakkokari-gtyih