@@ -46,24 +46,27 @@ user_login_authentication(Username, AuthProps) ->
46
46
Other -> {error , {bad_response , Other }}
47
47
end .
48
48
49
- % % When some protocols, such as MQTT, uses an internal AMQP client, to interact with RabbitMQ core,
50
- % % it happens that the main protocol authenticates the user passing all credentials (e.g. password, client_id, vhost)
51
- % % however the internal AMQP client also performs further authentications. THe latter authentication
52
- % % attempt lacks of all credentials. Instead those credentials are persisted behind a function call
49
+ % % When a protocol plugin uses an internal AMQP 0-9-1 client to interact with RabbitMQ core,
50
+ % % what happens that the plugin authenticates the entire authentication context (e.g. all of: password, client_id, vhost, etc)
51
+ % % and the internal AMQP 0-9-1 client also performs further authentication.
52
+ % %
53
+ % % In the latter case, the complete set of credentials are persisted behind a function call
53
54
% % that returns an AuthProps.
54
55
% % If the user was first authenticated by rabbit_auth_backend_http, there will be one property called
55
56
% % `rabbit_auth_backend_http` whose value is a function that returns a proplist with all the credentials used
56
57
% % on the first successful login.
57
- % % However, it may happen that the user was authenticated via rabbit_auth_backend_cache, in that case,
58
+ % %
59
+ % % When rabbit_auth_backend_cache is involved,
58
60
% % the property `rabbit_auth_backend_cache` is a function which returns a proplist with all the credentials used
59
- % % on the first succcessful login.
61
+ % % on the first successful login.
60
62
resolve_using_persisted_credentials (AuthProps ) ->
61
- case proplists :get_value (rabbit_auth_backend_http , AuthProps , none ) of
62
- none -> case proplists :get_value (rabbit_auth_backend_cache , AuthProps , none ) of
63
- none -> AuthProps ;
64
- CacheAuthPropsFun -> AuthProps ++ CacheAuthPropsFun ()
65
- end ;
66
- HttpAuthPropsFun -> AuthProps ++ HttpAuthPropsFun ()
63
+ case proplists :get_value (rabbit_auth_backend_http , AuthProps , undefined ) of
64
+ undefined ->
65
+ case proplists :get_value (rabbit_auth_backend_cache , AuthProps , undefined ) of
66
+ undefined -> AuthProps ;
67
+ CacheAuthPropsFun -> AuthProps ++ CacheAuthPropsFun ()
68
+ end ;
69
+ HttpAuthPropsFun -> AuthProps ++ HttpAuthPropsFun ()
67
70
end .
68
71
69
72
0 commit comments