1
0
mirror of https://github.com/funamitech/mastodon synced 2024-11-27 14:29:03 +09:00

Merge branch 'main' into glitch-soc/merge-upstream

Conflicts:
- `README.md`:
  Upstream changed their README, we have a completely different one.
  Kept our version.
This commit is contained in:
Claire 2023-09-21 15:12:00 +02:00
commit f05985f8ec
21 changed files with 1081 additions and 886 deletions

1680
AUTHORS.md

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,7 @@ The following changelog entries focus on changes visible to users, administrator
- Add `ONE_CLICK_SSO_LOGIN` environment variable to directly link to the Single-Sign On provider if there is only one sign up method available ([CSDUMMI](https://github.com/mastodon/mastodon/pull/26083), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/26368), [CSDUMMI](https://github.com/mastodon/mastodon/pull/26857), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/26901))
- **Add webhook templating** ([Gargron](https://github.com/mastodon/mastodon/pull/23289))
- **Add webhooks for local `status.created`, `status.updated`, `account.updated` and `report.updated`** ([VyrCossont](https://github.com/mastodon/mastodon/pull/24133), [VyrCossont](https://github.com/mastodon/mastodon/pull/24243), [VyrCossont](https://github.com/mastodon/mastodon/pull/24211))
- **Add exclusive lists** ([dariusk](https://github.com/mastodon/mastodon/pull/22048), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/25324))
- **Add exclusive lists** ([dariusk, necropolina](https://github.com/mastodon/mastodon/pull/22048), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/25324))
- **Add a confirmation screen when suspending a domain** ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25144), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/25603))
- **Add support for importing lists** ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25203), [mgmn](https://github.com/mastodon/mastodon/pull/26120), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/26372))
- **Add optional hCaptcha support** ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25019), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/25057), [Gargron](https://github.com/mastodon/mastodon/pull/25395), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/26388))
@ -306,8 +306,8 @@ The following changelog entries focus on changes visible to users, administrator
### Security
- Fix missing HTML sanitization in translation API (CVE-2023-42452)
- Fix incorrect domain name normalization (CVE-2023-42451)
- Fix missing HTML sanitization in translation API (CVE-2023-42452, [GHSA-2693-xr3m-jhqr](https://github.com/mastodon/mastodon/security/advisories/GHSA-2693-xr3m-jhqr))
- Fix incorrect domain name normalization (CVE-2023-42451, [GHSA-v3xf-c9qf-j667](https://github.com/mastodon/mastodon/security/advisories/GHSA-v3xf-c9qf-j667))
## [4.1.7] - 2023-09-05

View File

@ -156,45 +156,43 @@ class Results extends PureComponent {
let filteredResults;
if (!isLoading) {
const accounts = results.get('accounts', ImmutableList());
const hashtags = results.get('hashtags', ImmutableList());
const statuses = results.get('statuses', ImmutableList());
const accounts = results.get('accounts', ImmutableList());
const hashtags = results.get('hashtags', ImmutableList());
const statuses = results.get('statuses', ImmutableList());
switch(type) {
case 'all':
filteredResults = (accounts.size + hashtags.size + statuses.size) > 0 ? (
<>
{accounts.size > 0 && (
<SearchSection key='accounts' title={<><Icon id='users' fixedWidth /><FormattedMessage id='search_results.accounts' defaultMessage='Profiles' /></>} onClickMore={this.handleLoadMoreAccounts}>
{accounts.take(INITIAL_DISPLAY).map(id => <Account key={id} id={id} />)}
</SearchSection>
)}
switch(type) {
case 'all':
filteredResults = (accounts.size + hashtags.size + statuses.size) > 0 ? (
<>
{accounts.size > 0 && (
<SearchSection key='accounts' title={<><Icon id='users' fixedWidth /><FormattedMessage id='search_results.accounts' defaultMessage='Profiles' /></>} onClickMore={this.handleLoadMoreAccounts}>
{accounts.take(INITIAL_DISPLAY).map(id => <Account key={id} id={id} />)}
</SearchSection>
)}
{hashtags.size > 0 && (
<SearchSection key='hashtags' title={<><Icon id='hashtag' fixedWidth /><FormattedMessage id='search_results.hashtags' defaultMessage='Hashtags' /></>} onClickMore={this.handleLoadMoreHashtags}>
{hashtags.take(INITIAL_DISPLAY).map(hashtag => <Hashtag key={hashtag.get('name')} hashtag={hashtag} />)}
</SearchSection>
)}
{hashtags.size > 0 && (
<SearchSection key='hashtags' title={<><Icon id='hashtag' fixedWidth /><FormattedMessage id='search_results.hashtags' defaultMessage='Hashtags' /></>} onClickMore={this.handleLoadMoreHashtags}>
{hashtags.take(INITIAL_DISPLAY).map(hashtag => <Hashtag key={hashtag.get('name')} hashtag={hashtag} />)}
</SearchSection>
)}
{statuses.size > 0 && (
<SearchSection key='statuses' title={<><Icon id='quote-right' fixedWidth /><FormattedMessage id='search_results.statuses' defaultMessage='Posts' /></>} onClickMore={this.handleLoadMoreStatuses}>
{statuses.take(INITIAL_DISPLAY).map(id => <Status key={id} id={id} />)}
</SearchSection>
)}
</>
) : [];
break;
case 'accounts':
filteredResults = renderAccounts(accounts);
break;
case 'hashtags':
filteredResults = renderHashtags(hashtags);
break;
case 'statuses':
filteredResults = renderStatuses(statuses);
break;
}
{statuses.size > 0 && (
<SearchSection key='statuses' title={<><Icon id='quote-right' fixedWidth /><FormattedMessage id='search_results.statuses' defaultMessage='Posts' /></>} onClickMore={this.handleLoadMoreStatuses}>
{statuses.take(INITIAL_DISPLAY).map(id => <Status key={id} id={id} />)}
</SearchSection>
)}
</>
) : [];
break;
case 'accounts':
filteredResults = renderAccounts(accounts);
break;
case 'hashtags':
filteredResults = renderHashtags(hashtags);
break;
case 'statuses':
filteredResults = renderStatuses(statuses);
break;
}
return (

View File

@ -414,6 +414,7 @@
"navigation_bar.lists": "Спісы",
"navigation_bar.logout": "Выйсці",
"navigation_bar.mutes": "Ігнараваныя карыстальнікі",
"navigation_bar.opened_in_classic_interface": "Допісы, уліковыя запісы і іншыя спецыфічныя старонкі па змоўчанні адчыняюцца ў класічным вэб-інтэрфейсе.",
"navigation_bar.personal": "Асабістае",
"navigation_bar.pins": "Замацаваныя допісы",
"navigation_bar.preferences": "Параметры",

View File

@ -169,7 +169,7 @@
"confirmations.delete.confirm": "Löschen",
"confirmations.delete.message": "Möchtest du diesen Beitrag wirklich löschen?",
"confirmations.delete_list.confirm": "Löschen",
"confirmations.delete_list.message": "Möchtest du diese Liste endgültig löschen?",
"confirmations.delete_list.message": "Möchtest du diese Liste für immer löschen?",
"confirmations.discard_edit_media.confirm": "Verwerfen",
"confirmations.discard_edit_media.message": "Du hast Änderungen an der Medienbeschreibung oder -vorschau vorgenommen, die noch nicht gespeichert sind. Trotzdem verwerfen?",
"confirmations.domain_block.confirm": "Domain blockieren",
@ -434,7 +434,7 @@
"notification.status": "{name} hat gerade etwas gepostet",
"notification.update": "{name} bearbeitete einen Beitrag",
"notifications.clear": "Benachrichtigungen löschen",
"notifications.clear_confirmation": "Möchtest du diese Benachrichtigung für immer löschen?",
"notifications.clear_confirmation": "Möchtest du wirklich alle Benachrichtigungen für immer löschen?",
"notifications.column_settings.admin.report": "Neue Meldungen:",
"notifications.column_settings.admin.sign_up": "Neue Registrierungen:",
"notifications.column_settings.alert": "Desktop-Benachrichtigungen",

View File

@ -308,11 +308,11 @@
"home.column_settings.show_reblogs": "부스트 표시",
"home.column_settings.show_replies": "답글 표시",
"home.explore_prompt.body": "홈 피드에는 내가 팔로우한 해시태그 그리고 팔로우한 사람과 부스트가 함께 나타나요. 너무 고요하게 느껴진다면, 다음 것들을 살펴볼 수 있어요:",
"home.explore_prompt.title": "여기가 Mastodon 이용의 본거지예요.",
"home.explore_prompt.title": "이곳은 마스토돈의 내 본거지입니다.",
"home.hide_announcements": "공지사항 숨기기",
"home.pending_critical_update.body": "가능한 한 빨리 마스토돈 서버를 업데이트 하세요!",
"home.pending_critical_update.body": "서둘러 마스토돈 서버를 업데이트 하세요!",
"home.pending_critical_update.link": "업데이트 보기",
"home.pending_critical_update.title": "긴급한 보안 업데이트가 있습니다!",
"home.pending_critical_update.title": "긴급 보안 업데이트가 있어요!",
"home.show_announcements": "공지사항 보기",
"interaction_modal.description.favourite": "마스토돈 계정을 통해, 게시물을 좋아하는 것으로 작성자에게 호의를 표하고 나중에 보기 위해 저장할 수 있습니다.",
"interaction_modal.description.follow": "마스토돈 계정을 통해, {name} 님을 팔로우 하고 그의 게시물을 홈 피드에서 받아 볼 수 있습니다.",

View File

@ -1,5 +1,5 @@
{
"about.blocks": "Beperkte en opgeschorte servers",
"about.blocks": "Gelimiteerde en opgeschorte servers",
"about.contact": "Contact:",
"about.disclaimer": "Mastodon is vrije, opensourcesoftware en een handelsmerk van Mastodon gGmbH.",
"about.domain_blocks.no_reason_available": "Reden niet beschikbaar",

View File

@ -136,7 +136,7 @@
"compose.language.change": "Chọn ngôn ngữ tút",
"compose.language.search": "Tìm ngôn ngữ...",
"compose.published.body": "Đã đăng.",
"compose.published.open": "Mở",
"compose.published.open": "Xem lại",
"compose.saved.body": "Đã lưu tút.",
"compose_form.direct_message_warning_learn_more": "Tìm hiểu thêm",
"compose_form.encryption_warning": "Các tút trên Mastodon không được mã hóa đầu cuối. Không chia sẻ bất kỳ thông tin nhạy cảm nào qua Mastodon.",

View File

@ -15,6 +15,9 @@ class REST::CredentialAccountSerializer < REST::AccountSerializer
note: object.note,
fields: object.fields.map(&:to_h),
follow_requests_count: FollowRequest.where(target_account: object).limit(40).count,
hide_collections: object.hide_collections,
discoverable: object.discoverable,
indexable: object.indexable,
}
end

View File

@ -91,28 +91,26 @@ if ENV['S3_ENABLED'] == 'true'
# Some S3-compatible providers might not actually be compatible with some APIs
# used by kt-paperclip, see https://github.com/mastodon/mastodon/issues/16822
# and https://github.com/mastodon/mastodon/issues/26394
if ENV['S3_FORCE_SINGLE_REQUEST'] == 'true' || ENV['S3_DISABLE_CHECKSUM_MODE'] == 'true'
module Paperclip
module Storage
module S3Extensions
def copy_to_local_file(style, local_dest_path)
log("copying #{path(style)} to local file #{local_dest_path}")
module Paperclip
module Storage
module S3Extensions
def copy_to_local_file(style, local_dest_path)
log("copying #{path(style)} to local file #{local_dest_path}")
options = {}
options[:mode] = 'single_request' if ENV['S3_FORCE_SINGLE_REQUEST'] == 'true'
options[:checksum_mode] = 'DISABLED' if ENV['S3_DISABLE_CHECKSUM_MODE'] == 'true'
options = {}
options[:mode] = 'single_request' if ENV['S3_FORCE_SINGLE_REQUEST'] == 'true'
options[:checksum_mode] = 'DISABLED' unless ENV['S3_ENABLE_CHECKSUM_MODE'] == 'true'
s3_object(style).download_file(local_dest_path, options)
rescue Aws::Errors::ServiceError => e
warn("#{e} - cannot copy #{path(style)} to local file #{local_dest_path}")
false
end
s3_object(style).download_file(local_dest_path, options)
rescue Aws::Errors::ServiceError => e
warn("#{e} - cannot copy #{path(style)} to local file #{local_dest_path}")
false
end
end
end
Paperclip::Storage::S3.prepend(Paperclip::Storage::S3Extensions)
end
Paperclip::Storage::S3.prepend(Paperclip::Storage::S3Extensions)
elsif ENV['SWIFT_ENABLED'] == 'true'
require 'fog/openstack'

View File

@ -315,7 +315,7 @@ be:
unpublish: Зняць з публікацыі
unpublished_msg: Аб'ява паспяхова схована!
updated_msg: Аб'ява паспяхова адноўлена!
critical_update_pending: Чакаецца крытычнае абнаўленне
critical_update_pending: Чакаецца абнаўленне
custom_emojis:
assign_category: Прызначыць катэгорыю
by_domain: Дамен
@ -801,13 +801,16 @@ be:
open: Любому магчыма зарэгістравацца
security:
authorized_fetch: Патрабаваць аўтэнтыфікацыю ад федэратыўных сервераў
authorized_fetch_hint: Патрабаванне аўтэнтыфікацыі ад федэратыўных сервераў дазваляе больш строга выконваць блакіроўкі як на ўзроўні карыстача, так і на ўзроўні сервера. Аднак пры гэтым зніжаецца прадукцыйнасць, памяншаецца ахоп вашых адказаў на допісы і могуць узнікнуць праблемы сумяшчальнасці з некаторымі федэратыўнымі сэрвісамі. Акрамя таго, гэта не перашкодзіць атрымліваць вашыя публічныя допісы і ўліковыя запісы.
authorized_fetch_overridden_hint: Вы не можаце змяніць гэты параметр, паколькі ён перавызначаны зменнай асяроддзя.
federation_authentication: Патрабаванне аўтэнтыфікацыі ад федэратыўных сэрвісаў
title: Налады сервера
site_uploads:
delete: Выдаліць запампаваны файл
destroyed_msg: Загрузка сайту паспяхова выдалена!
software_updates:
critical_update: Крытычна - зрабіце абнаўленне як мага хутчэй
description: Рэкамендуецца падтрымліваць усталёўку Mastodon у актуальным стане, каб карыстацца апошнімі выпраўленнямі і магчымасцямі. Акрамя таго, часам вельмі важна своечасова абнаўляць Mastodon, каб пазбегнуць праблем з бяспекай. Па гэтых прычынах Mastodon правярае наяўнасць абнаўленняў кожныя 30 хвілін і паведамляе вам пра гэта ў адпаведнасці з вашымі наладамі апавяшчэнняў па электроннай пошце.
documentation_link: Даведацца больш
release_notes: Журнал змен
title: Даступныя абнаўленні
@ -815,6 +818,7 @@ be:
types:
major: Буйны рэліз
minor: Малы рэліз
patch: Патч-рэліз — выпраўленні памылак і простыя ва ўжыванні змены
version: Версія
statuses:
account: Аўтар
@ -885,6 +889,7 @@ be:
message_html: Даступна крытычнае абнаўленне Mastodon, калі ласка, зрабіце абнаўленне як мага хутчэй.
software_version_patch_check:
action: Прагледзець даступныя абнаўленні
message_html: Даступна абнаўленне Mastodon з выпраўленнем памылак.
upload_check_privacy_error:
action: Для падрабязнасцей націсніце тут
message_html: "<strong>Ваш сервер не наладжаны. Прыватнасць карыстальнікаў пад пагрозай.</strong>"
@ -1007,6 +1012,7 @@ be:
next_steps: Вы можаце ўхваліць апеляцыю каб адмяніць рашэнне мадэратараў ці ігнараваць яе.
subject: "%{username} абскарджвае рашэнне мадэратараў на %{instance}"
new_critical_software_updates:
body: Выпушчаны новыя крытычныя версіі Mastodon, неабходна абнавіцца як мага хутчэй!
subject: Даступны крытычныя абнаўленні Mastodon для %{instance}!
new_pending_account:
body: Падрабязнасці новага ўліковага запісу прыведзены ніжэй. Вы можаце зацвердзіць або адхіліць гэтую заяўку.

View File

@ -482,7 +482,7 @@ de:
back_to_limited: Stummgeschaltet
back_to_warning: Warnung
by_domain: Domain
confirm_purge: Möchtest du die Daten von dieser Domain wirklich dauerhaft löschen?
confirm_purge: Möchtest du die Daten von dieser Domain wirklich für immer löschen?
content_policies:
comment: Interne Notiz
description_html: Du kannst Inhaltsrichtlinien definieren, die auf alle Konten dieser Domain und einer ihrer Subdomains angewendet werden.

View File

@ -955,11 +955,11 @@ gd:
listable: Gabhaidh a mholadh
no_tag_selected: Cha deach taga sam bith atharrachadh o nach deach gin dhiubh a thaghadh
not_listable: Cha dèid a mholadh
not_trendable: Cha nochd e am measg nan treandaichean
not_trendable: Na nochd sna treandaichean
not_usable: Cha ghabh a chleachdadh
peaked_on_and_decaying: Air a bhàrr %{date}, a crìonadh an-dràsta
title: Tagaichean hais a treandadh
trendable: Nochd am measg nan treandaichean
trendable: Nochd sna treandaichean
trending_rank: 'A treandadh #%{rank}'
usable: Gabhaidh a chleachdadh
usage_comparison: Chaidh a chleachdadh %{today} tura(i)s an-diugh an coimeas ri %{yesterday} an-dè
@ -1686,7 +1686,7 @@ gd:
preferences: Roghainnean
profile: Pròifil phoblach
relationships: Dàimhean leantainn
statuses_cleanup: Sguabadh às fèin-obrachail phostaichean
statuses_cleanup: Sguabadh às phostaichean
strikes: Rabhaidhean na maorsainneachd
two_factor_authentication: Dearbhadh dà-cheumnach
webauthn_authentication: Iuchraichean tèarainteachd

View File

@ -306,7 +306,7 @@ ko:
unpublish: 게시 취소
unpublished_msg: 공지가 성공적으로 발행 취소되었습니다!
updated_msg: 공지가 성공적으로 업데이트되었습니다!
critical_update_pending: 긴급 업데이트 보류 중
critical_update_pending: 긴급 업데이트 보류 중
custom_emojis:
assign_category: 분류 지정
by_domain: 도메인
@ -846,7 +846,7 @@ ko:
message_html: "%{value} 큐에 대한 사이드킥 프로세스가 발견되지 않았습니다. 사이드킥 설정을 검토해주세요"
software_version_critical_check:
action: 사용 가능한 업데이트 보기
message_html: 긴급한 마스토돈 업데이트가 사용 가능합니다. 되도록 빨리 업데이트 해주세요.
message_html: 긴급 마스토돈 업데이트가 있으니, 가능한 서둘러 업데이트 해주세요.
software_version_patch_check:
action: 사용 가능한 업데이트 보기
message_html: 마스토돈 버그픽스 업데이트가 있습니다.
@ -960,8 +960,8 @@ ko:
next_steps: 중재 결정사항을 되돌리기 위해서 상소를 승인하거나, 무시할 수 있습니다.
subject: "%{username} 님이 %{instance}에서 발생한 중재 결정에 대해 소명을 제출했습니다"
new_critical_software_updates:
body: 마스토돈의 긴급한 업데이트가 릴리스되었습니다. 되도록 빨리 업데이트 하시길 바랍니다!
subject: "%{instance}에 대해 긴급 업데이트가 있습니다!"
body: 마스토돈의 긴급 업데이트가 릴리스 되었으니, 가능한 서둘러 업데이트를 바랍니다!
subject: "%{instance}에 대해 긴급 업데이트가 있습니다!"
new_pending_account:
body: 아래에 새 계정에 대한 상세정보가 있습니다. 이 가입을 승인하거나 거부할 수 있습니다.
subject: "%{instance}의 새 계정(%{username})에 대한 심사가 대기중입니다"
@ -1501,7 +1501,7 @@ ko:
privacy: 개인정보
privacy_hint_html: 다른 이들을 위해 노출할 수 있는 정보의 양을 조절합니다. 누군가는 다른 이들의 팔로우를 둘러보고 어떤 앱에서 게시물을 올렸는지 살피면서 흥미로운 프로필과 멋진 앱을 발견할 수 있지만, 누군가는 이를 숨기고 싶을 수도 있겠죠.
reach: 도달
reach_hint_html: 새로운 사람들이 나를 발견하고 팔로우하도록 허용할지 여부를 제어합니다. 발견하기 화면에 게시물이 표시되기를 바라나요? 다른 사람들의 팔로우 추천에 표시되기를 바라나요? 모든 새 팔로워를 자동으로 수락하거나 각 팔로워를 세세하게 제어할까요?
reach_hint_html: 새로운 사람들이 나를 발견하고 팔로우하도록 허용할지 여부를 제어합니다. 둘러보기 화면에 게시물이 표시되기를 바라나요? 다른 사람들의 팔로우 추천에 표시되기를 바라나요? 모든 새 팔로워를 자동으로 수락하거나 각 팔로워를 세세하게 제어할까요?
search: 검색
search_hint_html: 내가 어떻게 발견될지를 제어합니다. 내가 공개적으로 게시한 것들로 인해 사람들이 날 발견하길 원하나요? 마스토돈 바깥의 사람들이 웹에서 검색을 통해 내 프로필을 발견하길 원하나요? 공개적인 정보에 대해서 모든 검색엔진의 검색결과에서 제외하는 것은 보장할 수 없다는 점에 주의해주세요.
title: 개인정보와 도달

View File

@ -1738,7 +1738,7 @@ nl:
default: "%d %B %Y om %H:%M"
month: "%b %Y"
time: "%H:%M"
with_time_zone: "%d %b, %Y, %H:%M %Z"
with_time_zone: "%d %b %Y, %H:%M %Z"
translation:
errors:
quota_exceeded: Het gebruikersquotum voor de vertaaldienst is overschreden.

View File

@ -296,6 +296,7 @@ be:
critical: Апавяшчаць толькі аб крытычных абнаўленнях
label: Даступная новая версія Mastodon
none: Не апавяшчаць аб абнаўленнях (не рэкамендуецца)
patch: Апавяшчаць аб абнаўленнях з выпраўленнем памылак
trending_tag: Новы трэнд патрабуе разгляду
rule:
text: Правіла

View File

@ -293,7 +293,7 @@ ko:
report: 새 신고가 접수되었을 때
software_updates:
all: 모든 업데이트에 대해 알림
critical: 긴급 업데이트에 대해서만 알림
critical: 긴급 업데이트에 대해서만 알림
label: 새 마스토돈 버전이 사용 가능합니다
none: 업데이트에 대해 알리지 않기 (비추천)
patch: 버그픽스 업데이트에 대해 알림

View File

@ -69,7 +69,7 @@ class MoveUserSettings < ActiveRecord::Migration[6.1]
MAPPING.each do |legacy_key, new_key|
value = previous_settings[legacy_key]&.value
next if value.blank?
next if value.nil?
if value.is_a?(Hash)
value.each do |nested_key, nested_value|

View File

@ -59,6 +59,11 @@ namespace :tests do
exit(1)
end
unless User.find(1).settings['web.trends'] == false
puts 'User settings not kept as expected'
exit(1)
end
unless Account.find_remote('bob', 'ActivityPub.com').domain == 'activitypub.com'
puts 'Account domains not properly normalized'
exit(1)
@ -131,7 +136,8 @@ namespace :tests do
INSERT INTO "settings"
(id, thing_type, thing_id, var, value, created_at, updated_at)
VALUES
(3, 'User', 1, 'notification_emails', E'--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nfollow: false\nreblog: true\nfavourite: true\nmention: false\nfollow_request: true\ndigest: true\nreport: true\npending_account: false\ntrending_tag: true\nappeal: true\n', now(), now());
(3, 'User', 1, 'notification_emails', E'--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nfollow: false\nreblog: true\nfavourite: true\nmention: false\nfollow_request: true\ndigest: true\nreport: true\npending_account: false\ntrending_tag: true\nappeal: true\n', now(), now()),
(4, 'User', 1, 'trends', E'--- false\n', now(), now());
INSERT INTO "accounts"
(id, username, domain, private_key, public_key, created_at, updated_at)
@ -146,7 +152,7 @@ namespace :tests do
INSERT INTO "settings"
(id, thing_type, thing_id, var, value, created_at, updated_at)
VALUES
(4, 'User', 4, 'default_language', E'--- kmr\n', now(), now());
(5, 'User', 4, 'default_language', E'--- kmr\n', now(), now());
SQL
end

View File

@ -0,0 +1,64 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'credentials API' do
let(:user) { Fabricate(:user, account_attributes: { discoverable: false, locked: true, indexable: false }) }
let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
let(:scopes) { 'read:accounts write:accounts' }
let(:headers) { { 'Authorization' => "Bearer #{token.token}" } }
describe 'GET /api/v1/accounts/verify_credentials' do
subject do
get '/api/v1/accounts/verify_credentials', headers: headers
end
it_behaves_like 'forbidden for wrong scope', 'write write:accounts'
it 'returns http success' do
subject
expect(response).to have_http_status(200)
end
it 'returns the expected content' do
subject
expect(body_as_json).to include({
source: hash_including({
discoverable: false,
indexable: false,
}),
locked: true,
})
end
end
describe 'POST /api/v1/accounts/update_credentials' do
subject do
patch '/api/v1/accounts/update_credentials', headers: headers, params: params
end
let(:params) { { discoverable: true, locked: false, indexable: true } }
it_behaves_like 'forbidden for wrong scope', 'read read:accounts'
it 'returns http success' do
subject
expect(response).to have_http_status(200)
end
it 'returns JSON with updated attributes' do
subject
expect(body_as_json).to include({
source: hash_including({
discoverable: true,
indexable: true,
}),
locked: false,
})
end
end
end

View File

@ -3333,13 +3333,13 @@ atrament@0.2.4:
integrity sha512-hSA9VwW6COMwvRhSEO4uZweZ91YGOdHqwvslNyrJZG+8mzc4qx/qMsDZBuAeXFeWZO/QKtRjIXguOUy1aNMl3A==
autoprefixer@^10.4.14:
version "10.4.15"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.15.tgz#a1230f4aeb3636b89120b34a1f513e2f6834d530"
integrity sha512-KCuPB8ZCIqFdA4HwKXsvz7j6gvSDNhDP7WnUjBleRkKjPdvCmHFuQ77ocavI8FT6NdvlBnE2UFr2H4Mycn8Vew==
version "10.4.16"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.16.tgz#fad1411024d8670880bdece3970aa72e3572feb8"
integrity sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==
dependencies:
browserslist "^4.21.10"
caniuse-lite "^1.0.30001520"
fraction.js "^4.2.0"
caniuse-lite "^1.0.30001538"
fraction.js "^4.3.6"
normalize-range "^0.1.2"
picocolors "^1.0.0"
postcss-value-parser "^4.2.0"
@ -3942,15 +3942,10 @@ caniuse-lite@^1.0.30001502:
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001515.tgz#418aefeed9d024cd3129bfae0ccc782d4cb8f12b"
integrity sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA==
caniuse-lite@^1.0.30001517:
version "1.0.30001535"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001535.tgz#908a5b7ef11172f51f0b88f3d850aef1c6a3cf7b"
integrity sha512-48jLyUkiWFfhm/afF7cQPqPjaUmSraEhK4j+FCTJpgnGGEZHqyLe3hmWH7lIooZdSzXL0ReMvHz0vKDoTBsrwg==
caniuse-lite@^1.0.30001520:
version "1.0.30001520"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001520.tgz#62e2b7a1c7b35269594cf296a80bdf8cb9565006"
integrity sha512-tahF5O9EiiTzwTUqAeFjIZbn4Dnqxzz7ktrgGlMYNLH43Ul26IgTMH/zvL3DG0lZxBYnlT04axvInszUsZULdA==
caniuse-lite@^1.0.30001517, caniuse-lite@^1.0.30001538:
version "1.0.30001538"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001538.tgz#9dbc6b9af1ff06b5eb12350c2012b3af56744f3f"
integrity sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw==
chalk@5.2.0:
version "5.2.0"
@ -5090,9 +5085,9 @@ electron-to-chromium@^1.4.428:
integrity sha512-/g3UyNDmDd6ebeWapmAoiyy+Sy2HyJ+/X8KyvNeHfKRFfHaA2W8oF5fxD5F3tjBDcjpwo0iek6YNgxNXDBoEtA==
electron-to-chromium@^1.4.477:
version "1.4.523"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.523.tgz#f82f99243c827df05c26776d49712cb284972df6"
integrity sha512-9AreocSUWnzNtvLcbpng6N+GkXnCcBR80IQkxRC9Dfdyg4gaWNUPBujAHUpKkiUkoSoR9UlhA4zD/IgBklmhzg==
version "1.4.526"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.526.tgz#1bcda5f2b8238e497c20fcdb41af5da907a770e2"
integrity sha512-tjjTMjmZAx1g6COrintLTa2/jcafYKxKoiEkdQOrVdbLaHh2wCt2nsAF8ZHweezkrP+dl/VG9T5nabcYoo0U5Q==
elliptic@^6.5.3:
version "6.5.4"
@ -6065,10 +6060,10 @@ forwarded@0.2.0:
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811"
integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==
fraction.js@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.2.0.tgz#448e5109a313a3527f5a3ab2119ec4cf0e0e2950"
integrity sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==
fraction.js@^4.3.6:
version "4.3.6"
resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.3.6.tgz#e9e3acec6c9a28cf7bc36cbe35eea4ceb2c5c92d"
integrity sha512-n2aZ9tNfYDwaHhvFTkhFErqOMIb8uyzSQ+vGJBjZyanAKZVbGUQ1sngfk9FdkBw7G26O7AgNjLcecLffD1c7eg==
fragment-cache@^0.2.1:
version "0.2.1"
@ -6246,9 +6241,9 @@ glob-parent@^6.0.2:
is-glob "^4.0.3"
glob@^10.2.5, glob@^10.2.6:
version "10.3.4"
resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.4.tgz#c85c9c7ab98669102b6defda76d35c5b1ef9766f"
integrity sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==
version "10.3.5"
resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.5.tgz#4c0e46b5bccd78ac42b06a7eaaeb9ee34062968e"
integrity sha512-bYUpUD7XDEHI4Q2O5a7PXGvyw4deKR70kHiDxzQbe925wbZknhOzUt2xBgTkYL6RBcVeXYuD9iNYeqoWbBZQnA==
dependencies:
foreground-child "^3.1.0"
jackspeak "^2.0.3"
@ -7366,9 +7361,9 @@ iterator.prototype@^1.1.0:
reflect.getprototypeof "^1.0.3"
jackspeak@^2.0.3:
version "2.3.1"
resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.1.tgz#ce2effa4c458e053640e61938865a5b5fae98456"
integrity sha512-4iSY3Bh1Htv+kLhiiZunUhQ+OYXIn0ze3ulq8JeWrFKmhPAJSySV2+kdtRh2pGcCeF0s6oR8Oc+pYZynJj4t8A==
version "2.3.3"
resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.3.tgz#95e4cbcc03b3eb357bf6bcce14a903fb3d1151e1"
integrity sha512-R2bUw+kVZFS/h1AZqBKrSgDmdmjApzgY0AlCPumopFiAlbUxE2gf+SCuBzQ0cP5hHmUmFYF5yw55T97Th5Kstg==
dependencies:
"@isaacs/cliui" "^8.0.2"
optionalDependencies:
@ -11480,7 +11475,6 @@ stringz@^2.1.0:
char-regex "^1.0.2"
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
name strip-ansi-cjs
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@ -12294,9 +12288,9 @@ upath@^1.1.1, upath@^1.2.0:
integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==
update-browserslist-db@^1.0.11:
version "1.0.11"
resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940"
integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==
version "1.0.12"
resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.12.tgz#868ce670ac09b4a4d4c86b608701c0dee2dc41cd"
integrity sha512-tE1smlR58jxbFMtrMpFNRmsrOXlpNXss965T1CrpwuZUzUAg/TBQc94SpyhDLSzrqrJS9xTRBthnZAGcE1oaxg==
dependencies:
escalade "^3.1.1"
picocolors "^1.0.0"