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 <dan@ioncontrol.co>
This commit is contained in:
Dan Williams
2025-05-08 20:08:06 -05:00
parent 02942a04f9
commit 7262b46a82
2 changed files with 8 additions and 7 deletions
+8
View File
@@ -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 <polkit/polkit.h>
@@ -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;
-7
View File
@@ -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,