feat: supports permission mode for static user provider (#7017)

* feat: supports permission mode for static user provider

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* chore: style

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: comment

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
dennis zhuang
2025-09-25 03:45:31 +00:00
committed by GitHub
co-authored by Copilot
parent 07b9de620e
commit 91a727790d
11 changed files with 614 additions and 33 deletions
+4 -1
View File
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use auth::UserProviderRef;
use auth::{DefaultPermissionChecker, PermissionCheckerRef, UserProviderRef};
use common_base::Plugins;
use frontend::error::{IllegalAuthConfigSnafu, Result};
use frontend::frontend::FrontendOptions;
@@ -29,6 +29,9 @@ pub async fn setup_frontend_plugins(
if let Some(user_provider) = fe_opts.user_provider.as_ref() {
let provider =
auth::user_provider_from_option(user_provider).context(IllegalAuthConfigSnafu)?;
let permission_checker = DefaultPermissionChecker::arc();
plugins.insert::<PermissionCheckerRef>(permission_checker);
plugins.insert::<UserProviderRef>(provider);
}
Ok(())