From 7262b46a82642b7232ef922b827d77626a93eec0 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 17 Apr 2025 21:06:17 -0500 Subject: base-modem,auth-provider: move testcase auth bypass to auth provider The bypass when in testcase mode has nothing to do with the base modem class; so make it generic. Signed-off-by: Dan Williams --- src/mm-auth-provider.c | 8 ++++++++ src/mm-base-modem.c | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/mm-auth-provider.c b/src/mm-auth-provider.c index 5b4b13f3..38ec04d3 100644 --- a/src/mm-auth-provider.c +++ b/src/mm-auth-provider.c @@ -22,6 +22,7 @@ #include "mm-log-object.h" #include "mm-utils.h" #include "mm-auth-provider.h" +#include "mm-context.h" #if defined WITH_POLKIT # include @@ -128,6 +129,13 @@ mm_auth_provider_authorize (MMAuthProvider *self, task = g_task_new (self, cancellable, callback, user_data); + /* When running in the session bus for tests, default to always allow */ + if (mm_context_get_test_session ()) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } + #if defined WITH_POLKIT { AuthorizeContext *ctx; diff --git a/src/mm-base-modem.c b/src/mm-base-modem.c index 7e142327..6bf5b68d 100644 --- a/src/mm-base-modem.c +++ b/src/mm-base-modem.c @@ -1809,13 +1809,6 @@ mm_base_modem_authorize (MMBaseModem *self, task = g_task_new (self, self->priv->authp_cancellable, callback, user_data); - /* When running in the session bus for tests, default to always allow */ - if (mm_context_get_test_session ()) { - g_task_return_boolean (task, TRUE); - g_object_unref (task); - return; - } - mm_auth_provider_authorize (self->priv->authp, invocation, authorization, -- cgit v1.2.3-70-g09d2