Skip to content

Commit 3cc7ada

Browse files
Clean up
1 parent 7671ac2 commit 3cc7ada

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

deps/rabbitmq_auth_backend_oauth2/src/rabbit_auth_backend_oauth2.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ check_resource_access(#auth_user{impl = DecodedTokenFun},
101101
end).
102102

103103
check_topic_access(#auth_user{impl = DecodedTokenFun},
104-
Resource, Permission, Context) ->
104+
Resource, Permission, Context) ->
105105
with_decoded_token(DecodedTokenFun(),
106106
fun(Token) ->
107107
Scopes = get_expanded_scopes(Token, Resource),

deps/rabbitmq_auth_backend_oauth2/src/rabbit_oauth2_resource_server.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ resolve_resource_server_from_audience(Audience) ->
4848
case find_audience(Audience, AllowedResourceServerIds) of
4949
{error, aud_matched_many_resource_servers_only_one_allowed} = Error ->
5050
Error;
51-
{error, no_matching_aud_found} ->
51+
{error, no_matching_aud_found} ->
5252
translate_error_if_any(
5353
find_unique_resource_server_without_verify_aud(),
5454
true);

deps/rabbitmq_auth_backend_oauth2/src/rabbit_oauth2_scope.erl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ topic_access(#resource{virtual_host = VHost, name = ExchangeName},
4747
#{routing_key := RoutingKey},
4848
Scopes) ->
4949
lists:any(
50-
fun({VHostPattern, ExchangeNamePattern, RoutingKeyPattern, ScopeGrantedPermission}) ->
50+
fun({VHostPattern, ExchangeNamePattern, RoutingKeyPattern, ScopeGrantedPermission}) ->
5151
is_binary(RoutingKeyPattern) andalso
5252
wildcard:match(VHost, VHostPattern) andalso
5353
wildcard:match(ExchangeName, ExchangeNamePattern) andalso
@@ -62,11 +62,10 @@ topic_access(#resource{virtual_host = VHost, name = ExchangeName},
6262
get_scope_permissions(Scopes) when is_list(Scopes) ->
6363
lists:filtermap(
6464
fun(ScopeEl) ->
65-
Ret = case parse_permission_pattern(ScopeEl) of
65+
case parse_permission_pattern(ScopeEl) of
6666
ignore -> false;
6767
Perm -> {true, Perm}
68-
end,
69-
Ret
68+
end
7069
end,
7170
Scopes).
7271

@@ -89,7 +88,7 @@ parse_permission_pattern(_Other) ->
8988

9089
-spec parse_resource_pattern(binary(), permission()) ->
9190
{rabbit_types:vhost(), binary(), binary() | none, permission()} | 'ignore'.
92-
parse_resource_pattern(Pattern, Permission) ->
91+
parse_resource_pattern(Pattern, Permission) ->
9392
case binary:split(Pattern, <<"/">>, [global]) of
9493
[VhostPattern, NamePattern] ->
9594
{VhostPattern, NamePattern, none, Permission};

0 commit comments

Comments
 (0)