From dd424c7656b4219a87e8323a141600e1d783e215 Mon Sep 17 00:00:00 2001 From: zhanghongtong Date: Mon, 28 Jun 2021 11:52:47 +0800 Subject: [PATCH] build: delete sasl plugin --- apps/emqx_sasl/src/emqx_sasl.app.src | 14 ------- apps/emqx_sasl/src/emqx_sasl.appup.src | 13 ------ apps/emqx_sasl/src/emqx_sasl.erl | 56 -------------------------- 3 files changed, 83 deletions(-) delete mode 100644 apps/emqx_sasl/src/emqx_sasl.app.src delete mode 100644 apps/emqx_sasl/src/emqx_sasl.appup.src delete mode 100644 apps/emqx_sasl/src/emqx_sasl.erl diff --git a/apps/emqx_sasl/src/emqx_sasl.app.src b/apps/emqx_sasl/src/emqx_sasl.app.src deleted file mode 100644 index f490a6af5..000000000 --- a/apps/emqx_sasl/src/emqx_sasl.app.src +++ /dev/null @@ -1,14 +0,0 @@ -{application, emqx_sasl, - [{description, "EMQ X SASL"}, - {vsn, "4.3.1"}, % strict semver, bump manually! - {modules, []}, - {registered, [emqx_sasl_sup]}, - {applications, [kernel,stdlib,pbkdf2]}, - {mod, {emqx_sasl_app,[]}}, - {env, []}, - {licenses, ["Apache-2.0"]}, - {maintainers, ["EMQ X Team "]}, - {links, [{"Homepage", "https://emqx.io/"}, - {"Github", "https://github.com/emqx/emqx-sasl"} - ]} - ]}. diff --git a/apps/emqx_sasl/src/emqx_sasl.appup.src b/apps/emqx_sasl/src/emqx_sasl.appup.src deleted file mode 100644 index df881fc05..000000000 --- a/apps/emqx_sasl/src/emqx_sasl.appup.src +++ /dev/null @@ -1,13 +0,0 @@ -%% -*-: erlang -*- -{VSN, - [ - {"4.3.0", [ - {restart_application, emqx_sasl} - ]} - ], - [ - {"4.3.0", [ - {restart_application, emqx_sasl} - ]} - ] -}. diff --git a/apps/emqx_sasl/src/emqx_sasl.erl b/apps/emqx_sasl/src/emqx_sasl.erl deleted file mode 100644 index 61fd34134..000000000 --- a/apps/emqx_sasl/src/emqx_sasl.erl +++ /dev/null @@ -1,56 +0,0 @@ -%%-------------------------------------------------------------------- -%% Copyright (c) 2020-2021 EMQ Technologies Co., Ltd. All Rights Reserved. -%% -%% Licensed under the Apache License, Version 2.0 (the "License"); -%% you may not use this file except in compliance with the License. -%% You may obtain a copy of the License at -%% -%% http://www.apache.org/licenses/LICENSE-2.0 -%% -%% Unless required by applicable law or agreed to in writing, software -%% distributed under the License is distributed on an "AS IS" BASIS, -%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -%% See the License for the specific language governing permissions and -%% limitations under the License. -%%-------------------------------------------------------------------- - --module(emqx_sasl). - --include_lib("emqx/include/logger.hrl"). - --export([ load/0 - , unload/0 - , init/0 - , check/3 - , supported/0 - ]). - -load() -> - emqx:hook('client.enhanced_authenticate', {?MODULE, check, []}). - -unload() -> - emqx:unhook('client.enhanced_authenticate', {?MODULE, check}). - -init() -> - emqx_sasl_scram:init(). - -check(Method, Data, Cache) -> - try - case Method of - <<"SCRAM-SHA-1">> -> - case emqx_sasl_scram:check(Data, Cache) of - {ok, NData, NCache} -> {ok, {ok, NData, NCache}}; - {continue, NData, NCache} -> {ok, {continue, NData, NCache}}; - Re -> {stop, Re} - end; - _ -> - {error, unsupported_mechanism} - end - catch - _Class:_Reason:Stack -> - ?LOG(error, "[emqx_sasl] authentication failed: ~0p", [Stack]), - {error, authentication_failed} - end. - -supported() -> - [<<"SCRAM-SHA-1">>].