Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
9f4fe548
Verified
Commit
9f4fe548
authored
Jun 24, 2020
by
Alexander Strizhakov
Browse files
alias alphabetically order
parent
3ef4e9d1
Changes
47
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/bbs/authenticator.ex
View file @
9f4fe548
...
...
@@ -4,8 +4,8 @@
defmodule
Pleroma
.
BBS
.
Authenticator
do
use
Sshd
.
PasswordAuthenticator
alias
Pleroma
.
Web
.
Plugs
.
AuthenticationPlug
alias
Pleroma
.
User
alias
Pleroma
.
Web
.
Plugs
.
AuthenticationPlug
def
authenticate
(
username
,
password
)
do
username
=
to_string
(
username
)
...
...
lib/pleroma/tests/auth_test_controller.ex
View file @
9f4fe548
...
...
@@ -8,9 +8,9 @@ defmodule Pleroma.Tests.AuthTestController do
use
Pleroma
.
Web
,
:controller
alias
Pleroma
.
User
alias
Pleroma
.
Web
.
Plugs
.
EnsurePublicOrAuthenticatedPlug
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
alias
Pleroma
.
User
# Serves only with proper OAuth token (:api and :authenticated_api)
# Skipping EnsurePublicOrAuthenticatedPlug has no effect in this case
...
...
lib/pleroma/web/activity_pub/activity_pub_controller.ex
View file @
9f4fe548
...
...
@@ -9,7 +9,6 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
alias
Pleroma
.
Delivery
alias
Pleroma
.
Object
alias
Pleroma
.
Object
.
Fetcher
alias
Pleroma
.
Web
.
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
.
Plugs
.
FederatingPlug
alias
Pleroma
.
Web
.
Federator
alias
Pleroma
.
Web
.
Plugs
.
EnsureAuthenticatedPlug
alias
Pleroma
.
Web
.
Plugs
.
FederatingPlug
require
Logger
...
...
lib/pleroma/web/admin_api/controllers/admin_api_controller.ex
View file @
9f4fe548
...
...
@@ -10,7 +10,6 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
alias
Pleroma
.
Config
alias
Pleroma
.
MFA
alias
Pleroma
.
ModerationLog
alias
Pleroma
.
Web
.
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
...
...
lib/pleroma/web/admin_api/controllers/invite_controller.ex
View file @
9f4fe548
...
...
@@ -8,8 +8,8 @@ defmodule Pleroma.Web.AdminAPI.InviteController do
import
Pleroma
.
Web
.
ControllerHelper
,
only:
[
json_response:
3
]
alias
Pleroma
.
Config
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
alias
Pleroma
.
UserInviteToken
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
require
Logger
...
...
lib/pleroma/web/admin_api/controllers/media_proxy_cache_controller.ex
View file @
9f4fe548
...
...
@@ -5,9 +5,9 @@
defmodule
Pleroma
.
Web
.
AdminAPI
.
MediaProxyCacheController
do
use
Pleroma
.
Web
,
:controller
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
alias
Pleroma
.
Web
.
ApiSpec
.
Admin
,
as:
Spec
alias
Pleroma
.
Web
.
MediaProxy
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
plug
(
Pleroma
.
Web
.
ApiSpec
.
CastAndValidate
)
...
...
lib/pleroma/web/admin_api/controllers/o_auth_app_controller.ex
View file @
9f4fe548
...
...
@@ -7,8 +7,8 @@ defmodule Pleroma.Web.AdminAPI.OAuthAppController do
import
Pleroma
.
Web
.
ControllerHelper
,
only:
[
json_response:
3
]
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
alias
Pleroma
.
Web
.
OAuth
.
App
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
require
Logger
...
...
lib/pleroma/web/admin_api/controllers/relay_controller.ex
View file @
9f4fe548
...
...
@@ -6,8 +6,8 @@ defmodule Pleroma.Web.AdminAPI.RelayController do
use
Pleroma
.
Web
,
:controller
alias
Pleroma
.
ModerationLog
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
alias
Pleroma
.
Web
.
ActivityPub
.
Relay
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
require
Logger
...
...
lib/pleroma/web/admin_api/controllers/report_controller.ex
View file @
9f4fe548
...
...
@@ -9,12 +9,12 @@ defmodule Pleroma.Web.AdminAPI.ReportController do
alias
Pleroma
.
Activity
alias
Pleroma
.
ModerationLog
alias
Pleroma
.
Web
.
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
...
...
lib/pleroma/web/admin_api/controllers/status_controller.ex
View file @
9f4fe548
...
...
@@ -7,10 +7,10 @@ defmodule Pleroma.Web.AdminAPI.StatusController do
alias
Pleroma
.
Activity
alias
Pleroma
.
ModerationLog
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
alias
Pleroma
.
Web
.
ActivityPub
.
ActivityPub
alias
Pleroma
.
Web
.
CommonAPI
alias
Pleroma
.
Web
.
MastodonAPI
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
require
Logger
...
...
lib/pleroma/web/auth/pleroma_authenticator.ex
View file @
9f4fe548
...
...
@@ -3,10 +3,10 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma
.
Web
.
Auth
.
PleromaAuthenticator
do
alias
Pleroma
.
Web
.
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
]
...
...
lib/pleroma/web/auth/totp_authenticator.ex
View file @
9f4fe548
...
...
@@ -5,8 +5,8 @@
defmodule
Pleroma
.
Web
.
Auth
.
TOTPAuthenticator
do
alias
Pleroma
.
MFA
alias
Pleroma
.
MFA
.
TOTP
alias
Pleroma
.
Web
.
Plugs
.
AuthenticationPlug
alias
Pleroma
.
User
alias
Pleroma
.
Web
.
Plugs
.
AuthenticationPlug
@doc
"Verify code or check backup code."
@spec
verify
(
String
.
t
(),
User
.
t
())
::
...
...
lib/pleroma/web/common_api/utils.ex
View file @
9f4fe548
...
...
@@ -12,12 +12,12 @@ defmodule Pleroma.Web.CommonAPI.Utils do
alias
Pleroma
.
Conversation
.
Participation
alias
Pleroma
.
Formatter
alias
Pleroma
.
Object
alias
Pleroma
.
Web
.
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
...
...
lib/pleroma/web/feed/user_controller.ex
View file @
9f4fe548
...
...
@@ -24,7 +24,7 @@ def feed_redirect(%{assigns: %{format: format}} = conn, _params)
when
format
in
[
"json"
,
"activity+json"
]
do
with
%{
halted:
false
}
=
conn
<-
Pleroma
.
Web
.
Plugs
.
EnsureAuthenticatedPlug
.
call
(
conn
,
unless_func:
&
Pleroma
.
Web
.
FederatingPlug
.
federating?
/
1
unless_func:
&
Pleroma
.
Web
.
Plugs
.
FederatingPlug
.
federating?
/
1
)
do
ActivityPubController
.
call
(
conn
,
:user
)
end
...
...
lib/pleroma/web/masto_fe_controller.ex
View file @
9f4fe548
...
...
@@ -5,9 +5,9 @@
defmodule
Pleroma
.
Web
.
MastoFEController
do
use
Pleroma
.
Web
,
:controller
alias
Pleroma
.
User
alias
Pleroma
.
Web
.
Plugs
.
EnsurePublicOrAuthenticatedPlug
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
alias
Pleroma
.
User
plug
(
OAuthScopesPlug
,
%{
scopes:
[
"write:accounts"
]}
when
action
==
:put_settings
)
...
...
lib/pleroma/web/mastodon_api/controllers/account_controller.ex
View file @
9f4fe548
...
...
@@ -15,9 +15,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
]
alias
Pleroma
.
Maps
alias
Pleroma
.
Web
.
Plugs
.
EnsurePublicOrAuthenticatedPlug
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
alias
Pleroma
.
Web
.
Plugs
.
RateLimiter
alias
Pleroma
.
User
alias
Pleroma
.
Web
.
ActivityPub
.
ActivityPub
alias
Pleroma
.
Web
.
ActivityPub
.
Builder
...
...
@@ -29,6 +26,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
alias
Pleroma
.
Web
.
MastodonAPI
.
StatusView
alias
Pleroma
.
Web
.
OAuth
.
OAuthController
alias
Pleroma
.
Web
.
OAuth
.
OAuthView
alias
Pleroma
.
Web
.
OAuth
.
Token
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
)
...
...
lib/pleroma/web/mastodon_api/controllers/app_controller.ex
View file @
9f4fe548
...
...
@@ -5,12 +5,12 @@
defmodule
Pleroma
.
Web
.
MastodonAPI
.
AppController
do
use
Pleroma
.
Web
,
:controller
alias
Pleroma
.
Web
.
Plugs
.
EnsurePublicOrAuthenticatedPlug
alias
Pleroma
.
Web
.
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
)
...
...
lib/pleroma/web/mastodon_api/controllers/conversation_controller.ex
View file @
9f4fe548
...
...
@@ -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
.
Web
.
Plugs
.
OAuthScopesPlug
alias
Pleroma
.
Repo
alias
Pleroma
.
Web
.
Plugs
.
OAuthScopesPlug
action_fallback
(
Pleroma
.
Web
.
MastodonAPI
.
FallbackController
)
...
...
lib/pleroma/web/mastodon_api/controllers/domain_block_controller.ex
View file @
9f4fe548
...
...
@@ -5,8 +5,8 @@
defmodule
Pleroma
.
Web
.
MastodonAPI
.
DomainBlockController
do
use
Pleroma
.
Web
,
:controller
alias
Pleroma
.
Web
.
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
...
...
lib/pleroma/web/mastodon_api/controllers/follow_request_controller.ex
View file @
9f4fe548
...
...
@@ -5,9 +5,9 @@
defmodule
Pleroma
.
Web
.
MastodonAPI
.
FollowRequestController
do
use
Pleroma
.
Web
,
:controller
alias
Pleroma
.
Web
.
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
)
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment