mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 15:05:24 +08:00
7c32411881
### General Changes and Duplication * We now consider a post `with_secure_media?` if it is in a read-restricted category. * When uploading we now set an upload's secure status straight away. * When uploading if `SiteSetting.secure_media` is enabled, we do not check to see if the upload already exists using the `sha1` digest of the upload. The `sha1` column of the upload is filled with a `SecureRandom.hex(20)` value which is the same length as `Upload::SHA1_LENGTH`. The `original_sha1` column is filled with the _real_ sha1 digest of the file. * Whether an upload `should_be_secure?` is now determined by whether the `access_control_post` is `with_secure_media?` (if there is no access control post then we leave the secure status as is). * When serializing the upload, we now cook the URL if the upload is secure. This is so it shows up correctly in the composer preview, because we set secure status on upload. ### Viewing Secure Media * The secure-media-upload URL will take the post that the upload is attached to into account via `Guardian.can_see?` for access permissions * If there is no `access_control_post` then we just deliver the media. This should be a rare occurrance and shouldn't cause issues as the `access_control_post` is set when `link_post_uploads` is called via `CookedPostProcessor` ### Removed We no longer do any of these because we do not reuse uploads by sha1 if secure media is enabled. * We no longer have a way to prevent cross-posting of a secure upload from a private context to a public context. * We no longer have to set `secure: false` for uploads when uploading for a theme component. |
||
---|---|---|
.. | ||
api_key_fabricator.rb | ||
badge_fabricator.rb | ||
bookmark_fabricator.rb | ||
category_fabricator.rb | ||
category_group_fabricator.rb | ||
color_scheme_color_fabricator.rb | ||
color_scheme_fabricator.rb | ||
email_change_request_fabricator.rb | ||
email_log_fabricator.rb | ||
email_token_fabricator.rb | ||
embeddable_host_fabricator.rb | ||
flag_fabricator.rb | ||
group_fabricator.rb | ||
group_history_fabricator.rb | ||
group_request_fabricator.rb | ||
group_user_fabricator.rb | ||
ignored_user.rb | ||
incoming_email_fabricator.rb | ||
incoming_link_fabricator.rb | ||
invite_fabricator.rb | ||
like_fabricator.rb | ||
muted_user.rb | ||
notification_fabricator.rb | ||
optimized_image_fabricator.rb | ||
permalink_fabricator.rb | ||
post_action_fabricator.rb | ||
post_custom_field_fabricator.rb | ||
post_detail_fabricator.rb | ||
post_fabricator.rb | ||
post_reply_key_fabricator.rb | ||
post_revision_fabricator.rb | ||
reviewable_claimed_topic_fabricator.rb | ||
reviewable_fabricator.rb | ||
screened_email_fabricator.rb | ||
screened_ip_address_fabricator.rb | ||
screened_url_fabricator.rb | ||
search_log_fabricator.rb | ||
shared_draft_fabricator.rb | ||
single_sign_on_record_fabricator.rb | ||
skipped_email_log_fabricator.rb | ||
tag_fabricator.rb | ||
tag_group_fabricator.rb | ||
theme_fabricator.rb | ||
topic_allowed_group_fabricator.rb | ||
topic_allowed_user_fabricator.rb | ||
topic_embed_fabricator.rb | ||
topic_fabricator.rb | ||
topic_tag_fabricator.rb | ||
topic_timer_fabricator.rb | ||
topic_user_fabricator.rb | ||
upload_fabricator.rb | ||
user_action_fabricator.rb | ||
user_api_key_fabricator.rb | ||
user_avatar_fabricator.rb | ||
user_email_fabricator.rb | ||
user_fabricator.rb | ||
user_field_fabricator.rb | ||
user_option_fabricator.rb | ||
user_profile_fabricator.rb | ||
user_second_factor_fabricator.rb | ||
user_security_key_fabricator.rb | ||
watched_word_fabricator.rb | ||
web_crawler_request_fabricator.rb | ||
web_hook_fabricator.rb |