Merge branch 'develop' into refactor/discoverable_user_field
authorMark Felder <feld@FreeBSD.org>
Tue, 13 Oct 2020 14:54:11 +0000 (09:54 -0500)
committerMark Felder <feld@FreeBSD.org>
Tue, 13 Oct 2020 14:54:11 +0000 (09:54 -0500)
488 files changed:
.credo.exs
config/config.exs
config/description.exs
config/test.exs
coveralls.json
docs/configuration/cheatsheet.md
docs/dev.md
lib/credo/check/consistency/file_location.ex [new file with mode: 0644]
lib/mix/tasks/pleroma/ecto.ex [moved from lib/mix/tasks/pleroma/ecto/ecto.ex with 100% similarity]
lib/mix/tasks/pleroma/robots_txt.ex [moved from lib/mix/tasks/pleroma/robotstxt.ex with 100% similarity]
lib/phoenix/transports/web_socket/raw.ex [moved from lib/transports.ex with 100% similarity]
lib/pleroma/application.ex
lib/pleroma/bbs/authenticator.ex
lib/pleroma/captcha.ex [moved from lib/pleroma/captcha/captcha.ex with 100% similarity]
lib/pleroma/captcha/service.ex [moved from lib/pleroma/captcha/captcha_service.ex with 100% similarity]
lib/pleroma/config/deprecation_warnings.ex
lib/pleroma/config_db.ex [moved from lib/pleroma/config/config_db.ex with 100% similarity]
lib/pleroma/conversation/participation/recipient_ship.ex [moved from lib/pleroma/conversation/participation_recipient_ship.ex with 100% similarity]
lib/pleroma/gun.ex [moved from lib/pleroma/gun/gun.ex with 100% similarity]
lib/pleroma/http.ex [moved from lib/pleroma/http/http.ex with 100% similarity]
lib/pleroma/reverse_proxy.ex [moved from lib/pleroma/reverse_proxy/reverse_proxy.ex with 100% similarity]
lib/pleroma/tests/auth_test_controller.ex
lib/pleroma/uploaders/uploader.ex
lib/pleroma/web.ex [moved from lib/pleroma/web/web.ex with 93% similarity]
lib/pleroma/web/activity_pub/activity_pub_controller.ex
lib/pleroma/web/admin_api/controllers/admin_api_controller.ex
lib/pleroma/web/admin_api/controllers/chat_controller.ex
lib/pleroma/web/admin_api/controllers/config_controller.ex
lib/pleroma/web/admin_api/controllers/instance_document_controller.ex
lib/pleroma/web/admin_api/controllers/invite_controller.ex
lib/pleroma/web/admin_api/controllers/media_proxy_cache_controller.ex
lib/pleroma/web/admin_api/controllers/o_auth_app_controller.ex [moved from lib/pleroma/web/admin_api/controllers/oauth_app_controller.ex with 97% similarity]
lib/pleroma/web/admin_api/controllers/relay_controller.ex
lib/pleroma/web/admin_api/controllers/report_controller.ex
lib/pleroma/web/admin_api/controllers/status_controller.ex
lib/pleroma/web/api_spec/operations/admin/o_auth_app_operation.ex [moved from lib/pleroma/web/api_spec/operations/admin/oauth_app_operation.ex with 100% similarity]
lib/pleroma/web/auth/pleroma_authenticator.ex
lib/pleroma/web/auth/totp_authenticator.ex
lib/pleroma/web/common_api.ex [moved from lib/pleroma/web/common_api/common_api.ex with 100% similarity]
lib/pleroma/web/common_api/utils.ex
lib/pleroma/web/endpoint.ex
lib/pleroma/web/fallback/redirect_controller.ex [moved from lib/pleroma/web/fallback_redirect_controller.ex with 95% similarity]
lib/pleroma/web/fed_sockets.ex [moved from lib/pleroma/web/fed_sockets/fed_sockets.ex with 100% similarity]
lib/pleroma/web/federator.ex [moved from lib/pleroma/web/federator/federator.ex with 100% similarity]
lib/pleroma/web/feed/user_controller.ex
lib/pleroma/web/masto_fe_controller.ex
lib/pleroma/web/mastodon_api/controllers/account_controller.ex
lib/pleroma/web/mastodon_api/controllers/app_controller.ex
lib/pleroma/web/mastodon_api/controllers/auth_controller.ex
lib/pleroma/web/mastodon_api/controllers/conversation_controller.ex
lib/pleroma/web/mastodon_api/controllers/custom_emoji_controller.ex
lib/pleroma/web/mastodon_api/controllers/domain_block_controller.ex
lib/pleroma/web/mastodon_api/controllers/filter_controller.ex
lib/pleroma/web/mastodon_api/controllers/follow_request_controller.ex
lib/pleroma/web/mastodon_api/controllers/instance_controller.ex
lib/pleroma/web/mastodon_api/controllers/list_controller.ex
lib/pleroma/web/mastodon_api/controllers/marker_controller.ex
lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
lib/pleroma/web/mastodon_api/controllers/media_controller.ex
lib/pleroma/web/mastodon_api/controllers/notification_controller.ex
lib/pleroma/web/mastodon_api/controllers/poll_controller.ex
lib/pleroma/web/mastodon_api/controllers/report_controller.ex
lib/pleroma/web/mastodon_api/controllers/scheduled_activity_controller.ex
lib/pleroma/web/mastodon_api/controllers/search_controller.ex
lib/pleroma/web/mastodon_api/controllers/status_controller.ex
lib/pleroma/web/mastodon_api/controllers/subscription_controller.ex
lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex
lib/pleroma/web/media_proxy.ex [moved from lib/pleroma/web/media_proxy/media_proxy.ex with 100% similarity]
lib/pleroma/web/media_proxy/invalidation/http.ex [moved from lib/pleroma/web/media_proxy/invalidations/http.ex with 100% similarity]
lib/pleroma/web/media_proxy/invalidation/script.ex [moved from lib/pleroma/web/media_proxy/invalidations/script.ex with 100% similarity]
lib/pleroma/web/metadata/providers/feed.ex [moved from lib/pleroma/web/metadata/feed.ex with 100% similarity]
lib/pleroma/web/metadata/providers/open_graph.ex [moved from lib/pleroma/web/metadata/opengraph.ex with 100% similarity]
lib/pleroma/web/metadata/providers/provider.ex [moved from lib/pleroma/web/metadata/provider.ex with 100% similarity]
lib/pleroma/web/metadata/providers/rel_me.ex [moved from lib/pleroma/web/metadata/rel_me.ex with 100% similarity]
lib/pleroma/web/metadata/providers/restrict_indexing.ex [moved from lib/pleroma/web/metadata/restrict_indexing.ex with 100% similarity]
lib/pleroma/web/metadata/providers/twitter_card.ex [moved from lib/pleroma/web/metadata/twitter_card.ex with 100% similarity]
lib/pleroma/web/mongoose_im/mongoose_im_controller.ex [moved from lib/pleroma/web/mongooseim/mongoose_im_controller.ex with 93% similarity]
lib/pleroma/web/o_auth.ex [moved from lib/pleroma/web/oauth.ex with 100% similarity]
lib/pleroma/web/o_auth/app.ex [moved from lib/pleroma/web/oauth/app.ex with 100% similarity]
lib/pleroma/web/o_auth/authorization.ex [moved from lib/pleroma/web/oauth/authorization.ex with 100% similarity]
lib/pleroma/web/o_auth/fallback_controller.ex [moved from lib/pleroma/web/oauth/fallback_controller.ex with 100% similarity]
lib/pleroma/web/o_auth/mfa_controller.ex [moved from lib/pleroma/web/oauth/mfa_controller.ex with 100% similarity]
lib/pleroma/web/o_auth/mfa_view.ex [moved from lib/pleroma/web/oauth/mfa_view.ex with 100% similarity]
lib/pleroma/web/o_auth/o_auth_controller.ex [moved from lib/pleroma/web/oauth/oauth_controller.ex with 99% similarity]
lib/pleroma/web/o_auth/o_auth_view.ex [moved from lib/pleroma/web/oauth/oauth_view.ex with 100% similarity]
lib/pleroma/web/o_auth/scopes.ex [moved from lib/pleroma/web/oauth/scopes.ex with 97% similarity]
lib/pleroma/web/o_auth/token.ex [moved from lib/pleroma/web/oauth/token.ex with 100% similarity]
lib/pleroma/web/o_auth/token/query.ex [moved from lib/pleroma/web/oauth/token/query.ex with 100% similarity]
lib/pleroma/web/o_auth/token/strategy/refresh_token.ex [moved from lib/pleroma/web/oauth/token/strategy/refresh_token.ex with 100% similarity]
lib/pleroma/web/o_auth/token/strategy/revoke.ex [moved from lib/pleroma/web/oauth/token/strategy/revoke.ex with 100% similarity]
lib/pleroma/web/o_auth/token/utils.ex [moved from lib/pleroma/web/oauth/token/utils.ex with 100% similarity]
lib/pleroma/web/o_status/o_status_controller.ex [moved from lib/pleroma/web/ostatus/ostatus_controller.ex with 95% similarity]
lib/pleroma/web/pleroma_api/controllers/account_controller.ex
lib/pleroma/web/pleroma_api/controllers/chat_controller.ex
lib/pleroma/web/pleroma_api/controllers/conversation_controller.ex
lib/pleroma/web/pleroma_api/controllers/emoji_file_controller.ex
lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex
lib/pleroma/web/pleroma_api/controllers/emoji_reaction_controller.ex
lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex
lib/pleroma/web/pleroma_api/controllers/notification_controller.ex
lib/pleroma/web/pleroma_api/controllers/scrobble_controller.ex
lib/pleroma/web/pleroma_api/controllers/two_factor_authentication_controller.ex
lib/pleroma/web/pleroma_api/controllers/user_import_controller.ex
lib/pleroma/web/plug.ex [new file with mode: 0644]
lib/pleroma/web/plugs/admin_secret_authentication_plug.ex [moved from lib/pleroma/plugs/admin_secret_authentication_plug.ex with 89% similarity]
lib/pleroma/web/plugs/authentication_plug.ex [moved from lib/pleroma/plugs/authentication_plug.ex with 94% similarity]
lib/pleroma/web/plugs/basic_auth_decoder_plug.ex [moved from lib/pleroma/plugs/basic_auth_decoder_plug.ex with 92% similarity]
lib/pleroma/web/plugs/cache.ex [moved from lib/pleroma/plugs/cache.ex with 96% similarity]
lib/pleroma/web/plugs/digest_plug.ex [moved from lib/pleroma/plugs/digest.ex with 100% similarity]
lib/pleroma/web/plugs/ensure_authenticated_plug.ex [moved from lib/pleroma/plugs/ensure_authenticated_plug.ex with 94% similarity]
lib/pleroma/web/plugs/ensure_public_or_authenticated_plug.ex [moved from lib/pleroma/plugs/ensure_public_or_authenticated_plug.ex with 91% similarity]
lib/pleroma/web/plugs/ensure_user_key_plug.ex [moved from lib/pleroma/plugs/ensure_user_key_plug.ex with 87% similarity]
lib/pleroma/web/plugs/expect_authenticated_check_plug.ex [moved from lib/pleroma/plugs/expect_authenticated_check_plug.ex with 71% similarity]
lib/pleroma/web/plugs/expect_public_or_authenticated_check_plug.ex [moved from lib/pleroma/plugs/expect_public_or_authenticated_check_plug.ex with 70% similarity]
lib/pleroma/web/plugs/federating_plug.ex [moved from lib/pleroma/plugs/federating_plug.ex with 93% similarity]
lib/pleroma/web/plugs/frontend_static.ex [moved from lib/pleroma/plugs/frontend_static.ex with 96% similarity]
lib/pleroma/web/plugs/http_security_plug.ex [moved from lib/pleroma/plugs/http_security_plug.ex with 99% similarity]
lib/pleroma/web/plugs/http_signature_plug.ex [moved from lib/pleroma/plugs/http_signature.ex with 100% similarity]
lib/pleroma/web/plugs/idempotency_plug.ex [moved from lib/pleroma/plugs/idempotency_plug.ex with 97% similarity]
lib/pleroma/web/plugs/instance_static.ex [moved from lib/pleroma/plugs/instance_static.ex with 91% similarity]
lib/pleroma/web/plugs/legacy_authentication_plug.ex [moved from lib/pleroma/plugs/legacy_authentication_plug.ex with 87% similarity]
lib/pleroma/web/plugs/mapped_signature_to_identity_plug.ex [moved from lib/pleroma/plugs/mapped_signature_to_identity_plug.ex with 100% similarity]
lib/pleroma/web/plugs/o_auth_plug.ex [moved from lib/pleroma/plugs/oauth_plug.ex with 98% similarity]
lib/pleroma/web/plugs/o_auth_scopes_plug.ex [moved from lib/pleroma/plugs/oauth_scopes_plug.ex with 97% similarity]
lib/pleroma/web/plugs/plug_helper.ex [moved from lib/pleroma/plugs/plug_helper.ex with 97% similarity]
lib/pleroma/web/plugs/rate_limiter.ex [moved from lib/pleroma/plugs/rate_limiter/rate_limiter.ex with 93% similarity]
lib/pleroma/web/plugs/rate_limiter/limiter_supervisor.ex [moved from lib/pleroma/plugs/rate_limiter/limiter_supervisor.ex with 95% similarity]
lib/pleroma/web/plugs/rate_limiter/supervisor.ex [moved from lib/pleroma/plugs/rate_limiter/supervisor.ex with 80% similarity]
lib/pleroma/web/plugs/remote_ip.ex [moved from lib/pleroma/plugs/remote_ip.ex with 97% similarity]
lib/pleroma/web/plugs/session_authentication_plug.ex [moved from lib/pleroma/plugs/session_authentication_plug.ex with 89% similarity]
lib/pleroma/web/plugs/set_format_plug.ex [moved from lib/pleroma/plugs/set_format_plug.ex with 92% similarity]
lib/pleroma/web/plugs/set_locale_plug.ex [moved from lib/pleroma/plugs/set_locale_plug.ex with 97% similarity]
lib/pleroma/web/plugs/set_user_session_id_plug.ex [moved from lib/pleroma/plugs/set_user_session_id_plug.ex with 87% similarity]
lib/pleroma/web/plugs/static_fe_plug.ex [moved from lib/pleroma/plugs/static_fe_plug.ex with 93% similarity]
lib/pleroma/web/plugs/trailing_format_plug.ex [moved from lib/pleroma/plugs/trailing_format_plug.ex with 95% similarity]
lib/pleroma/web/plugs/uploaded_media.ex [moved from lib/pleroma/plugs/uploaded_media.ex with 98% similarity]
lib/pleroma/web/plugs/user_enabled_plug.ex [moved from lib/pleroma/plugs/user_enabled_plug.ex with 90% similarity]
lib/pleroma/web/plugs/user_fetcher_plug.ex [moved from lib/pleroma/plugs/user_fetcher_plug.ex with 91% similarity]
lib/pleroma/web/plugs/user_is_admin_plug.ex [moved from lib/pleroma/plugs/user_is_admin_plug.ex with 91% similarity]
lib/pleroma/web/preload/providers/instance.ex [moved from lib/pleroma/web/preload/instance.ex with 97% similarity]
lib/pleroma/web/preload/providers/provider.ex [moved from lib/pleroma/web/preload/provider.ex with 100% similarity]
lib/pleroma/web/preload/providers/timelines.ex [moved from lib/pleroma/web/preload/timelines.ex with 100% similarity]
lib/pleroma/web/preload/providers/user.ex [moved from lib/pleroma/web/preload/user.ex with 100% similarity]
lib/pleroma/web/push.ex [moved from lib/pleroma/web/push/push.ex with 100% similarity]
lib/pleroma/web/rich_media/parser/ttl.ex [moved from lib/pleroma/web/rich_media/parsers/ttl/ttl.ex with 71% similarity]
lib/pleroma/web/rich_media/parser/ttl/aws_signed_url.ex [moved from lib/pleroma/web/rich_media/parsers/ttl/aws_signed_url.ex with 96% similarity]
lib/pleroma/web/rich_media/parsers/o_embed.ex [moved from lib/pleroma/web/rich_media/parsers/oembed_parser.ex with 100% similarity]
lib/pleroma/web/router.ex
lib/pleroma/web/static_fe/static_fe_controller.ex
lib/pleroma/web/streamer.ex [moved from lib/pleroma/web/streamer/streamer.ex with 99% similarity]
lib/pleroma/web/twitter_api/controller.ex [moved from lib/pleroma/web/twitter_api/twitter_api_controller.ex with 96% similarity]
lib/pleroma/web/twitter_api/controllers/remote_follow_controller.ex
lib/pleroma/web/twitter_api/controllers/util_controller.ex
lib/pleroma/web/web_finger.ex [moved from lib/pleroma/web/web_finger/web_finger.ex with 100% similarity]
lib/pleroma/web/web_finger/web_finger_controller.ex
lib/pleroma/web/xml.ex [moved from lib/pleroma/web/xml/xml.ex with 100% similarity]
lib/pleroma/xml_builder.ex [moved from lib/xml_builder.ex with 100% similarity]
priv/repo/migrations/20200919182636_remoteip_plug_rename.exs [new file with mode: 0644]
test/fixtures/modules/runtime_module.ex
test/mix/pleroma_test.exs [moved from test/tasks/pleroma_test.exs with 100% similarity]
test/mix/tasks/pleroma/app_test.exs [moved from test/tasks/app_test.exs with 100% similarity]
test/mix/tasks/pleroma/config_test.exs [moved from test/tasks/config_test.exs with 100% similarity]
test/mix/tasks/pleroma/count_statuses_test.exs [moved from test/tasks/count_statuses_test.exs with 100% similarity]
test/mix/tasks/pleroma/database_test.exs [moved from test/tasks/database_test.exs with 100% similarity]
test/mix/tasks/pleroma/digest_test.exs [moved from test/tasks/digest_test.exs with 100% similarity]
test/mix/tasks/pleroma/ecto/migrate_test.exs [moved from test/tasks/ecto/migrate_test.exs with 100% similarity]
test/mix/tasks/pleroma/ecto/rollback_test.exs [moved from test/tasks/ecto/rollback_test.exs with 100% similarity]
test/mix/tasks/pleroma/ecto_test.exs [moved from test/tasks/ecto/ecto_test.exs with 100% similarity]
test/mix/tasks/pleroma/email_test.exs [moved from test/tasks/email_test.exs with 100% similarity]
test/mix/tasks/pleroma/emoji_test.exs [moved from test/tasks/emoji_test.exs with 100% similarity]
test/mix/tasks/pleroma/frontend_test.exs [moved from test/tasks/frontend_test.exs with 98% similarity]
test/mix/tasks/pleroma/instance_test.exs [moved from test/tasks/instance_test.exs with 98% similarity]
test/mix/tasks/pleroma/refresh_counter_cache_test.exs [moved from test/tasks/refresh_counter_cache_test.exs with 100% similarity]
test/mix/tasks/pleroma/relay_test.exs [moved from test/tasks/relay_test.exs with 100% similarity]
test/mix/tasks/pleroma/robots_txt_test.exs [moved from test/tasks/robots_txt_test.exs with 100% similarity]
test/mix/tasks/pleroma/uploads_test.exs [moved from test/tasks/uploads_test.exs with 100% similarity]
test/mix/tasks/pleroma/user_test.exs [moved from test/tasks/user_test.exs with 100% similarity]
test/pleroma/activity/ir/topics_test.exs [moved from test/activity/ir/topics_test.exs with 100% similarity]
test/pleroma/activity_test.exs [moved from test/activity_test.exs with 100% similarity]
test/pleroma/application_requirements_test.exs [moved from test/application_requirements_test.exs with 81% similarity]
test/pleroma/bbs/handler_test.exs [moved from test/bbs/handler_test.exs with 100% similarity]
test/pleroma/bookmark_test.exs [moved from test/bookmark_test.exs with 100% similarity]
test/pleroma/captcha_test.exs [moved from test/captcha_test.exs with 100% similarity]
test/pleroma/chat/message_reference_test.exs [moved from test/chat/message_reference_test.exs with 100% similarity]
test/pleroma/chat_test.exs [moved from test/chat_test.exs with 100% similarity]
test/pleroma/config/deprecation_warnings_test.exs [moved from test/config/deprecation_warnings_test.exs with 98% similarity]
test/pleroma/config/holder_test.exs [moved from test/config/holder_test.exs with 100% similarity]
test/pleroma/config/loader_test.exs [moved from test/config/loader_test.exs with 100% similarity]
test/pleroma/config/transfer_task_test.exs [moved from test/config/transfer_task_test.exs with 100% similarity]
test/pleroma/config_db_test.exs [moved from test/config/config_db_test.exs with 100% similarity]
test/pleroma/config_test.exs [moved from test/config_test.exs with 100% similarity]
test/pleroma/conversation/participation_test.exs [moved from test/conversation/participation_test.exs with 100% similarity]
test/pleroma/conversation_test.exs [moved from test/conversation_test.exs with 100% similarity]
test/pleroma/docs/generator_test.exs [moved from test/docs/generator_test.exs with 100% similarity]
test/pleroma/earmark_renderer_test.exs [moved from test/earmark_renderer_test.exs with 100% similarity]
test/pleroma/ecto_type/activity_pub/object_validators/date_time_test.exs [moved from test/web/activity_pub/object_validators/types/date_time_test.exs with 92% similarity]
test/pleroma/ecto_type/activity_pub/object_validators/object_id_test.exs [moved from test/web/activity_pub/object_validators/types/object_id_test.exs with 92% similarity]
test/pleroma/ecto_type/activity_pub/object_validators/recipients_test.exs [moved from test/web/activity_pub/object_validators/types/recipients_test.exs with 93% similarity]
test/pleroma/ecto_type/activity_pub/object_validators/safe_text_test.exs [moved from test/web/activity_pub/object_validators/types/safe_text_test.exs with 92% similarity]
test/pleroma/emails/admin_email_test.exs [moved from test/emails/admin_email_test.exs with 100% similarity]
test/pleroma/emails/mailer_test.exs [moved from test/emails/mailer_test.exs with 100% similarity]
test/pleroma/emails/user_email_test.exs [moved from test/emails/user_email_test.exs with 100% similarity]
test/pleroma/emoji/formatter_test.exs [moved from test/emoji/formatter_test.exs with 100% similarity]
test/pleroma/emoji/loader_test.exs [moved from test/emoji/loader_test.exs with 100% similarity]
test/pleroma/emoji/pack_test.exs [moved from test/emoji/pack_test.exs with 100% similarity]
test/pleroma/emoji_test.exs [moved from test/emoji_test.exs with 100% similarity]
test/pleroma/filter_test.exs [moved from test/filter_test.exs with 100% similarity]
test/pleroma/following_relationship_test.exs [moved from test/following_relationship_test.exs with 100% similarity]
test/pleroma/formatter_test.exs [moved from test/formatter_test.exs with 100% similarity]
test/pleroma/gun/connection_pool_test.exs [moved from test/gun/conneciton_pool_test.exs with 100% similarity]
test/pleroma/healthcheck_test.exs [moved from test/healthcheck_test.exs with 100% similarity]
test/pleroma/html_test.exs [moved from test/html_test.exs with 100% similarity]
test/pleroma/http/adapter_helper/gun_test.exs [moved from test/http/adapter_helper/gun_test.exs with 100% similarity]
test/pleroma/http/adapter_helper/hackney_test.exs [moved from test/http/adapter_helper/hackney_test.exs with 100% similarity]
test/pleroma/http/adapter_helper_test.exs [moved from test/http/adapter_helper_test.exs with 100% similarity]
test/pleroma/http/ex_aws_test.exs [moved from test/http/ex_aws_test.exs with 100% similarity]
test/pleroma/http/request_builder_test.exs [moved from test/http/request_builder_test.exs with 100% similarity]
test/pleroma/http/tzdata_test.exs [moved from test/http/tzdata_test.exs with 100% similarity]
test/pleroma/http_test.exs [moved from test/http_test.exs with 100% similarity]
test/pleroma/instances/instance_test.exs [moved from test/web/instances/instance_test.exs with 100% similarity]
test/pleroma/instances_test.exs [moved from test/web/instances/instances_test.exs with 100% similarity]
test/pleroma/integration/federation_test.exs [moved from test/federation/federation_test.exs with 100% similarity]
test/pleroma/integration/mastodon_websocket_test.exs [moved from test/integration/mastodon_websocket_test.exs with 100% similarity]
test/pleroma/job_queue_monitor_test.exs [moved from test/job_queue_monitor_test.exs with 100% similarity]
test/pleroma/keys_test.exs [moved from test/keys_test.exs with 100% similarity]
test/pleroma/list_test.exs [moved from test/list_test.exs with 100% similarity]
test/pleroma/marker_test.exs [moved from test/marker_test.exs with 100% similarity]
test/pleroma/mfa/backup_codes_test.exs [moved from test/mfa/backup_codes_test.exs with 100% similarity]
test/pleroma/mfa/totp_test.exs [moved from test/mfa/totp_test.exs with 100% similarity]
test/pleroma/mfa_test.exs [moved from test/mfa_test.exs with 100% similarity]
test/pleroma/migration_helper/notification_backfill_test.exs [moved from test/migration_helper/notification_backfill_test.exs with 100% similarity]
test/pleroma/moderation_log_test.exs [moved from test/moderation_log_test.exs with 100% similarity]
test/pleroma/notification_test.exs [moved from test/notification_test.exs with 100% similarity]
test/pleroma/object/containment_test.exs [moved from test/object/containment_test.exs with 100% similarity]
test/pleroma/object/fetcher_test.exs [moved from test/object/fetcher_test.exs with 100% similarity]
test/pleroma/object_test.exs [moved from test/object_test.exs with 100% similarity]
test/pleroma/otp_version_test.exs [moved from test/otp_version_test.exs with 100% similarity]
test/pleroma/pagination_test.exs [moved from test/pagination_test.exs with 100% similarity]
test/pleroma/registration_test.exs [moved from test/registration_test.exs with 100% similarity]
test/pleroma/repo/migrations/autolinker_to_linkify_test.exs [moved from test/migrations/20200716195806_autolinker_to_linkify_test.exs with 100% similarity]
test/pleroma/repo/migrations/fix_legacy_tags_test.exs [moved from test/migrations/20200802170532_fix_legacy_tags_test.exs with 100% similarity]
test/pleroma/repo/migrations/fix_malformed_formatter_config_test.exs [moved from test/migrations/20200722185515_fix_malformed_formatter_config_test.exs with 100% similarity]
test/pleroma/repo/migrations/move_welcome_settings_test.exs [moved from test/migrations/20200724133313_move_welcome_settings_test.exs with 100% similarity]
test/pleroma/repo_test.exs [moved from test/repo_test.exs with 100% similarity]
test/pleroma/report_note_test.exs [moved from test/report_note_test.exs with 100% similarity]
test/pleroma/reverse_proxy_test.exs [moved from test/reverse_proxy/reverse_proxy_test.exs with 100% similarity]
test/pleroma/runtime_test.exs [moved from test/runtime_test.exs with 69% similarity]
test/pleroma/safe_jsonb_set_test.exs [moved from test/safe_jsonb_set_test.exs with 100% similarity]
test/pleroma/scheduled_activity_test.exs [moved from test/scheduled_activity_test.exs with 100% similarity]
test/pleroma/signature_test.exs [moved from test/signature_test.exs with 100% similarity]
test/pleroma/stats_test.exs [moved from test/stats_test.exs with 100% similarity]
test/pleroma/upload/filter/anonymize_filename_test.exs [moved from test/upload/filter/anonymize_filename_test.exs with 100% similarity]
test/pleroma/upload/filter/dedupe_test.exs [moved from test/upload/filter/dedupe_test.exs with 100% similarity]
test/pleroma/upload/filter/exiftool_test.exs [moved from test/upload/filter/exiftool_test.exs with 100% similarity]
test/pleroma/upload/filter/mogrifun_test.exs [moved from test/upload/filter/mogrifun_test.exs with 100% similarity]
test/pleroma/upload/filter/mogrify_test.exs [moved from test/upload/filter/mogrify_test.exs with 100% similarity]
test/pleroma/upload/filter_test.exs [moved from test/upload/filter_test.exs with 100% similarity]
test/pleroma/upload_test.exs [moved from test/upload_test.exs with 100% similarity]
test/pleroma/uploaders/local_test.exs [moved from test/uploaders/local_test.exs with 100% similarity]
test/pleroma/uploaders/s3_test.exs [moved from test/uploaders/s3_test.exs with 100% similarity]
test/pleroma/user/import_test.exs [moved from test/user/import_test.exs with 100% similarity]
test/pleroma/user/notification_setting_test.exs [moved from test/user/notification_setting_test.exs with 100% similarity]
test/pleroma/user/query_test.exs [moved from test/user/query_test.exs with 100% similarity]
test/pleroma/user/welcome_chat_message_test.exs [moved from test/user/welcome_chat_massage_test.exs with 100% similarity]
test/pleroma/user/welcome_email_test.exs [moved from test/user/welcome_email_test.exs with 100% similarity]
test/pleroma/user/welcome_message_test.exs [moved from test/user/welcome_message_test.exs with 100% similarity]
test/pleroma/user_invite_token_test.exs [moved from test/user_invite_token_test.exs with 100% similarity]
test/pleroma/user_relationship_test.exs [moved from test/user_relationship_test.exs with 100% similarity]
test/pleroma/user_search_test.exs [moved from test/user_search_test.exs with 100% similarity]
test/pleroma/user_test.exs [moved from test/user_test.exs with 100% similarity]
test/pleroma/utils_test.exs [moved from test/utils_test.exs with 100% similarity]
test/pleroma/web/activity_pub/activity_pub_controller_test.exs [moved from test/web/activity_pub/activity_pub_controller_test.exs with 100% similarity]
test/pleroma/web/activity_pub/activity_pub_test.exs [moved from test/web/activity_pub/activity_pub_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/activity_expiration_policy_test.exs [moved from test/web/activity_pub/mrf/activity_expiration_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs [moved from test/web/activity_pub/mrf/anti_followbot_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/anti_link_spam_policy_test.exs [moved from test/web/activity_pub/mrf/anti_link_spam_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/ensure_re_prepended_test.exs [moved from test/web/activity_pub/mrf/ensure_re_prepended_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/force_bot_unlisted_policy_test.exs [moved from test/web/activity_pub/mrf/force_bot_unlisted_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/hellthread_policy_test.exs [moved from test/web/activity_pub/mrf/hellthread_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/keyword_policy_test.exs [moved from test/web/activity_pub/mrf/keyword_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/media_proxy_warming_policy_test.exs [moved from test/web/activity_pub/mrf/mediaproxy_warming_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/mention_policy_test.exs [moved from test/web/activity_pub/mrf/mention_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/no_placeholder_text_policy_test.exs [moved from test/web/activity_pub/mrf/no_placeholder_text_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/normalize_markup_test.exs [moved from test/web/activity_pub/mrf/normalize_markup_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/object_age_policy_test.exs [moved from test/web/activity_pub/mrf/object_age_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/reject_non_public_test.exs [moved from test/web/activity_pub/mrf/reject_non_public_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/simple_policy_test.exs [moved from test/web/activity_pub/mrf/simple_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/steal_emoji_policy_test.exs [moved from test/web/activity_pub/mrf/steal_emoji_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/subchain_policy_test.exs [moved from test/web/activity_pub/mrf/subchain_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/tag_policy_test.exs [moved from test/web/activity_pub/mrf/tag_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/user_allow_list_policy_test.exs [moved from test/web/activity_pub/mrf/user_allowlist_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf/vocabulary_policy_test.exs [moved from test/web/activity_pub/mrf/vocabulary_policy_test.exs with 100% similarity]
test/pleroma/web/activity_pub/mrf_test.exs [moved from test/web/activity_pub/mrf/mrf_test.exs with 100% similarity]
test/pleroma/web/activity_pub/object_validators/accept_validation_test.exs [moved from test/web/activity_pub/object_validators/accept_validation_test.exs with 100% similarity]
test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs [moved from test/web/activity_pub/object_validators/announce_validation_test.exs with 97% similarity]
test/pleroma/web/activity_pub/object_validators/article_note_validator_test.exs [moved from test/web/activity_pub/object_validators/article_note_validator_test.exs with 100% similarity]
test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs [moved from test/web/activity_pub/object_validators/attachment_validator_test.exs with 100% similarity]
test/pleroma/web/activity_pub/object_validators/block_validation_test.exs [moved from test/web/activity_pub/object_validators/block_validation_test.exs with 100% similarity]
test/pleroma/web/activity_pub/object_validators/chat_validation_test.exs [moved from test/web/activity_pub/object_validators/chat_validation_test.exs with 100% similarity]
test/pleroma/web/activity_pub/object_validators/delete_validation_test.exs [moved from test/web/activity_pub/object_validators/delete_validation_test.exs with 100% similarity]
test/pleroma/web/activity_pub/object_validators/emoji_react_handling_test.exs [moved from test/web/activity_pub/object_validators/emoji_react_validation_test.exs with 100% similarity]
test/pleroma/web/activity_pub/object_validators/follow_validation_test.exs [moved from test/web/activity_pub/object_validators/follow_validation_test.exs with 100% similarity]
test/pleroma/web/activity_pub/object_validators/like_validation_test.exs [moved from test/web/activity_pub/object_validators/like_validation_test.exs with 100% similarity]
test/pleroma/web/activity_pub/object_validators/reject_validation_test.exs [moved from test/web/activity_pub/object_validators/reject_validation_test.exs with 100% similarity]
test/pleroma/web/activity_pub/object_validators/undo_handling_test.exs [moved from test/web/activity_pub/object_validators/undo_validation_test.exs with 100% similarity]
test/pleroma/web/activity_pub/object_validators/update_handling_test.exs [moved from test/web/activity_pub/object_validators/update_validation_test.exs with 100% similarity]
test/pleroma/web/activity_pub/pipeline_test.exs [moved from test/web/activity_pub/pipeline_test.exs with 100% similarity]
test/pleroma/web/activity_pub/publisher_test.exs [moved from test/web/activity_pub/publisher_test.exs with 100% similarity]
test/pleroma/web/activity_pub/relay_test.exs [moved from test/web/activity_pub/relay_test.exs with 100% similarity]
test/pleroma/web/activity_pub/side_effects_test.exs [moved from test/web/activity_pub/side_effects_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/accept_handling_test.exs [moved from test/web/activity_pub/transmogrifier/accept_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/announce_handling_test.exs [moved from test/web/activity_pub/transmogrifier/announce_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/answer_handling_test.exs [moved from test/web/activity_pub/transmogrifier/answer_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/article_handling_test.exs [moved from test/web/activity_pub/transmogrifier/article_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/audio_handling_test.exs [moved from test/web/activity_pub/transmogrifier/audio_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/block_handling_test.exs [moved from test/web/activity_pub/transmogrifier/block_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/chat_message_test.exs [moved from test/web/activity_pub/transmogrifier/chat_message_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/delete_handling_test.exs [moved from test/web/activity_pub/transmogrifier/delete_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs [moved from test/web/activity_pub/transmogrifier/emoji_react_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/event_handling_test.exs [moved from test/web/activity_pub/transmogrifier/event_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/follow_handling_test.exs [moved from test/web/activity_pub/transmogrifier/follow_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/like_handling_test.exs [moved from test/web/activity_pub/transmogrifier/like_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/question_handling_test.exs [moved from test/web/activity_pub/transmogrifier/question_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/reject_handling_test.exs [moved from test/web/activity_pub/transmogrifier/reject_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/undo_handling_test.exs [moved from test/web/activity_pub/transmogrifier/undo_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/user_update_handling_test.exs [moved from test/web/activity_pub/transmogrifier/user_update_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier/video_handling_test.exs [moved from test/web/activity_pub/transmogrifier/video_handling_test.exs with 100% similarity]
test/pleroma/web/activity_pub/transmogrifier_test.exs [moved from test/web/activity_pub/transmogrifier_test.exs with 100% similarity]
test/pleroma/web/activity_pub/utils_test.exs [moved from test/web/activity_pub/utils_test.exs with 100% similarity]
test/pleroma/web/activity_pub/views/object_view_test.exs [moved from test/web/activity_pub/views/object_view_test.exs with 100% similarity]
test/pleroma/web/activity_pub/views/user_view_test.exs [moved from test/web/activity_pub/views/user_view_test.exs with 100% similarity]
test/pleroma/web/activity_pub/visibility_test.exs [moved from test/web/activity_pub/visibilty_test.exs with 100% similarity]
test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs [moved from test/web/admin_api/controllers/admin_api_controller_test.exs with 100% similarity]
test/pleroma/web/admin_api/controllers/chat_controller_test.exs [moved from test/web/admin_api/controllers/chat_controller_test.exs with 100% similarity]
test/pleroma/web/admin_api/controllers/config_controller_test.exs [moved from test/web/admin_api/controllers/config_controller_test.exs with 100% similarity]
test/pleroma/web/admin_api/controllers/instance_document_controller_test.exs [moved from test/web/admin_api/controllers/instance_document_controller_test.exs with 100% similarity]
test/pleroma/web/admin_api/controllers/invite_controller_test.exs [moved from test/web/admin_api/controllers/invite_controller_test.exs with 100% similarity]
test/pleroma/web/admin_api/controllers/media_proxy_cache_controller_test.exs [moved from test/web/admin_api/controllers/media_proxy_cache_controller_test.exs with 100% similarity]
test/pleroma/web/admin_api/controllers/o_auth_app_controller_test.exs [moved from test/web/admin_api/controllers/oauth_app_controller_test.exs with 100% similarity]
test/pleroma/web/admin_api/controllers/relay_controller_test.exs [moved from test/web/admin_api/controllers/relay_controller_test.exs with 100% similarity]
test/pleroma/web/admin_api/controllers/report_controller_test.exs [moved from test/web/admin_api/controllers/report_controller_test.exs with 100% similarity]
test/pleroma/web/admin_api/controllers/status_controller_test.exs [moved from test/web/admin_api/controllers/status_controller_test.exs with 100% similarity]
test/pleroma/web/admin_api/search_test.exs [moved from test/web/admin_api/search_test.exs with 100% similarity]
test/pleroma/web/admin_api/views/report_view_test.exs [moved from test/web/admin_api/views/report_view_test.exs with 100% similarity]
test/pleroma/web/api_spec/schema_examples_test.exs [moved from test/web/api_spec/schema_examples_test.exs with 100% similarity]
test/pleroma/web/auth/auth_controller_test.exs [moved from test/web/auth/auth_test_controller_test.exs with 99% similarity]
test/pleroma/web/auth/authenticator_test.exs [moved from test/web/auth/authenticator_test.exs with 100% similarity]
test/pleroma/web/auth/basic_auth_test.exs [moved from test/web/auth/basic_auth_test.exs with 100% similarity]
test/pleroma/web/auth/pleroma_authenticator_test.exs [moved from test/web/auth/pleroma_authenticator_test.exs with 100% similarity]
test/pleroma/web/auth/totp_authenticator_test.exs [moved from test/web/auth/totp_authenticator_test.exs with 100% similarity]
test/pleroma/web/chat_channel_test.exs [moved from test/web/chat_channel_test.exs with 100% similarity]
test/pleroma/web/common_api/utils_test.exs [moved from test/web/common_api/common_api_utils_test.exs with 100% similarity]
test/pleroma/web/common_api_test.exs [moved from test/web/common_api/common_api_test.exs with 100% similarity]
test/pleroma/web/fallback_test.exs [moved from test/web/fallback_test.exs with 100% similarity]
test/pleroma/web/fed_sockets/fed_registry_test.exs [moved from test/web/fed_sockets/fed_registry_test.exs with 100% similarity]
test/pleroma/web/fed_sockets/fetch_registry_test.exs [moved from test/web/fed_sockets/fetch_registry_test.exs with 100% similarity]
test/pleroma/web/fed_sockets/socket_info_test.exs [moved from test/web/fed_sockets/socket_info_test.exs with 100% similarity]
test/pleroma/web/federator_test.exs [moved from test/web/federator_test.exs with 100% similarity]
test/pleroma/web/feed/tag_controller_test.exs [moved from test/web/feed/tag_controller_test.exs with 100% similarity]
test/pleroma/web/feed/user_controller_test.exs [moved from test/web/feed/user_controller_test.exs with 98% similarity]
test/pleroma/web/mastodon_api/controllers/account_controller_test.exs [moved from test/web/mastodon_api/controllers/account_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/app_controller_test.exs [moved from test/web/mastodon_api/controllers/app_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/auth_controller_test.exs [moved from test/web/mastodon_api/controllers/auth_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/conversation_controller_test.exs [moved from test/web/mastodon_api/controllers/conversation_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/custom_emoji_controller_test.exs [moved from test/web/mastodon_api/controllers/custom_emoji_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/domain_block_controller_test.exs [moved from test/web/mastodon_api/controllers/domain_block_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs [moved from test/web/mastodon_api/controllers/filter_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/follow_request_controller_test.exs [moved from test/web/mastodon_api/controllers/follow_request_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs [moved from test/web/mastodon_api/controllers/instance_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/list_controller_test.exs [moved from test/web/mastodon_api/controllers/list_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/marker_controller_test.exs [moved from test/web/mastodon_api/controllers/marker_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/media_controller_test.exs [moved from test/web/mastodon_api/controllers/media_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/notification_controller_test.exs [moved from test/web/mastodon_api/controllers/notification_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/poll_controller_test.exs [moved from test/web/mastodon_api/controllers/poll_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/report_controller_test.exs [moved from test/web/mastodon_api/controllers/report_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/scheduled_activity_controller_test.exs [moved from test/web/mastodon_api/controllers/scheduled_activity_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/search_controller_test.exs [moved from test/web/mastodon_api/controllers/search_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/status_controller_test.exs [moved from test/web/mastodon_api/controllers/status_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/subscription_controller_test.exs [moved from test/web/mastodon_api/controllers/subscription_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs [moved from test/web/mastodon_api/controllers/suggestion_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/controllers/timeline_controller_test.exs [moved from test/web/mastodon_api/controllers/timeline_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/masto_fe_controller_test.exs [moved from test/web/masto_fe_controller_test.exs with 97% similarity]
test/pleroma/web/mastodon_api/mastodon_api_controller_test.exs [moved from test/web/mastodon_api/mastodon_api_controller_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/mastodon_api_test.exs [moved from test/web/mastodon_api/mastodon_api_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/update_credentials_test.exs [moved from test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs with 99% similarity]
test/pleroma/web/mastodon_api/views/account_view_test.exs [moved from test/web/mastodon_api/views/account_view_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/views/conversation_view_test.exs [moved from test/web/mastodon_api/views/conversation_view_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/views/list_view_test.exs [moved from test/web/mastodon_api/views/list_view_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/views/marker_view_test.exs [moved from test/web/mastodon_api/views/marker_view_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/views/notification_view_test.exs [moved from test/web/mastodon_api/views/notification_view_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/views/poll_view_test.exs [moved from test/web/mastodon_api/views/poll_view_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs [moved from test/web/mastodon_api/views/scheduled_activity_view_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/views/status_view_test.exs [moved from test/web/mastodon_api/views/status_view_test.exs with 100% similarity]
test/pleroma/web/mastodon_api/views/subscription_view_test.exs [moved from test/web/mastodon_api/views/subscription_view_test.exs with 100% similarity]
test/pleroma/web/media_proxy/invalidation/http_test.exs [moved from test/web/media_proxy/invalidations/http_test.exs with 100% similarity]
test/pleroma/web/media_proxy/invalidation/script_test.exs [moved from test/web/media_proxy/invalidations/script_test.exs with 100% similarity]
test/pleroma/web/media_proxy/invalidation_test.exs [moved from test/web/media_proxy/invalidation_test.exs with 100% similarity]
test/pleroma/web/media_proxy/media_proxy_controller_test.exs [moved from test/web/media_proxy/media_proxy_controller_test.exs with 100% similarity]
test/pleroma/web/media_proxy_test.exs [moved from test/web/media_proxy/media_proxy_test.exs with 100% similarity]
test/pleroma/web/metadata/player_view_test.exs [moved from test/web/metadata/player_view_test.exs with 100% similarity]
test/pleroma/web/metadata/providers/feed_test.exs [moved from test/web/metadata/feed_test.exs with 100% similarity]
test/pleroma/web/metadata/providers/open_graph_test.exs [moved from test/web/metadata/opengraph_test.exs with 100% similarity]
test/pleroma/web/metadata/providers/rel_me_test.exs [moved from test/web/metadata/rel_me_test.exs with 100% similarity]
test/pleroma/web/metadata/providers/restrict_indexing_test.exs [moved from test/web/metadata/restrict_indexing_test.exs with 100% similarity]
test/pleroma/web/metadata/providers/twitter_card_test.exs [moved from test/web/metadata/twitter_card_test.exs with 100% similarity]
test/pleroma/web/metadata/utils_test.exs [moved from test/web/metadata/utils_test.exs with 100% similarity]
test/pleroma/web/metadata_test.exs [moved from test/web/metadata/metadata_test.exs with 100% similarity]
test/pleroma/web/mongoose_im_controller_test.exs [moved from test/web/mongooseim/mongoose_im_controller_test.exs with 97% similarity]
test/pleroma/web/node_info_test.exs [moved from test/web/node_info_test.exs with 100% similarity]
test/pleroma/web/o_auth/app_test.exs [moved from test/web/oauth/app_test.exs with 100% similarity]
test/pleroma/web/o_auth/authorization_test.exs [moved from test/web/oauth/authorization_test.exs with 100% similarity]
test/pleroma/web/o_auth/ldap_authorization_test.exs [moved from test/web/oauth/ldap_authorization_test.exs with 100% similarity]
test/pleroma/web/o_auth/mfa_controller_test.exs [moved from test/web/oauth/mfa_controller_test.exs with 100% similarity]
test/pleroma/web/o_auth/o_auth_controller_test.exs [moved from test/web/oauth/oauth_controller_test.exs with 100% similarity]
test/pleroma/web/o_auth/token/utils_test.exs [moved from test/web/oauth/token/utils_test.exs with 100% similarity]
test/pleroma/web/o_auth/token_test.exs [moved from test/web/oauth/token_test.exs with 100% similarity]
test/pleroma/web/o_status/o_status_controller_test.exs [moved from test/web/ostatus/ostatus_controller_test.exs with 100% similarity]
test/pleroma/web/pleroma_api/controllers/account_controller_test.exs [moved from test/web/pleroma_api/controllers/account_controller_test.exs with 100% similarity]
test/pleroma/web/pleroma_api/controllers/chat_controller_test.exs [moved from test/web/pleroma_api/controllers/chat_controller_test.exs with 100% similarity]
test/pleroma/web/pleroma_api/controllers/conversation_controller_test.exs [moved from test/web/pleroma_api/controllers/conversation_controller_test.exs with 100% similarity]
test/pleroma/web/pleroma_api/controllers/emoji_file_controller_test.exs [moved from test/web/pleroma_api/controllers/emoji_file_controller_test.exs with 100% similarity]
test/pleroma/web/pleroma_api/controllers/emoji_pack_controller_test.exs [moved from test/web/pleroma_api/controllers/emoji_pack_controller_test.exs with 100% similarity]
test/pleroma/web/pleroma_api/controllers/emoji_reaction_controller_test.exs [moved from test/web/pleroma_api/controllers/emoji_reaction_controller_test.exs with 100% similarity]
test/pleroma/web/pleroma_api/controllers/mascot_controller_test.exs [moved from test/web/pleroma_api/controllers/mascot_controller_test.exs with 100% similarity]
test/pleroma/web/pleroma_api/controllers/notification_controller_test.exs [moved from test/web/pleroma_api/controllers/notification_controller_test.exs with 100% similarity]
test/pleroma/web/pleroma_api/controllers/scrobble_controller_test.exs [moved from test/web/pleroma_api/controllers/scrobble_controller_test.exs with 100% similarity]
test/pleroma/web/pleroma_api/controllers/two_factor_authentication_controller_test.exs [moved from test/web/pleroma_api/controllers/two_factor_authentication_controller_test.exs with 100% similarity]
test/pleroma/web/pleroma_api/controllers/user_import_controller_test.exs [moved from test/web/pleroma_api/controllers/user_import_controller_test.exs with 100% similarity]
test/pleroma/web/pleroma_api/views/chat_message_reference_view_test.exs [moved from test/web/pleroma_api/views/chat/message_reference_view_test.exs with 97% similarity]
test/pleroma/web/pleroma_api/views/chat_view_test.exs [moved from test/web/pleroma_api/views/chat_view_test.exs with 100% similarity]
test/pleroma/web/pleroma_api/views/scrobble_view_test.exs [moved from test/web/pleroma_api/views/scrobble_view_test.exs with 91% similarity]
test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs [moved from test/plugs/admin_secret_authentication_plug_test.exs with 88% similarity]
test/pleroma/web/plugs/authentication_plug_test.exs [moved from test/plugs/authentication_plug_test.exs with 93% similarity]
test/pleroma/web/plugs/basic_auth_decoder_plug_test.exs [moved from test/plugs/basic_auth_decoder_plug_test.exs with 89% similarity]
test/pleroma/web/plugs/cache_control_test.exs [moved from test/plugs/cache_control_test.exs with 92% similarity]
test/pleroma/web/plugs/cache_test.exs [moved from test/plugs/cache_test.exs with 98% similarity]
test/pleroma/web/plugs/ensure_authenticated_plug_test.exs [moved from test/plugs/ensure_authenticated_plug_test.exs with 96% similarity]
test/pleroma/web/plugs/ensure_public_or_authenticated_plug_test.exs [moved from test/plugs/ensure_public_or_authenticated_plug_test.exs with 89% similarity]
test/pleroma/web/plugs/ensure_user_key_plug_test.exs [moved from test/plugs/ensure_user_key_plug_test.exs with 86% similarity]
test/pleroma/web/plugs/federating_plug_test.exs [moved from test/web/plugs/federating_plug_test.exs with 80% similarity]
test/pleroma/web/plugs/frontend_static_plug_test.exs [moved from test/plugs/frontend_static_test.exs with 92% similarity]
test/pleroma/web/plugs/http_security_plug_test.exs [moved from test/plugs/http_security_plug_test.exs with 100% similarity]
test/pleroma/web/plugs/http_signature_plug_test.exs [moved from test/plugs/http_signature_plug_test.exs with 100% similarity]
test/pleroma/web/plugs/idempotency_plug_test.exs [moved from test/plugs/idempotency_plug_test.exs with 97% similarity]
test/pleroma/web/plugs/instance_static_test.exs [moved from test/plugs/instance_static_test.exs with 97% similarity]
test/pleroma/web/plugs/legacy_authentication_plug_test.exs [moved from test/plugs/legacy_authentication_plug_test.exs with 90% similarity]
test/pleroma/web/plugs/mapped_signature_to_identity_plug_test.exs [moved from test/plugs/mapped_identity_to_signature_plug_test.exs with 100% similarity]
test/pleroma/web/plugs/o_auth_plug_test.exs [moved from test/plugs/oauth_plug_test.exs with 96% similarity]
test/pleroma/web/plugs/o_auth_scopes_plug_test.exs [moved from test/plugs/oauth_scopes_plug_test.exs with 98% similarity]
test/pleroma/web/plugs/plug_helper_test.exs [moved from test/web/plugs/plug_test.exs with 94% similarity]
test/pleroma/web/plugs/rate_limiter_test.exs [moved from test/plugs/rate_limiter_test.exs with 98% similarity]
test/pleroma/web/plugs/remote_ip_test.exs [moved from test/plugs/remote_ip_test.exs with 97% similarity]
test/pleroma/web/plugs/session_authentication_plug_test.exs [moved from test/plugs/session_authentication_plug_test.exs with 92% similarity]
test/pleroma/web/plugs/set_format_plug_test.exs [moved from test/plugs/set_format_plug_test.exs with 89% similarity]
test/pleroma/web/plugs/set_locale_plug_test.exs [moved from test/plugs/set_locale_plug_test.exs with 92% similarity]
test/pleroma/web/plugs/set_user_session_id_plug_test.exs [moved from test/plugs/set_user_session_id_plug_test.exs with 90% similarity]
test/pleroma/web/plugs/uploaded_media_plug_test.exs [moved from test/plugs/uploaded_media_plug_test.exs with 95% similarity]
test/pleroma/web/plugs/user_enabled_plug_test.exs [moved from test/plugs/user_enabled_plug_test.exs with 93% similarity]
test/pleroma/web/plugs/user_fetcher_plug_test.exs [moved from test/plugs/user_fetcher_plug_test.exs with 89% similarity]
test/pleroma/web/plugs/user_is_admin_plug_test.exs [moved from test/plugs/user_is_admin_plug_test.exs with 89% similarity]
test/pleroma/web/preload/providers/instance_test.exs [moved from test/web/preload/instance_test.exs with 100% similarity]
test/pleroma/web/preload/providers/timeline_test.exs [moved from test/web/preload/timeline_test.exs with 100% similarity]
test/pleroma/web/preload/providers/user_test.exs [moved from test/web/preload/user_test.exs with 100% similarity]
test/pleroma/web/push/impl_test.exs [moved from test/web/push/impl_test.exs with 100% similarity]
test/pleroma/web/rel_me_test.exs [moved from test/web/rel_me_test.exs with 100% similarity]
test/pleroma/web/rich_media/helpers_test.exs [moved from test/web/rich_media/helpers_test.exs with 99% similarity]
test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs [moved from test/web/rich_media/aws_signed_url_test.exs with 97% similarity]
test/pleroma/web/rich_media/parser_test.exs [moved from test/web/rich_media/parser_test.exs with 100% similarity]
test/pleroma/web/rich_media/parsers/twitter_card_test.exs [moved from test/web/rich_media/parsers/twitter_card_test.exs with 100% similarity]
test/pleroma/web/static_fe/static_fe_controller_test.exs [moved from test/web/static_fe/static_fe_controller_test.exs with 100% similarity]
test/pleroma/web/streamer_test.exs [moved from test/web/streamer/streamer_test.exs with 100% similarity]
test/pleroma/web/twitter_api/controller_test.exs [moved from test/web/twitter_api/twitter_api_controller_test.exs with 100% similarity]
test/pleroma/web/twitter_api/password_controller_test.exs [moved from test/web/twitter_api/password_controller_test.exs with 100% similarity]
test/pleroma/web/twitter_api/remote_follow_controller_test.exs [moved from test/web/twitter_api/remote_follow_controller_test.exs with 100% similarity]
test/pleroma/web/twitter_api/twitter_api_test.exs [moved from test/web/twitter_api/twitter_api_test.exs with 100% similarity]
test/pleroma/web/twitter_api/util_controller_test.exs [moved from test/web/twitter_api/util_controller_test.exs with 100% similarity]
test/pleroma/web/uploader_controller_test.exs [moved from test/web/uploader_controller_test.exs with 100% similarity]
test/pleroma/web/views/error_view_test.exs [moved from test/web/views/error_view_test.exs with 100% similarity]
test/pleroma/web/web_finger/web_finger_controller_test.exs [moved from test/web/web_finger/web_finger_controller_test.exs with 100% similarity]
test/pleroma/web/web_finger_test.exs [moved from test/web/web_finger/web_finger_test.exs with 100% similarity]
test/pleroma/workers/cron/digest_emails_worker_test.exs [moved from test/workers/cron/digest_emails_worker_test.exs with 100% similarity]
test/pleroma/workers/cron/new_users_digest_worker_test.exs [moved from test/workers/cron/new_users_digest_worker_test.exs with 100% similarity]
test/pleroma/workers/purge_expired_activity_test.exs [moved from test/workers/purge_expired_activity_test.exs with 100% similarity]
test/pleroma/workers/purge_expired_token_test.exs [moved from test/workers/purge_expired_token_test.exs with 100% similarity]
test/pleroma/workers/scheduled_activity_worker_test.exs [moved from test/workers/scheduled_activity_worker_test.exs with 100% similarity]
test/pleroma/xml_builder_test.exs [moved from test/xml_builder_test.exs with 100% similarity]
test/support/captcha/mock.ex [moved from test/support/captcha_mock.ex with 100% similarity]

index 46d45d015716267a6ee5c224afe9c2db9d34681d..83e34a2b4de5b4fe3e4b0c36dc9cc6e17ee84000 100644 (file)
@@ -25,7 +25,7 @@
       #
       # If you create your own checks, you must specify the source files for
       # them here, so they can be loaded by Credo before running the analysis.
-      requires: [],
+      requires: ["./lib/credo/check/consistency/file_location.ex"],
       #
       # Credo automatically checks for updates, like e.g. Hex does.
       # You can disable this behaviour below:
@@ -71,7 +71,6 @@
         # set this value to 0 (zero).
         {Credo.Check.Design.TagTODO, exit_status: 0},
         {Credo.Check.Design.TagFIXME, exit_status: 0},
-
         {Credo.Check.Readability.FunctionNames},
         {Credo.Check.Readability.LargeNumbers},
         {Credo.Check.Readability.MaxLineLength, priority: :low, max_length: 100},
@@ -91,7 +90,6 @@
         {Credo.Check.Readability.VariableNames},
         {Credo.Check.Readability.Semicolons},
         {Credo.Check.Readability.SpaceAfterCommas},
-
         {Credo.Check.Refactor.DoubleBooleanNegation},
         {Credo.Check.Refactor.CondStatements},
         {Credo.Check.Refactor.CyclomaticComplexity},
         {Credo.Check.Refactor.Nesting},
         {Credo.Check.Refactor.PipeChainStart},
         {Credo.Check.Refactor.UnlessWithElse},
-
         {Credo.Check.Warning.BoolOperationOnSameValues},
         {Credo.Check.Warning.IExPry},
         {Credo.Check.Warning.IoInspect},
 
         # Custom checks can be created using `mix credo.gen.check`.
         #
+        {Credo.Check.Consistency.FileLocation}
       ]
     }
   ]
index d53663d360154a9c2b94c4b841ef1fad1e76cf3f..273da5bb6728faf2daf12f5bee3e66c01347d12b 100644 (file)
@@ -677,7 +677,7 @@ config :pleroma, :rate_limit,
 
 config :pleroma, Pleroma.Workers.PurgeExpiredActivity, enabled: true, min_lifetime: 600
 
-config :pleroma, Pleroma.Plugs.RemoteIp,
+config :pleroma, Pleroma.Web.Plugs.RemoteIp,
   enabled: true,
   headers: ["x-forwarded-for"],
   proxies: [],
index 3902b96323f9de47c940b1897c7433e8aeb737d0..6e83a8e094571e8699a857191532c5991d51c9a6 100644 (file)
@@ -3250,10 +3250,10 @@ config :pleroma, :config_description, [
   },
   %{
     group: :pleroma,
-    key: Pleroma.Plugs.RemoteIp,
+    key: Pleroma.Web.Plugs.RemoteIp,
     type: :group,
     description: """
-    `Pleroma.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
+    `Pleroma.Web.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
     **If your instance is not behind at least one reverse proxy, you should not enable this plug.**
     """,
     children: [
index 95f860f2f82783445444c303d4783c581a2b2cf0..7cc660e3c4c3b5011d5389aa99eb14b342f2e56d 100644 (file)
@@ -113,7 +113,7 @@ config :pleroma, Pleroma.Gun, Pleroma.GunMock
 
 config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: true
 
-config :pleroma, Pleroma.Plugs.RemoteIp, enabled: false
+config :pleroma, Pleroma.Web.Plugs.RemoteIp, enabled: false
 
 config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true
 
index 75e845adefba2db0a0c0cc054c8612b8742a6a6b..8652591ef70c5fea876f545b25f069901f65c2a5 100644 (file)
@@ -1,6 +1,7 @@
 {
   "skip_files": [
     "test/support",
-    "lib/mix/tasks/pleroma/benchmark.ex"
+    "lib/mix/tasks/pleroma/benchmark.ex",
+    "lib/credo/check/consistency/file_location.ex"
   ]
 }
\ No newline at end of file
index ea7dfec98ac20325db8044310f3d00b43c50cc6a..0b13d7e88197890c8f630dc1cfdefdeb6db1833b 100644 (file)
@@ -113,7 +113,7 @@ To add configuration to your config file, you can copy it from the base config.
     * `Pleroma.Web.ActivityPub.MRF.MentionPolicy`: Drops posts mentioning configurable users. (See [`:mrf_mention`](#mrf_mention)).
     * `Pleroma.Web.ActivityPub.MRF.VocabularyPolicy`: Restricts activities to a configured set of vocabulary. (See [`:mrf_vocabulary`](#mrf_vocabulary)).
     * `Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy`: Rejects or delists posts based on their age when received. (See [`:mrf_object_age`](#mrf_object_age)).
-    * `Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy`: Sets a default expiration on all posts made by users of the local instance. Requires `Pleroma.ActivityExpiration` to be enabled for processing the scheduled delections.
+    * `Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy`: Sets a default expiration on all posts made by users of the local instance. Requires `Pleroma.Workers.PurgeExpiredActivity` to be enabled for processing the scheduled delections.
     * `Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicy`: Makes all bot posts to disappear from public timelines.
 * `transparency`: Make the content of your Message Rewrite Facility settings public (via nodeinfo).
 * `transparency_exclusions`: Exclude specific instance names from MRF transparency.  The use of the exclusions feature will be disclosed in nodeinfo as a boolean value.
@@ -219,12 +219,6 @@ config :pleroma, :mrf_user_allowlist, %{
 * `total_user_limit`: the number of scheduled activities a user is allowed to create in total (Default: `300`)
 * `enabled`: whether scheduled activities are sent to the job queue to be executed
 
-## Pleroma.ActivityExpiration
-
-Enables the worker which processes posts scheduled for deletion. Pinned posts are exempt from expiration.
-
-* `enabled`: whether expired activities will be sent to the job queue to be deleted
-
 ## FedSockets
 FedSockets is an experimental feature allowing for Pleroma backends to federate using a persistant websocket connection as opposed to making each federation a seperate http connection. This feature is currently off by default. It is configurable throught he following options.
 
@@ -416,12 +410,12 @@ This will make Pleroma listen on `127.0.0.1` port `8080` and generate urls start
 * ``referrer_policy``: The referrer policy to use, either `"same-origin"` or `"no-referrer"`.
 * ``report_uri``: Adds the specified url to `report-uri` and `report-to` group in CSP header.
 
-### Pleroma.Plugs.RemoteIp
+### Pleroma.Web.Plugs.RemoteIp
 
 !!! warning
     If your instance is not behind at least one reverse proxy, you should not enable this plug.
 
-`Pleroma.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
+`Pleroma.Web.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
 
 Available options:
 
@@ -434,7 +428,7 @@ Available options:
 ### :rate_limit
 
 !!! note
-   If your instance is behind a reverse proxy ensure [`Pleroma.Plugs.RemoteIp`](#pleroma-plugs-remoteip) is enabled (it is enabled by default).
+   If your instance is behind a reverse proxy ensure [`Pleroma.Web.Plugs.RemoteIp`](#pleroma-plugs-remoteip) is enabled (it is enabled by default).
 
 A keyword list of rate limiters where a key is a limiter name and value is the limiter configuration. The basic configuration is a tuple where:
 
index 9c749c17ce7342df3fd1edcde5ec768b3303f1b3..22e0691f14e35e906bbb4a1a546874e4d0606b77 100644 (file)
@@ -6,7 +6,7 @@ This document contains notes and guidelines for Pleroma developers.
 
 * Pleroma supports hierarchical OAuth scopes, just like Mastodon but with added granularity of admin scopes. For a reference, see [Mastodon OAuth scopes](https://docs.joinmastodon.org/api/oauth-scopes/).
 
-* It is important to either define OAuth scope restrictions or explicitly mark OAuth scope check as skipped, for every controller action. To define scopes, call `plug(Pleroma.Plugs.OAuthScopesPlug, %{scopes: [...]})`. To explicitly set OAuth scopes check skipped, call `plug(:skip_plug, Pleroma.Plugs.OAuthScopesPlug <when ...>)`.
+* It is important to either define OAuth scope restrictions or explicitly mark OAuth scope check as skipped, for every controller action. To define scopes, call `plug(Pleroma.Web.Plugs.OAuthScopesPlug, %{scopes: [...]})`. To explicitly set OAuth scopes check skipped, call `plug(:skip_plug, Pleroma.Web.Plugs.OAuthScopesPlug <when ...>)`.
 
 * In controllers, `use Pleroma.Web, :controller` will result in `action/2` (see `Pleroma.Web.controller/0` for definition) be called prior to actual controller action, and it'll perform security / privacy checks before passing control to actual controller action.
 
@@ -16,7 +16,7 @@ This document contains notes and guidelines for Pleroma developers.
 
 ## [HTTP Basic Authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization)
 
-* With HTTP Basic Auth, OAuth scopes check is _not_ performed for any action (since password is provided during the auth, requester is able to obtain a token with full permissions anyways). `Pleroma.Plugs.AuthenticationPlug` and `Pleroma.Plugs.LegacyAuthenticationPlug` both call `Pleroma.Plugs.OAuthScopesPlug.skip_plug(conn)` when password is provided.
+* With HTTP Basic Auth, OAuth scopes check is _not_ performed for any action (since password is provided during the auth, requester is able to obtain a token with full permissions anyways). `Pleroma.Web.Plugs.AuthenticationPlug` and `Pleroma.Web.Plugs.LegacyAuthenticationPlug` both call `Pleroma.Web.Plugs.OAuthScopesPlug.skip_plug(conn)` when password is provided.
 
 ## Auth-related configuration, OAuth consumer mode etc.
 
diff --git a/lib/credo/check/consistency/file_location.ex b/lib/credo/check/consistency/file_location.ex
new file mode 100644 (file)
index 0000000..5009836
--- /dev/null
@@ -0,0 +1,166 @@
+# Pleroma: A lightweight social networking server
+# Originally taken from
+# https://github.com/VeryBigThings/elixir_common/blob/master/lib/vbt/credo/check/consistency/file_location.ex
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Credo.Check.Consistency.FileLocation do
+  @moduledoc false
+
+  # credo:disable-for-this-file Credo.Check.Readability.Specs
+
+  @checkdoc """
+  File location should follow the namespace hierarchy of the module it defines.
+
+  Examples:
+
+      - `lib/my_system.ex` should define the `MySystem` module
+      - `lib/my_system/accounts.ex` should define the `MySystem.Accounts` module
+  """
+  @explanation [warning: @checkdoc]
+
+  @special_namespaces [
+    "controllers",
+    "views",
+    "operations",
+    "channels"
+  ]
+
+  # `use Credo.Check` required that module attributes are already defined, so we need
+  # to place these attributes
+  # before use/alias expressions.
+  # credo:disable-for-next-line VBT.Credo.Check.Consistency.ModuleLayout
+  use Credo.Check, category: :warning, base_priority: :high
+
+  alias Credo.Code
+
+  def run(source_file, params \\ []) do
+    case verify(source_file, params) do
+      :ok ->
+        []
+
+      {:error, module, expected_file} ->
+        error(IssueMeta.for(source_file, params), module, expected_file)
+    end
+  end
+
+  defp verify(source_file, params) do
+    source_file.filename
+    |> Path.relative_to_cwd()
+    |> verify(Code.ast(source_file), params)
+  end
+
+  @doc false
+  def verify(relative_path, ast, params) do
+    if verify_path?(relative_path, params),
+      do: ast |> main_module() |> verify_module(relative_path, params),
+      else: :ok
+  end
+
+  defp verify_path?(relative_path, params) do
+    case Path.split(relative_path) do
+      ["lib" | _] -> not exclude?(relative_path, params)
+      ["test", "support" | _] -> false
+      ["test", "test_helper.exs"] -> false
+      ["test" | _] -> not exclude?(relative_path, params)
+      _ -> false
+    end
+  end
+
+  defp exclude?(relative_path, params) do
+    params
+    |> Keyword.get(:exclude, [])
+    |> Enum.any?(&String.starts_with?(relative_path, &1))
+  end
+
+  defp main_module(ast) do
+    {_ast, modules} = Macro.prewalk(ast, [], &traverse/2)
+    Enum.at(modules, -1)
+  end
+
+  defp traverse({:defmodule, _meta, args}, modules) do
+    [{:__aliases__, _, name_parts}, _module_body] = args
+    {args, [Module.concat(name_parts) | modules]}
+  end
+
+  defp traverse(ast, state), do: {ast, state}
+
+  # empty file - shouldn't really happen, but we'll let it through
+  defp verify_module(nil, _relative_path, _params), do: :ok
+
+  defp verify_module(main_module, relative_path, params) do
+    parsed_path = parsed_path(relative_path, params)
+
+    expected_file =
+      expected_file_base(parsed_path.root, main_module) <>
+        Path.extname(parsed_path.allowed)
+
+    cond do
+      expected_file == parsed_path.allowed ->
+        :ok
+
+      special_namespaces?(parsed_path.allowed) ->
+        original_path = parsed_path.allowed
+
+        namespace =
+          Enum.find(@special_namespaces, original_path, fn namespace ->
+            String.contains?(original_path, namespace)
+          end)
+
+        allowed = String.replace(original_path, "/" <> namespace, "")
+
+        if expected_file == allowed,
+          do: :ok,
+          else: {:error, main_module, expected_file}
+
+      true ->
+        {:error, main_module, expected_file}
+    end
+  end
+
+  defp special_namespaces?(path), do: String.contains?(path, @special_namespaces)
+
+  defp parsed_path(relative_path, params) do
+    parts = Path.split(relative_path)
+
+    allowed =
+      Keyword.get(params, :ignore_folder_namespace, %{})
+      |> Stream.flat_map(fn {root, folders} -> Enum.map(folders, &Path.join([root, &1])) end)
+      |> Stream.map(&Path.split/1)
+      |> Enum.find(&List.starts_with?(parts, &1))
+      |> case do
+        nil ->
+          relative_path
+
+        ignore_parts ->
+          Stream.drop(ignore_parts, -1)
+          |> Enum.concat(Stream.drop(parts, length(ignore_parts)))
+          |> Path.join()
+      end
+
+    %{root: hd(parts), allowed: allowed}
+  end
+
+  defp expected_file_base(root_folder, module) do
+    {parent_namespace, module_name} = module |> Module.split() |> Enum.split(-1)
+
+    relative_path =
+      if parent_namespace == [],
+        do: "",
+        else: parent_namespace |> Module.concat() |> Macro.underscore()
+
+    file_name = module_name |> Module.concat() |> Macro.underscore()
+
+    Path.join([root_folder, relative_path, file_name])
+  end
+
+  defp error(issue_meta, module, expected_file) do
+    format_issue(issue_meta,
+      message:
+        "Mismatch between file name and main module #{inspect(module)}. " <>
+          "Expected file path to be #{expected_file}. " <>
+          "Either move the file or rename the module.",
+      line_no: 1
+    )
+  end
+end
index e73d89350d35c1789e5720c591cbbe70bf6dc3fd..958e32db248075c33db6211e6aa4f9651b543f92 100644 (file)
@@ -52,7 +52,7 @@ defmodule Pleroma.Application do
     Pleroma.HTML.compile_scrubbers()
     Pleroma.Config.Oban.warn()
     Config.DeprecationWarnings.warn()
-    Pleroma.Plugs.HTTPSecurityPlug.warn_if_disabled()
+    Pleroma.Web.Plugs.HTTPSecurityPlug.warn_if_disabled()
     Pleroma.ApplicationRequirements.verify!()
     setup_instrumenters()
     load_custom_modules()
@@ -88,7 +88,7 @@ defmodule Pleroma.Application do
         Pleroma.Repo,
         Config.TransferTask,
         Pleroma.Emoji,
-        Pleroma.Plugs.RateLimiter.Supervisor
+        Pleroma.Web.Plugs.RateLimiter.Supervisor
       ] ++
         cachex_children() ++
         http_children(adapter, @env) ++
index 815de70020e6cf519fe9c08b06c8557a3e74d68f..83ebb756d12ac0a276fde521aa24bdb5da81ffa1 100644 (file)
@@ -4,8 +4,8 @@
 
 defmodule Pleroma.BBS.Authenticator do
   use Sshd.PasswordAuthenticator
-  alias Pleroma.Plugs.AuthenticationPlug
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.AuthenticationPlug
 
   def authenticate(username, password) do
     username = to_string(username)
index 4ba6eaa77e0e86ad90a8c11a8dd058720ff29b16..59c6b0f58f33e45763ee933e760f247818938cf9 100644 (file)
@@ -39,7 +39,8 @@ defmodule Pleroma.Config.DeprecationWarnings do
          :ok <- check_media_proxy_whitelist_config(),
          :ok <- check_welcome_message_config(),
          :ok <- check_gun_pool_options(),
-         :ok <- check_activity_expiration_config() do
+         :ok <- check_activity_expiration_config(),
+         :ok <- check_remote_ip_plug_name() do
       :ok
     else
       _ ->
@@ -176,4 +177,20 @@ defmodule Pleroma.Config.DeprecationWarnings do
       warning_preface
     )
   end
+
+  @spec check_remote_ip_plug_name() :: :ok | nil
+  def check_remote_ip_plug_name do
+    warning_preface = """
+    !!!DEPRECATION WARNING!!!
+    Your config is using old namespace for RemoteIp Plug. Setting should work for now, but you are advised to change to new namespace to prevent possible issues later:
+    """
+
+    move_namespace_and_warn(
+      [
+        {Pleroma.Plugs.RemoteIp, Pleroma.Web.Plugs.RemoteIp,
+         "\n* `config :pleroma, Pleroma.Plugs.RemoteIp` is now `config :pleroma, Pleroma.Web.Plugs.RemoteIp`"}
+      ],
+      warning_preface
+    )
+  end
 end
similarity index 100%
rename from lib/pleroma/gun/gun.ex
rename to lib/pleroma/gun.ex
similarity index 100%
rename from lib/pleroma/http/http.ex
rename to lib/pleroma/http.ex
index fb04411d9fb6e62eaa780b6122d37520398b17fd..b30d83567edb30b53ae9b3047978a8b09f7224c4 100644 (file)
@@ -8,9 +8,9 @@ defmodule Pleroma.Tests.AuthTestController do
 
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   # Serves only with proper OAuth token (:api and :authenticated_api)
   # Skipping EnsurePublicOrAuthenticatedPlug has no effect in this case
index 9a94534e91a84497a65dc3dc5857ba713ec82ca7..6249eceb1b9a51175023d6d176628db64c39aefd 100644 (file)
@@ -12,7 +12,7 @@ defmodule Pleroma.Uploaders.Uploader do
   @doc """
   Instructs how to get the file from the backend.
 
-  Used by `Pleroma.Plugs.UploadedMedia`.
+  Used by `Pleroma.Web.Plugs.UploadedMedia`.
   """
   @type get_method :: {:static_dir, directory :: String.t()} | {:url, url :: String.t()}
   @callback get_file(file :: String.t()) :: {:ok, get_method()}
similarity index 93%
rename from lib/pleroma/web/web.ex
rename to lib/pleroma/web.ex
index 4f9281851dd5d43a2f3812d49cd89a7a509ef320..7779826e3e1a6a1696e35e0c81be517d23e91939 100644 (file)
@@ -2,11 +2,6 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.Plug do
-  # Substitute for `call/2` which is defined with `use Pleroma.Web, :plug`
-  @callback perform(Plug.Conn.t(), Plug.opts()) :: Plug.Conn.t()
-end
-
 defmodule Pleroma.Web do
   @moduledoc """
   A module that keeps using definitions for controllers,
@@ -25,12 +20,12 @@ defmodule Pleroma.Web do
   below.
   """
 
-  alias Pleroma.Plugs.EnsureAuthenticatedPlug
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
-  alias Pleroma.Plugs.ExpectAuthenticatedCheckPlug
-  alias Pleroma.Plugs.ExpectPublicOrAuthenticatedCheckPlug
-  alias Pleroma.Plugs.OAuthScopesPlug
-  alias Pleroma.Plugs.PlugHelper
+  alias Pleroma.Web.Plugs.EnsureAuthenticatedPlug
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.ExpectAuthenticatedCheckPlug
+  alias Pleroma.Web.Plugs.ExpectPublicOrAuthenticatedCheckPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.PlugHelper
 
   def controller do
     quote do
index 732c442710bb62bb29549bdfbd3bb13a146c6d87..6bf7421bb6e9df004577262dd22c919f0543c489 100644 (file)
@@ -9,7 +9,6 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
   alias Pleroma.Delivery
   alias Pleroma.Object
   alias Pleroma.Object.Fetcher
-  alias Pleroma.Plugs.EnsureAuthenticatedPlug
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.ActivityPub
   alias Pleroma.Web.ActivityPub.Builder
@@ -23,8 +22,9 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
   alias Pleroma.Web.ActivityPub.Visibility
   alias Pleroma.Web.ControllerHelper
   alias Pleroma.Web.Endpoint
-  alias Pleroma.Web.FederatingPlug
   alias Pleroma.Web.Federator
+  alias Pleroma.Web.Plugs.EnsureAuthenticatedPlug
+  alias Pleroma.Web.Plugs.FederatingPlug
 
   require Logger
 
@@ -46,7 +46,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
   )
 
   plug(
-    Pleroma.Plugs.Cache,
+    Pleroma.Web.Plugs.Cache,
     [query_params: false, tracking_fun: &__MODULE__.track_object_fetch/2]
     when action in [:activity, :object]
   )
index d5713c3dd968265b4bd2ba30b90274c00281d29f..bdd3e195d177b80b83bc21c92e792bd5c3b6ac14 100644 (file)
@@ -10,7 +10,6 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
   alias Pleroma.Config
   alias Pleroma.MFA
   alias Pleroma.ModerationLog
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Stats
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.ActivityPub
@@ -21,6 +20,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
   alias Pleroma.Web.AdminAPI.ModerationLogView
   alias Pleroma.Web.AdminAPI.Search
   alias Pleroma.Web.Endpoint
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.Web.Router
 
   @users_page_size 50
index 967600d69acaef52748dbc3460c7b822090c4fdc..af8ff8292d77ce1ae4db26f4b716ffd5af59a586 100644 (file)
@@ -10,10 +10,10 @@ defmodule Pleroma.Web.AdminAPI.ChatController do
   alias Pleroma.Chat.MessageReference
   alias Pleroma.ModerationLog
   alias Pleroma.Pagination
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Web.AdminAPI
   alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.PleromaAPI.Chat.MessageReferenceView
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   require Logger
 
index 0df13007f67ccd01fc78ff5da859c0fd6b963924..5d155af3da26d4d919bbf9c31bdb16d6cd52b054 100644 (file)
@@ -7,7 +7,7 @@ defmodule Pleroma.Web.AdminAPI.ConfigController do
 
   alias Pleroma.Config
   alias Pleroma.ConfigDB
-  alias Pleroma.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
   plug(OAuthScopesPlug, %{scopes: ["write"], admin: true} when action == :update)
index 504d9b5171e1cebbb50ce245605c2224f45f83b8..37dbfeb725386d06bf2f7f133ea395ec791f7bb4 100644 (file)
@@ -5,9 +5,9 @@
 defmodule Pleroma.Web.AdminAPI.InstanceDocumentController do
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.InstanceStatic
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Web.InstanceDocument
+  alias Pleroma.Web.Plugs.InstanceStatic
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
 
index 7d169b8d29eeb9efa3ab16da562b89c3d26880f2..6a9b4038a13088d50f3823173b2811ef8baf8098 100644 (file)
@@ -8,8 +8,8 @@ defmodule Pleroma.Web.AdminAPI.InviteController do
   import Pleroma.Web.ControllerHelper, only: [json_response: 3]
 
   alias Pleroma.Config
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.UserInviteToken
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   require Logger
 
index 131e22d78a03ac5a65fa1c3ab2f99a2dbaf17957..6d92e9f7ffdc376e82cd8b1450de3a361d84a1c2 100644 (file)
@@ -5,9 +5,9 @@
 defmodule Pleroma.Web.AdminAPI.MediaProxyCacheController do
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Web.ApiSpec.Admin, as: Spec
   alias Pleroma.Web.MediaProxy
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
 
similarity index 97%
rename from lib/pleroma/web/admin_api/controllers/oauth_app_controller.ex
rename to lib/pleroma/web/admin_api/controllers/o_auth_app_controller.ex
index dca23ea735bf25d0c6ab6ee86af8b4bdfad72c78..116a05a4df166963735bbd35af928b8d87402e52 100644 (file)
@@ -7,8 +7,8 @@ defmodule Pleroma.Web.AdminAPI.OAuthAppController do
 
   import Pleroma.Web.ControllerHelper, only: [json_response: 3]
 
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Web.OAuth.App
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   require Logger
 
index 6c19f09f7647fe28a5a121883b69de9d02174c89..6113884475896e522fea9f128816fa4457696ebf 100644 (file)
@@ -6,8 +6,8 @@ defmodule Pleroma.Web.AdminAPI.RelayController do
   use Pleroma.Web, :controller
 
   alias Pleroma.ModerationLog
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Web.ActivityPub.Relay
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   require Logger
 
index 4c011e174539b9898249907f8b02948539dcf1e9..86da93893955ac108c0d17aa7bef288726178738 100644 (file)
@@ -9,12 +9,12 @@ defmodule Pleroma.Web.AdminAPI.ReportController do
 
   alias Pleroma.Activity
   alias Pleroma.ModerationLog
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.ReportNote
   alias Pleroma.Web.ActivityPub.Utils
   alias Pleroma.Web.AdminAPI
   alias Pleroma.Web.AdminAPI.Report
   alias Pleroma.Web.CommonAPI
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   require Logger
 
index bc48cc5278997ca9add04f1162ffe2a81fa9d2fc..2bb437cfe778c06fcec739ae72439f41031b0d45 100644 (file)
@@ -7,10 +7,10 @@ defmodule Pleroma.Web.AdminAPI.StatusController do
 
   alias Pleroma.Activity
   alias Pleroma.ModerationLog
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Web.ActivityPub.ActivityPub
   alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.MastodonAPI
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   require Logger
 
index c611b3e0916dd83485bb65c3a04cd789d5532c6c..d6d2a8d060e1fe3d33c41521f00c1c769e365fbd 100644 (file)
@@ -3,10 +3,10 @@
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.Auth.PleromaAuthenticator do
-  alias Pleroma.Plugs.AuthenticationPlug
   alias Pleroma.Registration
   alias Pleroma.Repo
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.AuthenticationPlug
 
   import Pleroma.Web.Auth.Authenticator,
     only: [fetch_credentials: 1, fetch_user: 1]
index 1794e407c4c6a583f70c3dad8db633e6014a7eab..edc9871ea459bae05eb65882e7b28c4a4648bbc0 100644 (file)
@@ -5,8 +5,8 @@
 defmodule Pleroma.Web.Auth.TOTPAuthenticator do
   alias Pleroma.MFA
   alias Pleroma.MFA.TOTP
-  alias Pleroma.Plugs.AuthenticationPlug
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.AuthenticationPlug
 
   @doc "Verify code or check backup code."
   @spec verify(String.t(), User.t()) ::
index 9d7b24eb295cfbc43f3d409e0746e26c047efaa8..21f4d43e9be78d13293f4b7acb130f97b0854267 100644 (file)
@@ -12,12 +12,12 @@ defmodule Pleroma.Web.CommonAPI.Utils do
   alias Pleroma.Conversation.Participation
   alias Pleroma.Formatter
   alias Pleroma.Object
-  alias Pleroma.Plugs.AuthenticationPlug
   alias Pleroma.Repo
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.Utils
   alias Pleroma.Web.ActivityPub.Visibility
   alias Pleroma.Web.MediaProxy
+  alias Pleroma.Web.Plugs.AuthenticationPlug
 
   require Logger
   require Pleroma.Constants
index 8b153763d53ab61d674e1eb27b6d1e15f8d64541..56562c12fc5ed46a6c3efcd00ac955a2e51e2afd 100644 (file)
@@ -9,17 +9,17 @@ defmodule Pleroma.Web.Endpoint do
 
   socket("/socket", Pleroma.Web.UserSocket)
 
-  plug(Pleroma.Plugs.SetLocalePlug)
+  plug(Pleroma.Web.Plugs.SetLocalePlug)
   plug(CORSPlug)
-  plug(Pleroma.Plugs.HTTPSecurityPlug)
-  plug(Pleroma.Plugs.UploadedMedia)
+  plug(Pleroma.Web.Plugs.HTTPSecurityPlug)
+  plug(Pleroma.Web.Plugs.UploadedMedia)
 
   @static_cache_control "public, no-cache"
 
   # InstanceStatic needs to be before Plug.Static to be able to override shipped-static files
   # If you're adding new paths to `only:` you'll need to configure them in InstanceStatic as well
   # Cache-control headers are duplicated in case we turn off etags in the future
-  plug(Pleroma.Plugs.InstanceStatic,
+  plug(Pleroma.Web.Plugs.InstanceStatic,
     at: "/",
     gzip: true,
     cache_control_for_etags: @static_cache_control,
@@ -29,7 +29,7 @@ defmodule Pleroma.Web.Endpoint do
   )
 
   # Careful! No `only` restriction here, as we don't know what frontends contain.
-  plug(Pleroma.Plugs.FrontendStatic,
+  plug(Pleroma.Web.Plugs.FrontendStatic,
     at: "/",
     frontend_type: :primary,
     gzip: true,
@@ -41,7 +41,7 @@ defmodule Pleroma.Web.Endpoint do
 
   plug(Plug.Static.IndexHtml, at: "/pleroma/admin/")
 
-  plug(Pleroma.Plugs.FrontendStatic,
+  plug(Pleroma.Web.Plugs.FrontendStatic,
     at: "/pleroma/admin",
     frontend_type: :admin,
     gzip: true,
@@ -79,7 +79,7 @@ defmodule Pleroma.Web.Endpoint do
     plug(Phoenix.CodeReloader)
   end
 
-  plug(Pleroma.Plugs.TrailingFormatPlug)
+  plug(Pleroma.Web.Plugs.TrailingFormatPlug)
   plug(Plug.RequestId)
   plug(Plug.Logger, log: :debug)
 
@@ -122,7 +122,7 @@ defmodule Pleroma.Web.Endpoint do
     extra: extra
   )
 
-  plug(Pleroma.Plugs.RemoteIp)
+  plug(Pleroma.Web.Plugs.RemoteIp)
 
   defmodule Instrumenter do
     use Prometheus.PhoenixInstrumenter
similarity index 95%
rename from lib/pleroma/web/fallback_redirect_controller.ex
rename to lib/pleroma/web/fallback/redirect_controller.ex
index 431ad5485b2371fbf267692ab12dd54c90fc7198..6f759d559648cc2cb9ebe34f40ce15102d6ebf9e 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Fallback.RedirectController do
+defmodule Pleroma.Web.Fallback.RedirectController do
   use Pleroma.Web, :controller
 
   require Logger
@@ -75,7 +75,7 @@ defmodule Fallback.RedirectController do
   end
 
   defp index_file_path do
-    Pleroma.Plugs.InstanceStatic.file_path("index.html")
+    Pleroma.Web.Plugs.InstanceStatic.file_path("index.html")
   end
 
   defp build_tags(conn, params) do
index 71eb1ea7ee28ae207e73b6edcb1368232f8d203d..752983c3b0527a35a12570d8035fc25a98fef3ce 100644 (file)
@@ -5,27 +5,26 @@
 defmodule Pleroma.Web.Feed.UserController do
   use Pleroma.Web, :controller
 
-  alias Fallback.RedirectController
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.ActivityPub
   alias Pleroma.Web.ActivityPub.ActivityPubController
   alias Pleroma.Web.Feed.FeedView
 
-  plug(Pleroma.Plugs.SetFormatPlug when action in [:feed_redirect])
+  plug(Pleroma.Web.Plugs.SetFormatPlug when action in [:feed_redirect])
 
   action_fallback(:errors)
 
   def feed_redirect(%{assigns: %{format: "html"}} = conn, %{"nickname" => nickname}) do
     with {_, %User{} = user} <- {:fetch_user, User.get_cached_by_nickname_or_id(nickname)} do
-      RedirectController.redirector_with_meta(conn, %{user: user})
+      Pleroma.Web.Fallback.RedirectController.redirector_with_meta(conn, %{user: user})
     end
   end
 
   def feed_redirect(%{assigns: %{format: format}} = conn, _params)
       when format in ["json", "activity+json"] do
     with %{halted: false} = conn <-
-           Pleroma.Plugs.EnsureAuthenticatedPlug.call(conn,
-             unless_func: &Pleroma.Web.FederatingPlug.federating?/1
+           Pleroma.Web.Plugs.EnsureAuthenticatedPlug.call(conn,
+             unless_func: &Pleroma.Web.Plugs.FederatingPlug.federating?/1
            ) do
       ActivityPubController.call(conn, :user)
     end
index 43ec700219f7b75852f001444ac4bb6a4bd052b3..08f92d55fb097f2fcf9a78424a360b1cd1cdfd15 100644 (file)
@@ -5,9 +5,9 @@
 defmodule Pleroma.Web.MastoFEController do
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   plug(OAuthScopesPlug, %{scopes: ["write:accounts"]} when action == :put_settings)
 
index e06ff930772072b3a43b1c408f68310e6157fb08..6453880dcbc7a53e46063050f70191c506b3ed66 100644 (file)
@@ -15,9 +15,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
     ]
 
   alias Pleroma.Maps
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
-  alias Pleroma.Plugs.OAuthScopesPlug
-  alias Pleroma.Plugs.RateLimiter
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.ActivityPub
   alias Pleroma.Web.ActivityPub.Builder
@@ -29,6 +26,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
   alias Pleroma.Web.MastodonAPI.StatusView
   alias Pleroma.Web.OAuth.OAuthController
   alias Pleroma.Web.OAuth.OAuthView
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.RateLimiter
   alias Pleroma.Web.TwitterAPI.TwitterAPI
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
index a516b6c204d614be2d2cd39775f2779e1cc10f17..143dcf80c80a93ad6d6a26b2ac070dc554f7c582 100644 (file)
@@ -5,12 +5,12 @@
 defmodule Pleroma.Web.MastodonAPI.AppController do
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Repo
   alias Pleroma.Web.OAuth.App
   alias Pleroma.Web.OAuth.Scopes
   alias Pleroma.Web.OAuth.Token
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
 
index 57c0be5fea166463b652d9683e3ca4c8684271e2..75b809aabf7c1767a64f05c38387130a92ea8ee0 100644 (file)
@@ -15,7 +15,7 @@ defmodule Pleroma.Web.MastodonAPI.AuthController do
 
   action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
 
-  plug(Pleroma.Plugs.RateLimiter, [name: :password_reset] when action == :password_reset)
+  plug(Pleroma.Web.Plugs.RateLimiter, [name: :password_reset] when action == :password_reset)
 
   @local_mastodon_name "Mastodon-Local"
 
index f35ec3596589c902da4e5a79d06ad09291c9dbf6..61347d8dba9d660b6adef93075c6584953295b77 100644 (file)
@@ -8,8 +8,8 @@ defmodule Pleroma.Web.MastodonAPI.ConversationController do
   import Pleroma.Web.ControllerHelper, only: [add_link_headers: 2]
 
   alias Pleroma.Conversation.Participation
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Repo
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
 
index c5f47c5dffc77e3cc3997edbdbfb06767601a0bb..872cb1f4de04986f2e0e2d6db15e57d9dca783b5 100644 (file)
@@ -9,7 +9,7 @@ defmodule Pleroma.Web.MastodonAPI.CustomEmojiController do
 
   plug(
     :skip_plug,
-    [Pleroma.Plugs.OAuthScopesPlug, Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug]
+    [Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug]
     when action == :index
   )
 
index 9c2d093cdb493946d66689b53b362694660e8de2..503bd7d5fdf41ca6b24458b1b727f6a266f57da2 100644 (file)
@@ -5,8 +5,8 @@
 defmodule Pleroma.Web.MastodonAPI.DomainBlockController do
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
   defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.DomainBlockOperation
index abbf0ce02e9c0f50085f682ecca6e4e19f231e79..c71a34b15c5adae4f6c9e6e88ed77ed2a6f6b7be 100644 (file)
@@ -6,7 +6,7 @@ defmodule Pleroma.Web.MastodonAPI.FilterController do
   use Pleroma.Web, :controller
 
   alias Pleroma.Filter
-  alias Pleroma.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   @oauth_read_actions [:show, :index]
 
index 748b6b4757ff704b79c125c10b2bd4dfff956689..f8cd7fa9f9aee771ca771bd10ae51a98571caf29 100644 (file)
@@ -5,9 +5,9 @@
 defmodule Pleroma.Web.MastodonAPI.FollowRequestController do
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
   alias Pleroma.Web.CommonAPI
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   plug(:put_view, Pleroma.Web.MastodonAPI.AccountView)
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
index d8859731d97e52c880295a10bf0aa8e5b27edf35..07a32491a69322b5466672b5ee1ab56a785c7c26 100644 (file)
@@ -9,7 +9,7 @@ defmodule Pleroma.Web.MastodonAPI.InstanceController do
 
   plug(
     :skip_plug,
-    [Pleroma.Plugs.OAuthScopesPlug, Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug]
+    [Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug]
     when action in [:show, :peers]
   )
 
index 5daeaa78002ab47fe45363d4e28fe362f27b4988..f6b51bf02dc2fd3b213e5e4c87784cdd566f9a80 100644 (file)
@@ -5,9 +5,9 @@
 defmodule Pleroma.Web.MastodonAPI.ListController do
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
   alias Pleroma.Web.MastodonAPI.AccountView
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   @oauth_read_actions [:index, :show, :list_accounts]
 
index 85310edfa7c938d84d371cf0d2409aa300d42520..0628b2b4956266f6f6498d465fe0f19bfe54507c 100644 (file)
@@ -4,7 +4,7 @@
 
 defmodule Pleroma.Web.MastodonAPI.MarkerController do
   use Pleroma.Web, :controller
-  alias Pleroma.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
 
index e7767de4eca50536d26f7f54a310ce54771cfc86..9cf682c7b8a5dd163b35701ef805c2c8d927fffd 100644 (file)
@@ -17,7 +17,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
 
   plug(
     :skip_plug,
-    [Pleroma.Plugs.OAuthScopesPlug, Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug]
+    [Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug]
     when action in [:empty_array, :empty_object]
   )
 
index 513de279f0e8c3d5db5f2ab17716f418dc3d4feb..9586b14bc37c906d266e0c58fd41036a64ad5018 100644 (file)
@@ -6,9 +6,9 @@ defmodule Pleroma.Web.MastodonAPI.MediaController do
   use Pleroma.Web, :controller
 
   alias Pleroma.Object
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.ActivityPub
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
index e25cef30bbf80f3f9a405ee2f2211b5deb18c51f..c3c8606f22884a6f8a9239d165115700a6a4eea2 100644 (file)
@@ -8,8 +8,8 @@ defmodule Pleroma.Web.MastodonAPI.NotificationController do
   import Pleroma.Web.ControllerHelper, only: [add_link_headers: 2]
 
   alias Pleroma.Notification
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Web.MastodonAPI.MastodonAPI
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   @oauth_read_actions [:show, :index]
 
index db46ffcfc1ecbbdb1a83fb836452cb0f6454ccae..3dcd1c44f284425594bd6088463badf19595108f 100644 (file)
@@ -9,9 +9,9 @@ defmodule Pleroma.Web.MastodonAPI.PollController do
 
   alias Pleroma.Activity
   alias Pleroma.Object
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Web.ActivityPub.Visibility
   alias Pleroma.Web.CommonAPI
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
 
index 405167108a1fe89dd882cd9af4c000522d9423c2..156544f40f78b8681ee3f0ce0c778a2058125756 100644 (file)
@@ -3,14 +3,12 @@
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.MastodonAPI.ReportController do
-  alias Pleroma.Plugs.OAuthScopesPlug
-
   use Pleroma.Web, :controller
 
   action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
-  plug(OAuthScopesPlug, %{scopes: ["write:reports"]} when action == :create)
+  plug(Pleroma.Web.Plugs.OAuthScopesPlug, %{scopes: ["write:reports"]} when action == :create)
 
   defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.ReportOperation
 
index 1719c67ea8874715d499801c77e36cf12d3ec26d..322a46497ba28e6b9243002c5ffe40430d2bd9eb 100644 (file)
@@ -7,9 +7,9 @@ defmodule Pleroma.Web.MastodonAPI.ScheduledActivityController do
 
   import Pleroma.Web.ControllerHelper, only: [add_link_headers: 2]
 
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.ScheduledActivity
   alias Pleroma.Web.MastodonAPI.MastodonAPI
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   @oauth_read_actions [:show, :index]
 
index 5a983db3994509ccc133decf6afe53a09a1f161f..0043c3a5622d1b230534dc66db170556a4500d2b 100644 (file)
@@ -6,14 +6,14 @@ defmodule Pleroma.Web.MastodonAPI.SearchController do
   use Pleroma.Web, :controller
 
   alias Pleroma.Activity
-  alias Pleroma.Plugs.OAuthScopesPlug
-  alias Pleroma.Plugs.RateLimiter
   alias Pleroma.Repo
   alias Pleroma.User
   alias Pleroma.Web
   alias Pleroma.Web.ControllerHelper
   alias Pleroma.Web.MastodonAPI.AccountView
   alias Pleroma.Web.MastodonAPI.StatusView
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.RateLimiter
 
   require Logger
 
index ecfa38489837eadae7b299324fb6ebe8cf60dbc2..08d6c1c22daba11208775b28121239110b4f9919 100644 (file)
@@ -13,8 +13,6 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
   alias Pleroma.Activity
   alias Pleroma.Bookmark
   alias Pleroma.Object
-  alias Pleroma.Plugs.OAuthScopesPlug
-  alias Pleroma.Plugs.RateLimiter
   alias Pleroma.Repo
   alias Pleroma.ScheduledActivity
   alias Pleroma.User
@@ -23,9 +21,15 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
   alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.MastodonAPI.AccountView
   alias Pleroma.Web.MastodonAPI.ScheduledActivityView
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.RateLimiter
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
-  plug(:skip_plug, Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug when action in [:index, :show])
+
+  plug(
+    :skip_plug,
+    Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug when action in [:index, :show]
+  )
 
   @unauthenticated_access %{fallback: :proceed_unauthenticated, scopes: []}
 
index 34eac97c5027b18b976b88edb3ac1b610ac5e9ac..20138908c2ea5587dfbc01ea1a338dc8be5db6ed 100644 (file)
@@ -13,7 +13,7 @@ defmodule Pleroma.Web.MastodonAPI.SubscriptionController do
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
   plug(:restrict_push_enabled)
-  plug(Pleroma.Plugs.OAuthScopesPlug, %{scopes: ["push"]})
+  plug(Pleroma.Web.Plugs.OAuthScopesPlug, %{scopes: ["push"]})
 
   defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.SubscriptionOperation
 
index f91df9ab709034e74ff1cafe7c9d7bdfa8486f68..5765271cfa7cd6a5ee9c28c273d9b403eedb2f6d 100644 (file)
@@ -8,7 +8,7 @@ defmodule Pleroma.Web.MastodonAPI.SuggestionController do
   require Logger
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
-  plug(Pleroma.Plugs.OAuthScopesPlug, %{scopes: ["read"]} when action == :index)
+  plug(Pleroma.Web.Plugs.OAuthScopesPlug, %{scopes: ["read"]} when action == :index)
 
   def open_api_operation(action) do
     operation = String.to_existing_atom("#{action}_operation")
index 5272790d3149ad286ac10968ab263a59b6544403..7a5c80e013e288b6e250c5340de7f4e540532c85 100644 (file)
@@ -10,11 +10,11 @@ defmodule Pleroma.Web.MastodonAPI.TimelineController do
 
   alias Pleroma.Config
   alias Pleroma.Pagination
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
-  alias Pleroma.Plugs.OAuthScopesPlug
-  alias Pleroma.Plugs.RateLimiter
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.ActivityPub
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.RateLimiter
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
   plug(:skip_plug, EnsurePublicOrAuthenticatedPlug when action in [:public, :hashtag])
similarity index 93%
rename from lib/pleroma/web/mongooseim/mongoose_im_controller.ex
rename to lib/pleroma/web/mongoose_im/mongoose_im_controller.ex
index 6cbbe8fd8dbb7ea1f879f4686a4a955f7671073e..2a5c7c356073cdf4c6828225da6712df103d4e73 100644 (file)
@@ -5,10 +5,10 @@
 defmodule Pleroma.Web.MongooseIM.MongooseIMController do
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.AuthenticationPlug
-  alias Pleroma.Plugs.RateLimiter
   alias Pleroma.Repo
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.AuthenticationPlug
+  alias Pleroma.Web.Plugs.RateLimiter
 
   plug(RateLimiter, [name: :authentication] when action in [:user_exists, :check_password])
   plug(RateLimiter, [name: :authentication, params: ["user"]] when action == :check_password)
similarity index 99%
rename from lib/pleroma/web/oauth/oauth_controller.ex
rename to lib/pleroma/web/o_auth/o_auth_controller.ex
index a4152e84090426b8e396e1f10f4a68d3d6611baf..d2f9d1cebf379c941df3dfffe46d6b2f19215ac9 100644 (file)
@@ -8,7 +8,6 @@ defmodule Pleroma.Web.OAuth.OAuthController do
   alias Pleroma.Helpers.UriHelper
   alias Pleroma.Maps
   alias Pleroma.MFA
-  alias Pleroma.Plugs.RateLimiter
   alias Pleroma.Registration
   alias Pleroma.Repo
   alias Pleroma.User
@@ -23,6 +22,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do
   alias Pleroma.Web.OAuth.Token
   alias Pleroma.Web.OAuth.Token.Strategy.RefreshToken
   alias Pleroma.Web.OAuth.Token.Strategy.Revoke, as: RevokeToken
+  alias Pleroma.Web.Plugs.RateLimiter
 
   require Logger
 
@@ -31,7 +31,10 @@ defmodule Pleroma.Web.OAuth.OAuthController do
   plug(:fetch_session)
   plug(:fetch_flash)
 
-  plug(:skip_plug, [Pleroma.Plugs.OAuthScopesPlug, Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug])
+  plug(:skip_plug, [
+    Pleroma.Web.Plugs.OAuthScopesPlug,
+    Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
+  ])
 
   plug(RateLimiter, [name: :authentication] when action == :create_authorization)
 
similarity index 97%
rename from lib/pleroma/web/oauth/scopes.ex
rename to lib/pleroma/web/o_auth/scopes.ex
index 6f06f1431587388d8c923a3e7ec852314d666b94..90b9a04715050dabc0266b97beabff80fa19e3e9 100644 (file)
@@ -7,7 +7,7 @@ defmodule Pleroma.Web.OAuth.Scopes do
   Functions for dealing with scopes.
   """
 
-  alias Pleroma.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   @doc """
   Fetch scopes from request params.
similarity index 95%
rename from lib/pleroma/web/ostatus/ostatus_controller.ex
rename to lib/pleroma/web/o_status/o_status_controller.ex
index de1b0b3f003fea6150dfedddf7a1a69bba9e2993..b044260b3602e6c1e0a2dd24d80fe97d129d1a88 100644 (file)
@@ -5,19 +5,19 @@
 defmodule Pleroma.Web.OStatus.OStatusController do
   use Pleroma.Web, :controller
 
-  alias Fallback.RedirectController
   alias Pleroma.Activity
   alias Pleroma.Object
-  alias Pleroma.Plugs.RateLimiter
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.ActivityPubController
   alias Pleroma.Web.ActivityPub.Visibility
   alias Pleroma.Web.Endpoint
+  alias Pleroma.Web.Fallback.RedirectController
   alias Pleroma.Web.Metadata.PlayerView
+  alias Pleroma.Web.Plugs.RateLimiter
   alias Pleroma.Web.Router
 
-  plug(Pleroma.Plugs.EnsureAuthenticatedPlug,
-    unless_func: &Pleroma.Web.FederatingPlug.federating?/1
+  plug(Pleroma.Web.Plugs.EnsureAuthenticatedPlug,
+    unless_func: &Pleroma.Web.Plugs.FederatingPlug.federating?/1
   )
 
   plug(
@@ -26,7 +26,7 @@ defmodule Pleroma.Web.OStatus.OStatusController do
   )
 
   plug(
-    Pleroma.Plugs.SetFormatPlug
+    Pleroma.Web.Plugs.SetFormatPlug
     when action in [:object, :activity, :notice]
   )
 
index 563edded70d0bcf32513fbbaab293faa3488e844..61f4a9bd9279abbe173b8c70a60f686d1af472ea 100644 (file)
@@ -8,12 +8,12 @@ defmodule Pleroma.Web.PleromaAPI.AccountController do
   import Pleroma.Web.ControllerHelper,
     only: [json_response: 3, add_link_headers: 2, assign_account_by_id: 2]
 
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
-  alias Pleroma.Plugs.OAuthScopesPlug
-  alias Pleroma.Plugs.RateLimiter
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.ActivityPub
   alias Pleroma.Web.MastodonAPI.StatusView
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.RateLimiter
 
   require Pleroma.Constants
 
index e667831c59c1b9d604208b4478c1ad15cbbd0a13..6357148d012e9f0f0071c03f2e82298919b72e0c 100644 (file)
@@ -11,12 +11,12 @@ defmodule Pleroma.Web.PleromaAPI.ChatController do
   alias Pleroma.Chat.MessageReference
   alias Pleroma.Object
   alias Pleroma.Pagination
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Repo
   alias Pleroma.User
   alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.PleromaAPI.Chat.MessageReferenceView
   alias Pleroma.Web.PleromaAPI.ChatView
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   import Ecto.Query
 
index 3d007f3245136e31e604f530c2bbd0e647889774..df52b7566ea1b8d3dd5f6c36f45cf0d68bf3bc2a 100644 (file)
@@ -8,9 +8,9 @@ defmodule Pleroma.Web.PleromaAPI.ConversationController do
   import Pleroma.Web.ControllerHelper, only: [add_link_headers: 2]
 
   alias Pleroma.Conversation.Participation
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Web.ActivityPub.ActivityPub
   alias Pleroma.Web.MastodonAPI.StatusView
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
   plug(:put_view, Pleroma.Web.MastodonAPI.ConversationView)
index 7c03450940af4eecf2e1b99273c2c898ee02eb5a..428c97de62cf0619594ad7f0e1b5be81f4911fde 100644 (file)
@@ -11,7 +11,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiFileController do
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
 
   plug(
-    Pleroma.Plugs.OAuthScopesPlug,
+    Pleroma.Web.Plugs.OAuthScopesPlug,
     %{scopes: ["write"], admin: true}
     when action in [
            :create,
index a0e5c739a21e19e20f7227a3b4e4fc9499a1b6a2..a9accc5af76e0debe9dbf203acdcf4257dac5e70 100644 (file)
@@ -10,7 +10,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiPackController do
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
 
   plug(
-    Pleroma.Plugs.OAuthScopesPlug,
+    Pleroma.Web.Plugs.OAuthScopesPlug,
     %{scopes: ["write"], admin: true}
     when action in [
            :import_from_filesystem,
@@ -22,8 +22,11 @@ defmodule Pleroma.Web.PleromaAPI.EmojiPackController do
          ]
   )
 
-  @skip_plugs [Pleroma.Plugs.OAuthScopesPlug, Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug]
-  plug(:skip_plug, @skip_plugs when action in [:index, :show, :archive])
+  @skip_plugs [
+    Pleroma.Web.Plugs.OAuthScopesPlug,
+    Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
+  ]
+  plug(:skip_plug, @skip_plugs when action in [:index, :archive, :show])
 
   defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaEmojiPackOperation
 
index 7f9254c135dc7e8f80d88f6366ac81c9a342d0c5..ae199a50f1e599aa9d4131516ed68ace60fd63e7 100644 (file)
@@ -7,9 +7,9 @@ defmodule Pleroma.Web.PleromaAPI.EmojiReactionController do
 
   alias Pleroma.Activity
   alias Pleroma.Object
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.MastodonAPI.StatusView
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
   plug(OAuthScopesPlug, %{scopes: ["write:statuses"]} when action in [:create, :delete])
index df6c50ca5d139f110c72e64d35c0f80e72cb7a3b..0f6f0b9dbc6818f1efda0a2055275468fce09f1d 100644 (file)
@@ -5,9 +5,9 @@
 defmodule Pleroma.Web.PleromaAPI.MascotController do
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.ActivityPub
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
   plug(OAuthScopesPlug, %{scopes: ["read:accounts"]} when action == :show)
index 3ed8bd294027eba8c708fdce17c41f461c147308..fa32aaa844582f29fd0c61b71b253348d2d3752b 100644 (file)
@@ -6,10 +6,14 @@ defmodule Pleroma.Web.PleromaAPI.NotificationController do
   use Pleroma.Web, :controller
 
   alias Pleroma.Notification
-  alias Pleroma.Plugs.OAuthScopesPlug
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
-  plug(OAuthScopesPlug, %{scopes: ["write:notifications"]} when action == :mark_as_read)
+
+  plug(
+    Pleroma.Web.Plugs.OAuthScopesPlug,
+    %{scopes: ["write:notifications"]} when action == :mark_as_read
+  )
+
   plug(:put_view, Pleroma.Web.MastodonAPI.NotificationView)
 
   defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaNotificationOperation
index e9a4fba92df552c55179dd32950d32f73a51fce3..632d6543414787058582977f7e8d5606ca156a21 100644 (file)
@@ -7,10 +7,10 @@ defmodule Pleroma.Web.PleromaAPI.ScrobbleController do
 
   import Pleroma.Web.ControllerHelper, only: [add_link_headers: 2]
 
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.ActivityPub
   alias Pleroma.Web.CommonAPI
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
 
index b86791d0961d9bf3d4f96485f9b92279942a8936..eba4523002efc2033ab02ea34c43d1eaa26aa3e8 100644 (file)
@@ -10,8 +10,8 @@ defmodule Pleroma.Web.PleromaAPI.TwoFactorAuthenticationController do
 
   alias Pleroma.MFA
   alias Pleroma.MFA.TOTP
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Web.CommonAPI.Utils
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   plug(OAuthScopesPlug, %{scopes: ["read:security"]} when action in [:settings])
 
index f10c45750ef8dd0bb414e424ccf8ba270f1f6d01..7f089af1c0b098d88936beac5c45ce4166a12e7f 100644 (file)
@@ -7,9 +7,9 @@ defmodule Pleroma.Web.PleromaAPI.UserImportController do
 
   require Logger
 
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
   alias Pleroma.Web.ApiSpec
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   plug(OAuthScopesPlug, %{scopes: ["follow", "write:follows"]} when action == :follow)
   plug(OAuthScopesPlug, %{scopes: ["follow", "write:blocks"]} when action == :blocks)
diff --git a/lib/pleroma/web/plug.ex b/lib/pleroma/web/plug.ex
new file mode 100644 (file)
index 0000000..840b350
--- /dev/null
@@ -0,0 +1,8 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.Plug do
+  # Substitute for `call/2` which is defined with `use Pleroma.Web, :plug`
+  @callback perform(Plug.Conn.t(), Plug.opts()) :: Plug.Conn.t()
+end
similarity index 89%
rename from lib/pleroma/plugs/admin_secret_authentication_plug.ex
rename to lib/pleroma/web/plugs/admin_secret_authentication_plug.ex
index 2e54df47a386bb6e02eb402981e09c5567d08cdc..d7d4e4092b4ba51631262de2b8b168acb49f5d0e 100644 (file)
@@ -2,12 +2,12 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.AdminSecretAuthenticationPlug do
+defmodule Pleroma.Web.Plugs.AdminSecretAuthenticationPlug do
   import Plug.Conn
 
-  alias Pleroma.Plugs.OAuthScopesPlug
-  alias Pleroma.Plugs.RateLimiter
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.RateLimiter
 
   def init(options) do
     options
similarity index 94%
rename from lib/pleroma/plugs/authentication_plug.ex
rename to lib/pleroma/web/plugs/authentication_plug.ex
index 057ea42f152f5e098a05708ff5d3b8b3571a576f..e2a8b1b69366062b8571f861ed17db1e56fd403c 100644 (file)
@@ -2,8 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.AuthenticationPlug do
-  alias Pleroma.Plugs.OAuthScopesPlug
+defmodule Pleroma.Web.Plugs.AuthenticationPlug do
   alias Pleroma.User
 
   import Plug.Conn
@@ -65,7 +64,7 @@ defmodule Pleroma.Plugs.AuthenticationPlug do
 
       conn
       |> assign(:user, auth_user)
-      |> OAuthScopesPlug.skip_plug()
+      |> Pleroma.Web.Plugs.OAuthScopesPlug.skip_plug()
     else
       conn
     end
similarity index 92%
rename from lib/pleroma/plugs/basic_auth_decoder_plug.ex
rename to lib/pleroma/web/plugs/basic_auth_decoder_plug.ex
index af7ecb0d8ff009e32d016d5af8cb697b67619b75..4dadfb0004526355f704f60ee7c4962b94225f3e 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.BasicAuthDecoderPlug do
+defmodule Pleroma.Web.Plugs.BasicAuthDecoderPlug do
   import Plug.Conn
 
   def init(options) do
similarity index 96%
rename from lib/pleroma/plugs/cache.ex
rename to lib/pleroma/web/plugs/cache.ex
index f65c2a1893daf81df4ac265638d121ad1badde45..6de01804afd71623ee6b1e8dbd8f603ee1d39f93 100644 (file)
@@ -2,19 +2,19 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.Cache do
+defmodule Pleroma.Web.Plugs.Cache do
   @moduledoc """
   Caches successful GET responses.
 
   To enable the cache add the plug to a router pipeline or controller:
 
-      plug(Pleroma.Plugs.Cache)
+      plug(Pleroma.Web.Plugs.Cache)
 
   ## Configuration
 
   To configure the plug you need to pass settings as the second argument to the `plug/2` macro:
 
-      plug(Pleroma.Plugs.Cache, [ttl: nil, query_params: true])
+      plug(Pleroma.Web.Plugs.Cache, [ttl: nil, query_params: true])
 
   Available options:
 
similarity index 94%
rename from lib/pleroma/plugs/ensure_authenticated_plug.ex
rename to lib/pleroma/web/plugs/ensure_authenticated_plug.ex
index 3fe5508060730e6d40f96860ad774e42896af65d..ea2af6881ff801ecd1b2af85c6bb9b0cef9067ed 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.EnsureAuthenticatedPlug do
+defmodule Pleroma.Web.Plugs.EnsureAuthenticatedPlug do
   import Plug.Conn
   import Pleroma.Web.TranslationHelpers
 
similarity index 91%
rename from lib/pleroma/plugs/ensure_public_or_authenticated_plug.ex
rename to lib/pleroma/web/plugs/ensure_public_or_authenticated_plug.ex
index 7265bb87aaa0a158f94c9da3dc16260fd1fa4d28..3bebdac6db6e983cfeeafe4a018f3db035fcca07 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug do
+defmodule Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug do
   import Pleroma.Web.TranslationHelpers
   import Plug.Conn
 
similarity index 87%
rename from lib/pleroma/plugs/ensure_user_key_plug.ex
rename to lib/pleroma/web/plugs/ensure_user_key_plug.ex
index 9795cdbdeb0927472ed04f8c3fe0073899c6f9ef..70d3091f0268623735b1675d5a498e4108961ea9 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.EnsureUserKeyPlug do
+defmodule Pleroma.Web.Plugs.EnsureUserKeyPlug do
   import Plug.Conn
 
   def init(opts) do
similarity index 71%
rename from lib/pleroma/plugs/expect_authenticated_check_plug.ex
rename to lib/pleroma/web/plugs/expect_authenticated_check_plug.ex
index 66b8d5de5f2ef0ba63ec72b58a1fe789727c0728..0925ded4d791bf9dfbca9b6182a8de8de8f69517 100644 (file)
@@ -2,9 +2,9 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.ExpectAuthenticatedCheckPlug do
+defmodule Pleroma.Web.Plugs.ExpectAuthenticatedCheckPlug do
   @moduledoc """
-  Marks `Pleroma.Plugs.EnsureAuthenticatedPlug` as expected to be executed later in plug chain.
+  Marks `Pleroma.Web.Plugs.EnsureAuthenticatedPlug` as expected to be executed later in plug chain.
 
   No-op plug which affects `Pleroma.Web` operation (is checked with `PlugHelper.plug_called?/2`).
   """
similarity index 70%
rename from lib/pleroma/plugs/expect_public_or_authenticated_check_plug.ex
rename to lib/pleroma/web/plugs/expect_public_or_authenticated_check_plug.ex
index ba0ef76bdc549b52fe490ccd265d3968048c7621..ace512a78625deac63c333f89f18a2ee67511701 100644 (file)
@@ -2,9 +2,9 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.ExpectPublicOrAuthenticatedCheckPlug do
+defmodule Pleroma.Web.Plugs.ExpectPublicOrAuthenticatedCheckPlug do
   @moduledoc """
-  Marks `Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug` as expected to be executed later in plug
+  Marks `Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug` as expected to be executed later in plug
   chain.
 
   No-op plug which affects `Pleroma.Web` operation (is checked with `PlugHelper.plug_called?/2`).
similarity index 93%
rename from lib/pleroma/plugs/federating_plug.ex
rename to lib/pleroma/web/plugs/federating_plug.ex
index 09038f3c6142f87b4e6c0e5174418bc20bdba6e2..3c90a7644bc053fb1266baab74c485b0caa2c4d6 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.FederatingPlug do
+defmodule Pleroma.Web.Plugs.FederatingPlug do
   import Plug.Conn
 
   def init(options) do
similarity index 96%
rename from lib/pleroma/plugs/frontend_static.ex
rename to lib/pleroma/web/plugs/frontend_static.ex
index 11a0d538222e051ec99abba2f512fca3a04f3b5c..ceb10dcf87a253431f77fdf5a38d38257cd949f9 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.FrontendStatic do
+defmodule Pleroma.Web.Plugs.FrontendStatic do
   require Pleroma.Constants
 
   @moduledoc """
similarity index 99%
rename from lib/pleroma/plugs/http_security_plug.ex
rename to lib/pleroma/web/plugs/http_security_plug.ex
index c363b193b8573fc290000c4b4ebc47882506bf3d..45aaf188e6b3039d12f2573c8d81ed721de364dc 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.HTTPSecurityPlug do
+defmodule Pleroma.Web.Plugs.HTTPSecurityPlug do
   alias Pleroma.Config
   import Plug.Conn
 
similarity index 97%
rename from lib/pleroma/plugs/idempotency_plug.ex
rename to lib/pleroma/web/plugs/idempotency_plug.ex
index f413970751bc4361423af16a7cfe90fb8fca74dc..254a790b0b6d17d53a7fa0f635b62bcccdfb2056 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.IdempotencyPlug do
+defmodule Pleroma.Web.Plugs.IdempotencyPlug do
   import Phoenix.Controller, only: [json: 2]
   import Plug.Conn
 
similarity index 91%
rename from lib/pleroma/plugs/instance_static.ex
rename to lib/pleroma/web/plugs/instance_static.ex
index 0fb57e42257f5927cd6c7e6299782d8526ff9c4f..54b9175df1ff0dc6d8e500e31829d1998a6b806a 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.InstanceStatic do
+defmodule Pleroma.Web.Plugs.InstanceStatic do
   require Pleroma.Constants
 
   @moduledoc """
@@ -16,7 +16,7 @@ defmodule Pleroma.Plugs.InstanceStatic do
     instance_path =
       Path.join(Pleroma.Config.get([:instance, :static_dir], "instance/static/"), path)
 
-    frontend_path = Pleroma.Plugs.FrontendStatic.file_path(path, :primary)
+    frontend_path = Pleroma.Web.Plugs.FrontendStatic.file_path(path, :primary)
 
     (File.exists?(instance_path) && instance_path) ||
       (frontend_path && File.exists?(frontend_path) && frontend_path) ||
similarity index 87%
rename from lib/pleroma/plugs/legacy_authentication_plug.ex
rename to lib/pleroma/web/plugs/legacy_authentication_plug.ex
index d346e01a6fd515263239bc725a369bdd248fc8fd..2a54d0b5905c2a88841bce78015a2c3debc84415 100644 (file)
@@ -2,10 +2,9 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.LegacyAuthenticationPlug do
+defmodule Pleroma.Web.Plugs.LegacyAuthenticationPlug do
   import Plug.Conn
 
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
 
   def init(options) do
@@ -29,7 +28,7 @@ defmodule Pleroma.Plugs.LegacyAuthenticationPlug do
       conn
       |> assign(:auth_user, user)
       |> assign(:user, user)
-      |> OAuthScopesPlug.skip_plug()
+      |> Pleroma.Web.Plugs.OAuthScopesPlug.skip_plug()
     else
       _ ->
         conn
similarity index 98%
rename from lib/pleroma/plugs/oauth_plug.ex
rename to lib/pleroma/web/plugs/o_auth_plug.ex
index 6fa71ef47ca57bdd6ad21e23e9d96f9753eee09f..c7b58d90fa7dd20d28959c1664b782a38c9d74fe 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.OAuthPlug do
+defmodule Pleroma.Web.Plugs.OAuthPlug do
   import Plug.Conn
   import Ecto.Query
 
similarity index 97%
rename from lib/pleroma/plugs/oauth_scopes_plug.ex
rename to lib/pleroma/web/plugs/o_auth_scopes_plug.ex
index b1a736d78ad2cf02727dd049769bc9937ae3f5c1..cfc30837c0244bc579dd7adafde57915f7950686 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.OAuthScopesPlug do
+defmodule Pleroma.Web.Plugs.OAuthScopesPlug do
   import Plug.Conn
   import Pleroma.Web.Gettext
 
similarity index 97%
rename from lib/pleroma/plugs/plug_helper.ex
rename to lib/pleroma/web/plugs/plug_helper.ex
index 9c67be8ef9e740cb3c5625ddf61336a0a092f432..b314e759603902831bf729988adf92350cf24b22 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.PlugHelper do
+defmodule Pleroma.Web.Plugs.PlugHelper do
   @moduledoc "Pleroma Plug helper"
 
   @called_plugs_list_id :called_plugs
similarity index 93%
rename from lib/pleroma/plugs/rate_limiter/rate_limiter.ex
rename to lib/pleroma/web/plugs/rate_limiter.ex
index c51e2c6349e19b35d2ba11c9c2b45309a6a7d908..a589610d1997824a4ef11501e2f7afdf8e10cb79 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.RateLimiter do
+defmodule Pleroma.Web.Plugs.RateLimiter do
   @moduledoc """
 
   ## Configuration
@@ -35,8 +35,8 @@ defmodule Pleroma.Plugs.RateLimiter do
 
   AllowedSyntax:
 
-      plug(Pleroma.Plugs.RateLimiter, name: :limiter_name)
-      plug(Pleroma.Plugs.RateLimiter, options)   # :name is a required option
+      plug(Pleroma.Web.Plugs.RateLimiter, name: :limiter_name)
+      plug(Pleroma.Web.Plugs.RateLimiter, options)   # :name is a required option
 
   Allowed options:
 
@@ -46,11 +46,11 @@ defmodule Pleroma.Plugs.RateLimiter do
 
   Inside a controller:
 
-      plug(Pleroma.Plugs.RateLimiter, [name: :one] when action == :one)
-      plug(Pleroma.Plugs.RateLimiter, [name: :two] when action in [:two, :three])
+      plug(Pleroma.Web.Plugs.RateLimiter, [name: :one] when action == :one)
+      plug(Pleroma.Web.Plugs.RateLimiter, [name: :two] when action in [:two, :three])
 
       plug(
-        Pleroma.Plugs.RateLimiter,
+        Pleroma.Web.Plugs.RateLimiter,
         [name: :status_id_action, bucket_name: "status_id_action:fav_unfav", params: ["id"]]
         when action in ~w(fav_status unfav_status)a
       )
@@ -59,7 +59,7 @@ defmodule Pleroma.Plugs.RateLimiter do
 
       pipeline :api do
         ...
-        plug(Pleroma.Plugs.RateLimiter, name: :one)
+        plug(Pleroma.Web.Plugs.RateLimiter, name: :one)
         ...
       end
   """
@@ -67,8 +67,8 @@ defmodule Pleroma.Plugs.RateLimiter do
   import Plug.Conn
 
   alias Pleroma.Config
-  alias Pleroma.Plugs.RateLimiter.LimiterSupervisor
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.RateLimiter.LimiterSupervisor
 
   require Logger
 
similarity index 95%
rename from lib/pleroma/plugs/rate_limiter/limiter_supervisor.ex
rename to lib/pleroma/web/plugs/rate_limiter/limiter_supervisor.ex
index 0bf5aadfb56fe6f2e4b7b7a53927ad2b038e3a2e..5642bb205394c65d1c609dd3d3ab34e39ebb8c7a 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.RateLimiter.LimiterSupervisor do
+defmodule Pleroma.Web.Plugs.RateLimiter.LimiterSupervisor do
   use DynamicSupervisor
 
   import Cachex.Spec
similarity index 80%
rename from lib/pleroma/plugs/rate_limiter/supervisor.ex
rename to lib/pleroma/web/plugs/rate_limiter/supervisor.ex
index ce196df528768d5a2080a4cb9d02a9ed606a4cf5..a1c84063dc5dc6de04ec377cfedff83146a3b90e 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.RateLimiter.Supervisor do
+defmodule Pleroma.Web.Plugs.RateLimiter.Supervisor do
   use Supervisor
 
   def start_link(opts) do
@@ -11,7 +11,7 @@ defmodule Pleroma.Plugs.RateLimiter.Supervisor do
 
   def init(_args) do
     children = [
-      Pleroma.Plugs.RateLimiter.LimiterSupervisor
+      Pleroma.Web.Plugs.RateLimiter.LimiterSupervisor
     ]
 
     opts = [strategy: :one_for_one, name: Pleroma.Web.Streamer.Supervisor]
similarity index 97%
rename from lib/pleroma/plugs/remote_ip.ex
rename to lib/pleroma/web/plugs/remote_ip.ex
index 987022156fdf440ef1ad7f5d2d7e88087d677322..401e2cbfadfb85ca8cfe040adc6aa182a017fa7a 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.RemoteIp do
+defmodule Pleroma.Web.Plugs.RemoteIp do
   @moduledoc """
   This is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
   """
similarity index 89%
rename from lib/pleroma/plugs/session_authentication_plug.ex
rename to lib/pleroma/web/plugs/session_authentication_plug.ex
index 0f83a5e532d4947e7f66f051a5680dba1b87a2d8..6e176d5537d12bcac64c5ad69c63ec9ad1c1cb64 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.SessionAuthenticationPlug do
+defmodule Pleroma.Web.Plugs.SessionAuthenticationPlug do
   import Plug.Conn
 
   def init(options) do
similarity index 92%
rename from lib/pleroma/plugs/set_format_plug.ex
rename to lib/pleroma/web/plugs/set_format_plug.ex
index c03fcb28dda71b51cf13f0bca796cbddf383a349..c16d2f81d49e2ccc543c837aa8ab83d4c8463159 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.SetFormatPlug do
+defmodule Pleroma.Web.Plugs.SetFormatPlug do
   import Plug.Conn, only: [assign: 3, fetch_query_params: 1]
 
   def init(_), do: nil
similarity index 97%
rename from lib/pleroma/plugs/set_locale_plug.ex
rename to lib/pleroma/web/plugs/set_locale_plug.ex
index 9a21d0a9d5c7c399602b8ccce2ffe4c515f854dd..d9d24b93fc36096ad38d357ea7c6cb586e61472d 100644 (file)
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: AGPL-3.0-only
 
 # NOTE: this module is based on https://github.com/smeevil/set_locale
-defmodule Pleroma.Plugs.SetLocalePlug do
+defmodule Pleroma.Web.Plugs.SetLocalePlug do
   import Plug.Conn, only: [get_req_header: 2, assign: 3]
 
   def init(_), do: nil
similarity index 87%
rename from lib/pleroma/plugs/set_user_session_id_plug.ex
rename to lib/pleroma/web/plugs/set_user_session_id_plug.ex
index 730c4ac742bb1fef3549dcbddd3e881ee20c4dad..e520159e4aaa5211e254e47c9e610a18bc80e307 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.SetUserSessionIdPlug do
+defmodule Pleroma.Web.Plugs.SetUserSessionIdPlug do
   import Plug.Conn
   alias Pleroma.User
 
similarity index 93%
rename from lib/pleroma/plugs/static_fe_plug.ex
rename to lib/pleroma/web/plugs/static_fe_plug.ex
index 143665c71b0756c2913d578fdaea3751bdbb49c9..658a1052e53ecc649e34256514b55709e4e54f54 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.StaticFEPlug do
+defmodule Pleroma.Web.Plugs.StaticFEPlug do
   import Plug.Conn
   alias Pleroma.Web.StaticFE.StaticFEController
 
similarity index 95%
rename from lib/pleroma/plugs/trailing_format_plug.ex
rename to lib/pleroma/web/plugs/trailing_format_plug.ex
index 8b4d5fc9fe29eb3f022c67bea1427d8e07d45cbb..e3f57c14a90e7ff9837f1bd01e4a5080b980fc5f 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.TrailingFormatPlug do
+defmodule Pleroma.Web.Plugs.TrailingFormatPlug do
   @moduledoc "Calls TrailingFormatPlug for specific paths. Ideally we would just do this in the router, but TrailingFormatPlug needs to be called before Plug.Parsers."
 
   @behaviour Plug
similarity index 98%
rename from lib/pleroma/plugs/uploaded_media.ex
rename to lib/pleroma/web/plugs/uploaded_media.ex
index 40984cfc06b618bfadae5ad0f1f09452023b45fe..402a8bb34c3d4b71f2decde632902601227c7041 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.UploadedMedia do
+defmodule Pleroma.Web.Plugs.UploadedMedia do
   @moduledoc """
   """
 
similarity index 90%
rename from lib/pleroma/plugs/user_enabled_plug.ex
rename to lib/pleroma/web/plugs/user_enabled_plug.ex
index 23e800a74740c6c3ccee0d130400857522985ba4..fa28ee48b7179c0ffa661529f5392e30c4591091 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.UserEnabledPlug do
+defmodule Pleroma.Web.Plugs.UserEnabledPlug do
   import Plug.Conn
   alias Pleroma.User
 
similarity index 91%
rename from lib/pleroma/plugs/user_fetcher_plug.ex
rename to lib/pleroma/web/plugs/user_fetcher_plug.ex
index 235c77d854e27cf80a01049030ec4eb343b3787a..4039600daff9ecae0d135f2ff798ef62441956ea 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.UserFetcherPlug do
+defmodule Pleroma.Web.Plugs.UserFetcherPlug do
   alias Pleroma.User
   import Plug.Conn
 
similarity index 91%
rename from lib/pleroma/plugs/user_is_admin_plug.ex
rename to lib/pleroma/web/plugs/user_is_admin_plug.ex
index 488a61d1d4940304423694a94c8127a43a8ca139..531c965f06151ce6390c1f30612485300f7f9ea2 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.UserIsAdminPlug do
+defmodule Pleroma.Web.Plugs.UserIsAdminPlug do
   import Pleroma.Web.TranslationHelpers
   import Plug.Conn
 
similarity index 97%
rename from lib/pleroma/web/preload/instance.ex
rename to lib/pleroma/web/preload/providers/instance.ex
index cc6f8cf99804d099e08adfd3eb43bac33eab59c5..a549bb1eb088a558e30b941687c72a4584d568d8 100644 (file)
@@ -3,9 +3,9 @@
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.Preload.Providers.Instance do
-  alias Pleroma.Plugs.InstanceStatic
   alias Pleroma.Web.MastodonAPI.InstanceView
   alias Pleroma.Web.Nodeinfo.Nodeinfo
+  alias Pleroma.Web.Plugs.InstanceStatic
   alias Pleroma.Web.Preload.Providers.Provider
   alias Pleroma.Web.TwitterAPI.UtilView
 
similarity index 71%
rename from lib/pleroma/web/rich_media/parsers/ttl/ttl.ex
rename to lib/pleroma/web/rich_media/parser/ttl.ex
index 13511888c23b5f856030eb3f7fb69e3cac7909ff..8353f0fff0e28812f37b30b888365c3df5f739c7 100644 (file)
@@ -3,5 +3,5 @@
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.RichMedia.Parser.TTL do
-  @callback ttl(Map.t(), String.t()) :: {:ok, Integer.t()} | {:error, String.t()}
+  @callback ttl(Map.t(), String.t()) :: Integer.t() | nil
 end
similarity index 96%
rename from lib/pleroma/web/rich_media/parsers/ttl/aws_signed_url.ex
rename to lib/pleroma/web/rich_media/parser/ttl/aws_signed_url.ex
index 15109d28de39022892917ab2b1eec44a53b578fb..fc4ef79c0c19ddac74a56e2cf93f7de154f3c2cb 100644 (file)
@@ -5,7 +5,7 @@
 defmodule Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl do
   @behaviour Pleroma.Web.RichMedia.Parser.TTL
 
-  @impl Pleroma.Web.RichMedia.Parser.TTL
+  @impl true
   def ttl(data, _url) do
     image = Map.get(data, :image)
 
index e22b31b4c2a47f0b46eb1807c58fd9b24c675059..d2d93998965e8592cd72429abacd96b46a7e88d0 100644 (file)
@@ -12,31 +12,31 @@ defmodule Pleroma.Web.Router do
 
   pipeline :oauth do
     plug(:fetch_session)
-    plug(Pleroma.Plugs.OAuthPlug)
-    plug(Pleroma.Plugs.UserEnabledPlug)
+    plug(Pleroma.Web.Plugs.OAuthPlug)
+    plug(Pleroma.Web.Plugs.UserEnabledPlug)
   end
 
   pipeline :expect_authentication do
-    plug(Pleroma.Plugs.ExpectAuthenticatedCheckPlug)
+    plug(Pleroma.Web.Plugs.ExpectAuthenticatedCheckPlug)
   end
 
   pipeline :expect_public_instance_or_authentication do
-    plug(Pleroma.Plugs.ExpectPublicOrAuthenticatedCheckPlug)
+    plug(Pleroma.Web.Plugs.ExpectPublicOrAuthenticatedCheckPlug)
   end
 
   pipeline :authenticate do
-    plug(Pleroma.Plugs.OAuthPlug)
-    plug(Pleroma.Plugs.BasicAuthDecoderPlug)
-    plug(Pleroma.Plugs.UserFetcherPlug)
-    plug(Pleroma.Plugs.SessionAuthenticationPlug)
-    plug(Pleroma.Plugs.LegacyAuthenticationPlug)
-    plug(Pleroma.Plugs.AuthenticationPlug)
+    plug(Pleroma.Web.Plugs.OAuthPlug)
+    plug(Pleroma.Web.Plugs.BasicAuthDecoderPlug)
+    plug(Pleroma.Web.Plugs.UserFetcherPlug)
+    plug(Pleroma.Web.Plugs.SessionAuthenticationPlug)
+    plug(Pleroma.Web.Plugs.LegacyAuthenticationPlug)
+    plug(Pleroma.Web.Plugs.AuthenticationPlug)
   end
 
   pipeline :after_auth do
-    plug(Pleroma.Plugs.UserEnabledPlug)
-    plug(Pleroma.Plugs.SetUserSessionIdPlug)
-    plug(Pleroma.Plugs.EnsureUserKeyPlug)
+    plug(Pleroma.Web.Plugs.UserEnabledPlug)
+    plug(Pleroma.Web.Plugs.SetUserSessionIdPlug)
+    plug(Pleroma.Web.Plugs.EnsureUserKeyPlug)
   end
 
   pipeline :base_api do
@@ -50,25 +50,25 @@ defmodule Pleroma.Web.Router do
     plug(:expect_public_instance_or_authentication)
     plug(:base_api)
     plug(:after_auth)
-    plug(Pleroma.Plugs.IdempotencyPlug)
+    plug(Pleroma.Web.Plugs.IdempotencyPlug)
   end
 
   pipeline :authenticated_api do
     plug(:expect_authentication)
     plug(:base_api)
     plug(:after_auth)
-    plug(Pleroma.Plugs.EnsureAuthenticatedPlug)
-    plug(Pleroma.Plugs.IdempotencyPlug)
+    plug(Pleroma.Web.Plugs.EnsureAuthenticatedPlug)
+    plug(Pleroma.Web.Plugs.IdempotencyPlug)
   end
 
   pipeline :admin_api do
     plug(:expect_authentication)
     plug(:base_api)
-    plug(Pleroma.Plugs.AdminSecretAuthenticationPlug)
+    plug(Pleroma.Web.Plugs.AdminSecretAuthenticationPlug)
     plug(:after_auth)
-    plug(Pleroma.Plugs.EnsureAuthenticatedPlug)
-    plug(Pleroma.Plugs.UserIsAdminPlug)
-    plug(Pleroma.Plugs.IdempotencyPlug)
+    plug(Pleroma.Web.Plugs.EnsureAuthenticatedPlug)
+    plug(Pleroma.Web.Plugs.UserIsAdminPlug)
+    plug(Pleroma.Web.Plugs.IdempotencyPlug)
   end
 
   pipeline :mastodon_html do
@@ -80,7 +80,7 @@ defmodule Pleroma.Web.Router do
   pipeline :pleroma_html do
     plug(:browser)
     plug(:authenticate)
-    plug(Pleroma.Plugs.EnsureUserKeyPlug)
+    plug(Pleroma.Web.Plugs.EnsureUserKeyPlug)
   end
 
   pipeline :well_known do
@@ -568,7 +568,7 @@ defmodule Pleroma.Web.Router do
 
   pipeline :ostatus do
     plug(:accepts, ["html", "xml", "rss", "atom", "activity+json", "json"])
-    plug(Pleroma.Plugs.StaticFEPlug)
+    plug(Pleroma.Web.Plugs.StaticFEPlug)
   end
 
   pipeline :oembed do
@@ -737,7 +737,7 @@ defmodule Pleroma.Web.Router do
     get("/check_password", MongooseIMController, :check_password)
   end
 
-  scope "/", Fallback do
+  scope "/", Pleroma.Web.Fallback do
     get("/registration/:token", RedirectController, :registration_page)
     get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
     get("/api*path", RedirectController, :api_not_implemented)
index a7a891b133ea6e8fd28b7601cb7d31385803f7f0..687b17df6c18e67fa5441c031e6f4df71d1e0edf 100644 (file)
@@ -17,8 +17,8 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do
   plug(:put_view, Pleroma.Web.StaticFE.StaticFEView)
   plug(:assign_id)
 
-  plug(Pleroma.Plugs.EnsureAuthenticatedPlug,
-    unless_func: &Pleroma.Web.FederatingPlug.federating?/1
+  plug(Pleroma.Web.Plugs.EnsureAuthenticatedPlug,
+    unless_func: &Pleroma.Web.Plugs.FederatingPlug.federating?/1
   )
 
   @page_keys ["max_id", "min_id", "limit", "since_id", "order"]
similarity index 99%
rename from lib/pleroma/web/streamer/streamer.ex
rename to lib/pleroma/web/streamer.ex
index 5475f18a6d1e7b2878262a3fbb5d2b4285dad069..d618dfe54a93b74bf6fd9bb81b7151893b591500 100644 (file)
@@ -11,12 +11,12 @@ defmodule Pleroma.Web.Streamer do
   alias Pleroma.Conversation.Participation
   alias Pleroma.Notification
   alias Pleroma.Object
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
   alias Pleroma.Web.ActivityPub.ActivityPub
   alias Pleroma.Web.ActivityPub.Visibility
   alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.OAuth.Token
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.Web.StreamerView
 
   @mix_env Mix.env()
similarity index 96%
rename from lib/pleroma/web/twitter_api/twitter_api_controller.ex
rename to lib/pleroma/web/twitter_api/controller.ex
index c2de26b0ba9da42e15cb95c3575beff5ceccc63a..f42dba4421773eff5fe860c94bd6f82a7a847fd9 100644 (file)
@@ -6,10 +6,10 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
   use Pleroma.Web, :controller
 
   alias Pleroma.Notification
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
   alias Pleroma.Web.OAuth.Token
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.Web.TwitterAPI.TokenView
 
   require Logger
index 072d889e2e54e7a9b5bdd105ce95e6290490ae0a..4480a4922b2801a35c3d7c1c74f462219ebe594c 100644 (file)
@@ -10,7 +10,6 @@ defmodule Pleroma.Web.TwitterAPI.RemoteFollowController do
   alias Pleroma.Activity
   alias Pleroma.MFA
   alias Pleroma.Object.Fetcher
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
   alias Pleroma.Web.Auth.Authenticator
   alias Pleroma.Web.Auth.TOTPAuthenticator
@@ -18,11 +17,11 @@ defmodule Pleroma.Web.TwitterAPI.RemoteFollowController do
 
   @status_types ["Article", "Event", "Note", "Video", "Page", "Question"]
 
-  plug(Pleroma.Web.FederatingPlug)
+  plug(Pleroma.Web.Plugs.FederatingPlug)
 
   # Note: follower can submit the form (with password auth) not being signed in (having no token)
   plug(
-    OAuthScopesPlug,
+    Pleroma.Web.Plugs.OAuthScopesPlug,
     %{fallback: :proceed_unauthenticated, scopes: ["follow", "write:follows"]}
     when action in [:do_follow]
   )
index 6d827846d1a9bca97bd54c2393982347c6b98b2f..9ead0d6263a1b6078cf09a7d46d32f7dbb73c992 100644 (file)
@@ -11,12 +11,12 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
   alias Pleroma.Emoji
   alias Pleroma.Healthcheck
   alias Pleroma.Notification
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.User
   alias Pleroma.Web.CommonAPI
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
   alias Pleroma.Web.WebFinger
 
-  plug(Pleroma.Web.FederatingPlug when action == :remote_subscribe)
+  plug(Pleroma.Web.Plugs.FederatingPlug when action == :remote_subscribe)
 
   plug(
     OAuthScopesPlug,
index 7077b20d231da60a58a5d51e663b1fb1d96530e9..9f0938fc0004f7fce42bef86c4319d56b7a8b5ed 100644 (file)
@@ -7,8 +7,8 @@ defmodule Pleroma.Web.WebFinger.WebFingerController do
 
   alias Pleroma.Web.WebFinger
 
-  plug(Pleroma.Plugs.SetFormatPlug)
-  plug(Pleroma.Web.FederatingPlug)
+  plug(Pleroma.Web.Plugs.SetFormatPlug)
+  plug(Pleroma.Web.Plugs.FederatingPlug)
 
   def host_meta(conn, _params) do
     xml = WebFinger.host_meta()
diff --git a/priv/repo/migrations/20200919182636_remoteip_plug_rename.exs b/priv/repo/migrations/20200919182636_remoteip_plug_rename.exs
new file mode 100644 (file)
index 0000000..77c3b6d
--- /dev/null
@@ -0,0 +1,19 @@
+defmodule Pleroma.Repo.Migrations.RemoteipPlugRename do
+  use Ecto.Migration
+
+  import Ecto.Query
+
+  def up do
+    config =
+      from(c in Pleroma.ConfigDB, where: c.group == ^:pleroma and c.key == ^Pleroma.Plugs.RemoteIp)
+      |> Pleroma.Repo.one()
+
+    if config do
+      config
+      |> Ecto.Changeset.change(key: Pleroma.Web.Plugs.RemoteIp)
+      |> Pleroma.Repo.update()
+    end
+  end
+
+  def down, do: :ok
+end
index f11032b576a2bf7868727fcc33bbd13ba8b557bc..e348c499ec5823a6129dc4cd5ad16ef7b77180b0 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule RuntimeModule do
+defmodule Fixtures.Modules.RuntimeModule do
   @moduledoc """
   This is a dummy module to test custom runtime modules.
   """
similarity index 98%
rename from test/tasks/frontend_test.exs
rename to test/mix/tasks/pleroma/frontend_test.exs
index 022ae51be1a7cb8864906889b26c5b39a782417e..6f9ec14cd3657510eac5d0f06e20cf252dce1561 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.FrontendTest do
+defmodule Mix.Tasks.Pleroma.FrontendTest do
   use Pleroma.DataCase
   alias Mix.Tasks.Pleroma.Frontend
 
similarity index 98%
rename from test/tasks/instance_test.exs
rename to test/mix/tasks/pleroma/instance_test.exs
index 914ccb10a1ed1851e75f4a10ceb1d6d032611454..8a02710ee2b336e7aed49b167de6217c711c6500 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.InstanceTest do
+defmodule Mix.Tasks.Pleroma.InstanceTest do
   use ExUnit.Case
 
   setup do
similarity index 81%
rename from test/application_requirements_test.exs
rename to test/pleroma/application_requirements_test.exs
index 21d24ddd069514d2aa67f3855e9ecc21ddddd79a..c505ae229c552aa9a6e8f83bfc4c82c8ae6ff769 100644 (file)
@@ -4,9 +4,12 @@
 
 defmodule Pleroma.ApplicationRequirementsTest do
   use Pleroma.DataCase
+
   import ExUnit.CaptureLog
   import Mock
 
+  alias Pleroma.ApplicationRequirements
+  alias Pleroma.Config
   alias Pleroma.Repo
 
   describe "check_welcome_message_config!/1" do
@@ -70,42 +73,42 @@ defmodule Pleroma.ApplicationRequirementsTest do
     setup do: clear_config([:database, :rum_enabled])
 
     test "raises if rum is enabled and detects unapplied rum migrations" do
-      Pleroma.Config.put([:database, :rum_enabled], true)
+      Config.put([:database, :rum_enabled], true)
 
       with_mocks([{Repo, [:passthrough], [exists?: fn _, _ -> false end]}]) do
-        assert_raise Pleroma.ApplicationRequirements.VerifyError,
+        assert_raise ApplicationRequirements.VerifyError,
                      "Unapplied RUM Migrations detected",
                      fn ->
-                       capture_log(&Pleroma.ApplicationRequirements.verify!/0)
+                       capture_log(&ApplicationRequirements.verify!/0)
                      end
       end
     end
 
     test "raises if rum is disabled and detects rum migrations" do
-      Pleroma.Config.put([:database, :rum_enabled], false)
+      Config.put([:database, :rum_enabled], false)
 
       with_mocks([{Repo, [:passthrough], [exists?: fn _, _ -> true end]}]) do
-        assert_raise Pleroma.ApplicationRequirements.VerifyError,
+        assert_raise ApplicationRequirements.VerifyError,
                      "RUM Migrations detected",
                      fn ->
-                       capture_log(&Pleroma.ApplicationRequirements.verify!/0)
+                       capture_log(&ApplicationRequirements.verify!/0)
                      end
       end
     end
 
     test "doesn't do anything if rum enabled and applied migrations" do
-      Pleroma.Config.put([:database, :rum_enabled], true)
+      Config.put([:database, :rum_enabled], true)
 
       with_mocks([{Repo, [:passthrough], [exists?: fn _, _ -> true end]}]) do
-        assert Pleroma.ApplicationRequirements.verify!() == :ok
+        assert ApplicationRequirements.verify!() == :ok
       end
     end
 
     test "doesn't do anything if rum disabled" do
-      Pleroma.Config.put([:database, :rum_enabled], false)
+      Config.put([:database, :rum_enabled], false)
 
       with_mocks([{Repo, [:passthrough], [exists?: fn _, _ -> false end]}]) do
-        assert Pleroma.ApplicationRequirements.verify!() == :ok
+        assert ApplicationRequirements.verify!() == :ok
       end
     end
   end
@@ -130,17 +133,17 @@ defmodule Pleroma.ApplicationRequirementsTest do
     setup do: clear_config([:i_am_aware_this_may_cause_data_loss, :disable_migration_check])
 
     test "raises if it detects unapplied migrations" do
-      assert_raise Pleroma.ApplicationRequirements.VerifyError,
+      assert_raise ApplicationRequirements.VerifyError,
                    "Unapplied Migrations detected",
                    fn ->
-                     capture_log(&Pleroma.ApplicationRequirements.verify!/0)
+                     capture_log(&ApplicationRequirements.verify!/0)
                    end
     end
 
     test "doesn't do anything if disabled" do
-      Pleroma.Config.put([:i_am_aware_this_may_cause_data_loss, :disable_migration_check], true)
+      Config.put([:i_am_aware_this_may_cause_data_loss, :disable_migration_check], true)
 
-      assert :ok == Pleroma.ApplicationRequirements.verify!()
+      assert :ok == ApplicationRequirements.verify!()
     end
   end
 end
similarity index 98%
rename from test/config/deprecation_warnings_test.exs
rename to test/pleroma/config/deprecation_warnings_test.exs
index 02ada1aab117ba1d0f33656b836d2b9a8d541ada..0cfed45557dd65ecd1d5159e508971d94f3082c8 100644 (file)
@@ -87,7 +87,7 @@ defmodule Pleroma.Config.DeprecationWarningsTest do
   end
 
   test "check_activity_expiration_config/0" do
-    clear_config([Pleroma.ActivityExpiration, :enabled], true)
+    clear_config(Pleroma.ActivityExpiration, enabled: true)
 
     assert capture_log(fn ->
              DeprecationWarnings.check_activity_expiration_config()
similarity index 92%
rename from test/web/activity_pub/object_validators/types/date_time_test.exs
rename to test/pleroma/ecto_type/activity_pub/object_validators/date_time_test.exs
index 10310c801e1faa8e3de229f8e808dd0e31780a2d..8124634547b5b8071556013f81ff5dd179392056 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.ActivityPub.ObjectValidators.Types.DateTimeTest do
+defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.DateTimeTest do
   alias Pleroma.EctoType.ActivityPub.ObjectValidators.DateTime
   use Pleroma.DataCase
 
similarity index 92%
rename from test/web/activity_pub/object_validators/types/object_id_test.exs
rename to test/pleroma/ecto_type/activity_pub/object_validators/object_id_test.exs
index e0ab7637944e522638ed5eb5a10b7906db7d69c2..732e2365ff91f52eaa60e8070f16aeb2fe218f1f 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.ObjectValidators.Types.ObjectIDTest do
+defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.ObjectIDTest do
   alias Pleroma.EctoType.ActivityPub.ObjectValidators.ObjectID
   use Pleroma.DataCase
 
similarity index 93%
rename from test/web/activity_pub/object_validators/types/recipients_test.exs
rename to test/pleroma/ecto_type/activity_pub/object_validators/recipients_test.exs
index c09265f0d367d4e99305e30622105e2b3b7e619f..2e6a0c83d45089134d4a87e50a44e024648fa62b 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.ObjectValidators.Types.RecipientsTest do
+defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.RecipientsTest do
   alias Pleroma.EctoType.ActivityPub.ObjectValidators.Recipients
   use Pleroma.DataCase
 
similarity index 92%
rename from test/web/activity_pub/object_validators/types/safe_text_test.exs
rename to test/pleroma/ecto_type/activity_pub/object_validators/safe_text_test.exs
index 9c08606f6419aed0d164108685ba21838f3482f3..7eddd2388e9f750a005781db654a8a379628dc3c 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.ActivityPub.ObjectValidators.Types.SafeTextTest do
+defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.SafeTextTest do
   use Pleroma.DataCase
 
   alias Pleroma.EctoType.ActivityPub.ObjectValidators.SafeText
similarity index 100%
rename from test/mfa_test.exs
rename to test/pleroma/mfa_test.exs
similarity index 69%
rename from test/runtime_test.exs
rename to test/pleroma/runtime_test.exs
index a1a6c57cd0fd9e5c1d1ae6664c728045c95d6107..010594fcd111ee87a64c8d5dea58fcf6de7e91cd 100644 (file)
@@ -6,6 +6,7 @@ defmodule Pleroma.RuntimeTest do
   use ExUnit.Case, async: true
 
   test "it loads custom runtime modules" do
-    assert {:module, RuntimeModule} == Code.ensure_compiled(RuntimeModule)
+    assert {:module, Fixtures.Modules.RuntimeModule} ==
+             Code.ensure_compiled(Fixtures.Modules.RuntimeModule)
   end
 end
similarity index 97%
rename from test/web/activity_pub/object_validators/announce_validation_test.exs
rename to test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs
index 623342f76e0b5b10cd0e2726f2c2d79df99d19f9..4771c4698d20e41ad320c20ef688da9e0df03a07 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.ActivityPub.ObjectValidators.AnnouncValidationTest do
+defmodule Pleroma.Web.ActivityPub.ObjectValidators.AnnounceValidationTest do
   use Pleroma.DataCase
 
   alias Pleroma.Object
similarity index 99%
rename from test/web/auth/auth_test_controller_test.exs
rename to test/pleroma/web/auth/auth_controller_test.exs
index fed52b7f3361b9c88d1b9a71cae8609ed436690e..49855406011ee6fc2aa52706e834ece45fd33193 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Tests.AuthTestControllerTest do
+defmodule Pleroma.Web.Auth.AuthControllerTest do
   use Pleroma.Web.ConnCase
 
   import Pleroma.Factory
similarity index 98%
rename from test/web/feed/user_controller_test.exs
rename to test/pleroma/web/feed/user_controller_test.exs
index 9a5610baa9bd78ae47cbfe3ef8e232e81dad7030..a5dc0894beab1534cd289bf24139a043157ae883 100644 (file)
@@ -206,7 +206,7 @@ defmodule Pleroma.Web.Feed.UserControllerTest do
         |> response(200)
 
       assert response ==
-               Fallback.RedirectController.redirector_with_meta(
+               Pleroma.Web.Fallback.RedirectController.redirector_with_meta(
                  conn,
                  %{user: user}
                ).resp_body
similarity index 97%
rename from test/web/masto_fe_controller_test.exs
rename to test/pleroma/web/mastodon_api/masto_fe_controller_test.exs
index f3b54b5f2cb36ec163c17ad7df93bdb62a77d7fb..ed8add8d21077961bdcc3446f6a542f5680fe033 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.MastodonAPI.MastoFEController do
+defmodule Pleroma.Web.MastodonAPI.MastoFEControllerTest do
   use Pleroma.Web.ConnCase
 
   alias Pleroma.Config
similarity index 99%
rename from test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs
rename to test/pleroma/web/mastodon_api/update_credentials_test.exs
index d31cc27cc88344cfa5cac26836d6fed7ac377b3b..383d351cf02704799c1c6f6292f557c1730fa36a 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
+defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do
   alias Pleroma.Repo
   alias Pleroma.User
 
similarity index 97%
rename from test/web/mongooseim/mongoose_im_controller_test.exs
rename to test/pleroma/web/mongoose_im_controller_test.exs
index 5176cde84d153e3c55df7a1873196997f2cbabcb..e3a8aa3d872a082c1bc7b8a1e69f396bfcd87247 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.MongooseIMController do
+defmodule Pleroma.Web.MongooseIMControllerTest do
   use Pleroma.Web.ConnCase
   import Pleroma.Factory
 
similarity index 97%
rename from test/web/pleroma_api/views/chat/message_reference_view_test.exs
rename to test/pleroma/web/pleroma_api/views/chat_message_reference_view_test.exs
index 40dbae3cd4e9b35cabbdbef711901aadc5acfd13..26272c12513ffefeb363b0b8725fc631ef220971 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.PleromaAPI.Chat.MessageReferenceViewTest do
+defmodule Pleroma.Web.PleromaAPI.ChatMessageReferenceViewTest do
   use Pleroma.DataCase
 
   alias Pleroma.Chat
similarity index 91%
rename from test/web/pleroma_api/views/scrobble_view_test.exs
rename to test/pleroma/web/pleroma_api/views/scrobble_view_test.exs
index 6bdb565099035460607581c3853eb5c7098ae2d3..0f43cbdc3adedd0f5a5980932658891fb872f25c 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.PleromaAPI.StatusViewTest do
+defmodule Pleroma.Web.PleromaAPI.ScrobbleViewTest do
   use Pleroma.DataCase
 
   alias Pleroma.Web.PleromaAPI.ScrobbleView
similarity index 88%
rename from test/plugs/admin_secret_authentication_plug_test.exs
rename to test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs
index 14094eda81f870733da05548d3168ff97aa99574..33394722a5e39da6d63581834067391042ab2ab8 100644 (file)
@@ -2,16 +2,16 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.AdminSecretAuthenticationPlugTest do
+defmodule Pleroma.Web.Plugs.AdminSecretAuthenticationPlugTest do
   use Pleroma.Web.ConnCase
 
   import Mock
   import Pleroma.Factory
 
-  alias Pleroma.Plugs.AdminSecretAuthenticationPlug
-  alias Pleroma.Plugs.OAuthScopesPlug
-  alias Pleroma.Plugs.PlugHelper
-  alias Pleroma.Plugs.RateLimiter
+  alias Pleroma.Web.Plugs.AdminSecretAuthenticationPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.PlugHelper
+  alias Pleroma.Web.Plugs.RateLimiter
 
   test "does nothing if a user is assigned", %{conn: conn} do
     user = insert(:user)
similarity index 93%
rename from test/plugs/authentication_plug_test.exs
rename to test/pleroma/web/plugs/authentication_plug_test.exs
index 777ae15aeb076f47b6a64a7da634dac1df950b77..af39352e261a39bcf5a349e678352e49d5d5cebd 100644 (file)
@@ -2,13 +2,13 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.AuthenticationPlugTest do
+defmodule Pleroma.Web.Plugs.AuthenticationPlugTest do
   use Pleroma.Web.ConnCase, async: true
 
-  alias Pleroma.Plugs.AuthenticationPlug
-  alias Pleroma.Plugs.OAuthScopesPlug
-  alias Pleroma.Plugs.PlugHelper
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.AuthenticationPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.PlugHelper
 
   import ExUnit.CaptureLog
   import Pleroma.Factory
@@ -118,7 +118,7 @@ defmodule Pleroma.Plugs.AuthenticationPlugTest do
         "psBWV8gxkGOZWBz$PmfCycChoxeJ3GgGzwvhlgacb9mUoZ.KUXNCssekER4SJ7bOK53uXrHNb2e4i8yPFgSKyzaW9CcmrDXWIEMtD1"
 
       assert capture_log(fn ->
-               refute Pleroma.Plugs.AuthenticationPlug.checkpw("password", hash)
+               refute AuthenticationPlug.checkpw("password", hash)
              end) =~ "[error] Password hash not recognized"
     end
   end
similarity index 89%
rename from test/plugs/basic_auth_decoder_plug_test.exs
rename to test/pleroma/web/plugs/basic_auth_decoder_plug_test.exs
index a6063d4f6bc1bbe4b0aad984ec2b8243409309ae..2d6af228cf757fcc00294fd57388cdfda2301d9f 100644 (file)
@@ -2,10 +2,10 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.BasicAuthDecoderPlugTest do
+defmodule Pleroma.Web.Plugs.BasicAuthDecoderPlugTest do
   use Pleroma.Web.ConnCase, async: true
 
-  alias Pleroma.Plugs.BasicAuthDecoderPlug
+  alias Pleroma.Web.Plugs.BasicAuthDecoderPlug
 
   defp basic_auth_enc(username, password) do
     "Basic " <> Base.encode64("#{username}:#{password}")
similarity index 92%
rename from test/plugs/cache_control_test.exs
rename to test/pleroma/web/plugs/cache_control_test.exs
index 6b567e81d70319a1e7e62d01ba20c2649508c18a..fcf3d2be80f9b99418bf14f85818e1e71ac35537 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.CacheControlTest do
+defmodule Pleroma.Web.Plugs.CacheControlTest do
   use Pleroma.Web.ConnCase
   alias Plug.Conn
 
similarity index 98%
rename from test/plugs/cache_test.exs
rename to test/pleroma/web/plugs/cache_test.exs
index 8b231c88163a6c9ce5df71c3ae0c68e3e3531893..93a66f5d30bba870188ad8d63b1ea7f3a95fe9da 100644 (file)
@@ -2,11 +2,11 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.CacheTest do
+defmodule Pleroma.Web.Plugs.CacheTest do
   use ExUnit.Case, async: true
   use Plug.Test
 
-  alias Pleroma.Plugs.Cache
+  alias Pleroma.Web.Plugs.Cache
 
   @miss_resp {200,
               [
similarity index 96%
rename from test/plugs/ensure_authenticated_plug_test.exs
rename to test/pleroma/web/plugs/ensure_authenticated_plug_test.exs
index a0667c5e024e7f57afd51b5f6b165b863c2ecdd0..92ff192824931f810bcbe524fab7f28ff717051a 100644 (file)
@@ -2,11 +2,11 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.EnsureAuthenticatedPlugTest do
+defmodule Pleroma.Web.Plugs.EnsureAuthenticatedPlugTest do
   use Pleroma.Web.ConnCase, async: true
 
-  alias Pleroma.Plugs.EnsureAuthenticatedPlug
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.EnsureAuthenticatedPlug
 
   describe "without :if_func / :unless_func options" do
     test "it halts if user is NOT assigned", %{conn: conn} do
similarity index 89%
rename from test/plugs/ensure_public_or_authenticated_plug_test.exs
rename to test/pleroma/web/plugs/ensure_public_or_authenticated_plug_test.exs
index fc2934369b573101a209c0cc7f868ed92656ddd9..211443a55033f91bfd88d928a267c6c838cf8ec5 100644 (file)
@@ -2,12 +2,12 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.EnsurePublicOrAuthenticatedPlugTest do
+defmodule Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlugTest do
   use Pleroma.Web.ConnCase, async: true
 
   alias Pleroma.Config
-  alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug
 
   setup do: clear_config([:instance, :public])
 
similarity index 86%
rename from test/plugs/ensure_user_key_plug_test.exs
rename to test/pleroma/web/plugs/ensure_user_key_plug_test.exs
index 633c054471d48114e90b345d5b41cd82b0d5bf42..f912ef7550a8e0f13fb5cafef87252ca840792fd 100644 (file)
@@ -2,10 +2,10 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.EnsureUserKeyPlugTest do
+defmodule Pleroma.Web.Plugs.EnsureUserKeyPlugTest do
   use Pleroma.Web.ConnCase, async: true
 
-  alias Pleroma.Plugs.EnsureUserKeyPlug
+  alias Pleroma.Web.Plugs.EnsureUserKeyPlug
 
   test "if the conn has a user key set, it does nothing", %{conn: conn} do
     conn =
similarity index 80%
rename from test/web/plugs/federating_plug_test.exs
rename to test/pleroma/web/plugs/federating_plug_test.exs
index 2f8aadadcfac1d98a605ade71b302265f0083d5b..a4652f6c5e008a411bcc550c41bc601e9854c74e 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.FederatingPlugTest do
+defmodule Pleroma.Web.Plugs.FederatingPlugTest do
   use Pleroma.Web.ConnCase
 
   setup do: clear_config([:instance, :federating])
@@ -12,7 +12,7 @@ defmodule Pleroma.Web.FederatingPlugTest do
 
     conn =
       build_conn()
-      |> Pleroma.Web.FederatingPlug.call(%{})
+      |> Pleroma.Web.Plugs.FederatingPlug.call(%{})
 
     assert conn.status == 404
     assert conn.halted
@@ -23,7 +23,7 @@ defmodule Pleroma.Web.FederatingPlugTest do
 
     conn =
       build_conn()
-      |> Pleroma.Web.FederatingPlug.call(%{})
+      |> Pleroma.Web.Plugs.FederatingPlug.call(%{})
 
     refute conn.status
     refute conn.halted
similarity index 92%
rename from test/plugs/frontend_static_test.exs
rename to test/pleroma/web/plugs/frontend_static_plug_test.exs
index 6f49230481e80763475e0909ff973cc2c57ba69f..f6f7d7bdbec45e4382e9ae56a0d4e3d901e3847b 100644 (file)
@@ -2,8 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.FrontendStaticPlugTest do
-  alias Pleroma.Plugs.FrontendStatic
+defmodule Pleroma.Web.Plugs.FrontendStaticPlugTest do
   use Pleroma.Web.ConnCase
 
   @dir "test/tmp/instance_static"
@@ -21,7 +20,7 @@ defmodule Pleroma.Web.FrontendStaticPlugTest do
         at: "/admin",
         frontend_type: :admin
       ]
-      |> FrontendStatic.init()
+      |> Pleroma.Web.Plugs.FrontendStatic.init()
 
     assert opts[:at] == ["admin"]
     assert opts[:frontend_type] == :admin
similarity index 97%
rename from test/plugs/idempotency_plug_test.exs
rename to test/pleroma/web/plugs/idempotency_plug_test.exs
index 21fa0fbcf40a62009604062e2bf193465765b188..4a7835993324159dda0e11b170189f4abf200c7f 100644 (file)
@@ -2,11 +2,11 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.IdempotencyPlugTest do
+defmodule Pleroma.Web.Plugs.IdempotencyPlugTest do
   use ExUnit.Case, async: true
   use Plug.Test
 
-  alias Pleroma.Plugs.IdempotencyPlug
+  alias Pleroma.Web.Plugs.IdempotencyPlug
   alias Plug.Conn
 
   test "returns result from cache" do
similarity index 97%
rename from test/plugs/instance_static_test.exs
rename to test/pleroma/web/plugs/instance_static_test.exs
index d42ba817efd87366e412f21b07a7dbb98fd11c4e..5b30011d30dbaff9de56e897039e7c24a983f603 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.InstanceStaticPlugTest do
+defmodule Pleroma.Web.Plugs.InstanceStaticTest do
   use Pleroma.Web.ConnCase
 
   @dir "test/tmp/instance_static"
similarity index 90%
rename from test/plugs/legacy_authentication_plug_test.exs
rename to test/pleroma/web/plugs/legacy_authentication_plug_test.exs
index 3b8c07627e20fe11ff31e06161fd192fc89aa69d..2016a31a8dc2e51a38246294c359f7a5b5c646f1 100644 (file)
@@ -2,15 +2,15 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.LegacyAuthenticationPlugTest do
+defmodule Pleroma.Web.Plugs.LegacyAuthenticationPlugTest do
   use Pleroma.Web.ConnCase
 
   import Pleroma.Factory
 
-  alias Pleroma.Plugs.LegacyAuthenticationPlug
-  alias Pleroma.Plugs.OAuthScopesPlug
-  alias Pleroma.Plugs.PlugHelper
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.LegacyAuthenticationPlug
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
+  alias Pleroma.Web.Plugs.PlugHelper
 
   setup do
     user =
similarity index 96%
rename from test/plugs/oauth_plug_test.exs
rename to test/pleroma/web/plugs/o_auth_plug_test.exs
index 9d39d31533b0f8053f926e23e087789e5e63a0cf..b9d722f7624c43de5992b6102c3a45ce220cef71 100644 (file)
@@ -2,10 +2,10 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.OAuthPlugTest do
+defmodule Pleroma.Web.Plugs.OAuthPlugTest do
   use Pleroma.Web.ConnCase, async: true
 
-  alias Pleroma.Plugs.OAuthPlug
+  alias Pleroma.Web.Plugs.OAuthPlug
   import Pleroma.Factory
 
   @session_opts [
similarity index 98%
rename from test/plugs/oauth_scopes_plug_test.exs
rename to test/pleroma/web/plugs/o_auth_scopes_plug_test.exs
index 334316043cfcfe914e87917d1c55fdb9b00bafe5..982a70bf95616441b2bf18430995ca58994718bf 100644 (file)
@@ -2,11 +2,11 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.OAuthScopesPlugTest do
+defmodule Pleroma.Web.Plugs.OAuthScopesPlugTest do
   use Pleroma.Web.ConnCase
 
-  alias Pleroma.Plugs.OAuthScopesPlug
   alias Pleroma.Repo
+  alias Pleroma.Web.Plugs.OAuthScopesPlug
 
   import Mock
   import Pleroma.Factory
similarity index 94%
rename from test/web/plugs/plug_test.exs
rename to test/pleroma/web/plugs/plug_helper_test.exs
index 943e484e73ef57b848d4a732a77a0970bc9b0526..670d699f0348e37c4f808e66a5d98d6cd51a606f 100644 (file)
@@ -2,12 +2,12 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.PlugTest do
+defmodule Pleroma.Web.Plugs.PlugHelperTest do
   @moduledoc "Tests for the functionality added via `use Pleroma.Web, :plug`"
 
-  alias Pleroma.Plugs.ExpectAuthenticatedCheckPlug
-  alias Pleroma.Plugs.ExpectPublicOrAuthenticatedCheckPlug
-  alias Pleroma.Plugs.PlugHelper
+  alias Pleroma.Web.Plugs.ExpectAuthenticatedCheckPlug
+  alias Pleroma.Web.Plugs.ExpectPublicOrAuthenticatedCheckPlug
+  alias Pleroma.Web.Plugs.PlugHelper
 
   import Mock
 
similarity index 98%
rename from test/plugs/rate_limiter_test.exs
rename to test/pleroma/web/plugs/rate_limiter_test.exs
index 4d3d694f41d995c9008150fab1d8077580fb41bd..249c78b3757b7ba562383ec011d530e531d65716 100644 (file)
@@ -2,12 +2,12 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.RateLimiterTest do
+defmodule Pleroma.Web.Plugs.RateLimiterTest do
   use Pleroma.Web.ConnCase
 
   alias Phoenix.ConnTest
   alias Pleroma.Config
-  alias Pleroma.Plugs.RateLimiter
+  alias Pleroma.Web.Plugs.RateLimiter
   alias Plug.Conn
 
   import Pleroma.Factory
@@ -19,7 +19,7 @@ defmodule Pleroma.Plugs.RateLimiterTest do
 
   describe "config" do
     @limiter_name :test_init
-    setup do: clear_config([Pleroma.Plugs.RemoteIp, :enabled])
+    setup do: clear_config([Pleroma.Web.Plugs.RemoteIp, :enabled])
 
     test "config is required for plug to work" do
       Config.put([:rate_limit, @limiter_name], {1, 1})
similarity index 97%
rename from test/plugs/remote_ip_test.exs
rename to test/pleroma/web/plugs/remote_ip_test.exs
index 6d01c812de291379aab4c9c6c1f7fb1cf515f2ce..0bdb4c168757618578be6980d2ae0e3b34905d67 100644 (file)
@@ -2,11 +2,11 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.RemoteIpTest do
+defmodule Pleroma.Web.Plugs.RemoteIpTest do
   use ExUnit.Case
   use Plug.Test
 
-  alias Pleroma.Plugs.RemoteIp
+  alias Pleroma.Web.Plugs.RemoteIp
 
   import Pleroma.Tests.Helpers, only: [clear_config: 2]
 
similarity index 92%
rename from test/plugs/session_authentication_plug_test.exs
rename to test/pleroma/web/plugs/session_authentication_plug_test.exs
index 0949ecfede817b9cbd5592684f0d47492f379a2b..2b4d5bc0cfacc9f1a93f17169cc0b181e872e43d 100644 (file)
@@ -2,11 +2,11 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.SessionAuthenticationPlugTest do
+defmodule Pleroma.Web.Plugs.SessionAuthenticationPlugTest do
   use Pleroma.Web.ConnCase, async: true
 
-  alias Pleroma.Plugs.SessionAuthenticationPlug
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.SessionAuthenticationPlug
 
   setup %{conn: conn} do
     session_opts = [
similarity index 89%
rename from test/plugs/set_format_plug_test.exs
rename to test/pleroma/web/plugs/set_format_plug_test.exs
index 7a1dfe9bfa26f8e72e71106ad806bd080d79a6f3..e95d751fac8fd72ca8f149395edfae1d4f38ed08 100644 (file)
@@ -2,11 +2,11 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.SetFormatPlugTest do
+defmodule Pleroma.Web.Plugs.SetFormatPlugTest do
   use ExUnit.Case, async: true
   use Plug.Test
 
-  alias Pleroma.Plugs.SetFormatPlug
+  alias Pleroma.Web.Plugs.SetFormatPlug
 
   test "set format from params" do
     conn =
similarity index 92%
rename from test/plugs/set_locale_plug_test.exs
rename to test/pleroma/web/plugs/set_locale_plug_test.exs
index 7114b155727c0c298a454256786fd34310835058..773f48a5bcd7a62ab7b8fd0bfb68d61d021e3db7 100644 (file)
@@ -2,11 +2,11 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.SetLocalePlugTest do
+defmodule Pleroma.Web.Plugs.SetLocalePlugTest do
   use ExUnit.Case, async: true
   use Plug.Test
 
-  alias Pleroma.Plugs.SetLocalePlug
+  alias Pleroma.Web.Plugs.SetLocalePlug
   alias Plug.Conn
 
   test "default locale is `en`" do
similarity index 90%
rename from test/plugs/set_user_session_id_plug_test.exs
rename to test/pleroma/web/plugs/set_user_session_id_plug_test.exs
index 7f1a1e98bcdba313c8df7e9314ba3e943671a00a..a89b5628fb0e3b0791e05215b50461b3857d6e49 100644 (file)
@@ -2,11 +2,11 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.SetUserSessionIdPlugTest do
+defmodule Pleroma.Web.Plugs.SetUserSessionIdPlugTest do
   use Pleroma.Web.ConnCase, async: true
 
-  alias Pleroma.Plugs.SetUserSessionIdPlug
   alias Pleroma.User
+  alias Pleroma.Web.Plugs.SetUserSessionIdPlug
 
   setup %{conn: conn} do
     session_opts = [
similarity index 95%
rename from test/plugs/uploaded_media_plug_test.exs
rename to test/pleroma/web/plugs/uploaded_media_plug_test.exs
index 20b13dfac8cb348d4450dc03c4a1dd84ba2d54ca..07f52c8cd0b3195aa4a9e645fb2b4dc9411ee0da 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.UploadedMediaPlugTest do
+defmodule Pleroma.Web.Plugs.UploadedMediaPlugTest do
   use Pleroma.Web.ConnCase
   alias Pleroma.Upload
 
similarity index 93%
rename from test/plugs/user_enabled_plug_test.exs
rename to test/pleroma/web/plugs/user_enabled_plug_test.exs
index b219d8abffa35f759470dccedbefbba9ceddb7f6..71c56f03a4d2a6c86a566a8f1c314ba633fa1f0a 100644 (file)
@@ -2,10 +2,10 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.UserEnabledPlugTest do
+defmodule Pleroma.Web.Plugs.UserEnabledPlugTest do
   use Pleroma.Web.ConnCase, async: true
 
-  alias Pleroma.Plugs.UserEnabledPlug
+  alias Pleroma.Web.Plugs.UserEnabledPlug
   import Pleroma.Factory
 
   setup do: clear_config([:instance, :account_activation_required])
similarity index 89%
rename from test/plugs/user_fetcher_plug_test.exs
rename to test/pleroma/web/plugs/user_fetcher_plug_test.exs
index 0496f14dd10b2a07be36a61f3e30e962d3794ef2..b4f875d2d6b44d4effad50e4a57c84b447699ef5 100644 (file)
@@ -2,10 +2,10 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.UserFetcherPlugTest do
+defmodule Pleroma.Web.Plugs.UserFetcherPlugTest do
   use Pleroma.Web.ConnCase, async: true
 
-  alias Pleroma.Plugs.UserFetcherPlug
+  alias Pleroma.Web.Plugs.UserFetcherPlug
   import Pleroma.Factory
 
   setup do
similarity index 89%
rename from test/plugs/user_is_admin_plug_test.exs
rename to test/pleroma/web/plugs/user_is_admin_plug_test.exs
index 8bc00e44497a58dafcdb48600fe07ca88880955f..b550568c1c085219ecb5c35b2a67e25119b16681 100644 (file)
@@ -2,10 +2,10 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.UserIsAdminPlugTest do
+defmodule Pleroma.Web.Plugs.UserIsAdminPlugTest do
   use Pleroma.Web.ConnCase, async: true
 
-  alias Pleroma.Plugs.UserIsAdminPlug
+  alias Pleroma.Web.Plugs.UserIsAdminPlug
   import Pleroma.Factory
 
   test "accepts a user that is an admin" do
similarity index 99%
rename from test/web/rich_media/helpers_test.exs
rename to test/pleroma/web/rich_media/helpers_test.exs
index 4b97bd66b6ffc32b9137ece09d2b7ad8642dfded..4c9ee77d0c60fa3010d3cdae14479b7c0ba64dbb 100644 (file)
@@ -6,7 +6,6 @@ defmodule Pleroma.Web.RichMedia.HelpersTest do
   use Pleroma.DataCase
 
   alias Pleroma.Config
-  alias Pleroma.Object
   alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.RichMedia.Helpers
 
similarity index 97%
rename from test/web/rich_media/aws_signed_url_test.exs
rename to test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs
index 1ceae1a31569adc673fec9b2308dc54861787d57..2f17bebd7279d718f64195bdf720bf47f9ecb578 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Web.RichMedia.TTL.AwsSignedUrlTest do
+defmodule Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrlTest do
   use ExUnit.Case, async: true
 
   test "s3 signed url is parsed correct for expiration time" do