diff options
author | Dan Williams <dan@ioncontrol.co> | 2025-04-29 20:54:36 -0500 |
---|---|---|
committer | Dan Williams <dan@ioncontrol.co> | 2025-05-08 20:08:06 -0500 |
commit | ef5cee3ab578c2fde8ca6cc636f10acfdb79f123 (patch) | |
tree | 02510944a5782a9c4047234b747fdc02dd8f31c8 /src/mm-iface-modem-3gpp-ussd.c | |
parent | 7262b46a82642b7232ef922b827d77626a93eec0 (diff) |
auth-provider: move auth provider logic into each class
Rather than make all of them rely on MMBaseModem for it. This
lets us disentangle dependencies for easier unit testing.
For interfaces, rather than casting directly to MMBaseModem
use intermediate interfaces (MMIfaceAuth and MMIfaceOpLock)
that tests can fake out.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
Diffstat (limited to 'src/mm-iface-modem-3gpp-ussd.c')
-rw-r--r-- | src/mm-iface-modem-3gpp-ussd.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mm-iface-modem-3gpp-ussd.c b/src/mm-iface-modem-3gpp-ussd.c index 7a1be95c..484946ad 100644 --- a/src/mm-iface-modem-3gpp-ussd.c +++ b/src/mm-iface-modem-3gpp-ussd.c @@ -79,13 +79,13 @@ handle_cancel_ready (MMIfaceModem3gppUssd *self, } static void -handle_cancel_auth_ready (MMBaseModem *self, +handle_cancel_auth_ready (MMIfaceAuth *self, GAsyncResult *res, HandleCancelContext *ctx) { GError *error = NULL; - if (!mm_base_modem_authorize_finish (self, res, &error)) { + if (!mm_iface_auth_authorize_finish (self, res, &error)) { mm_dbus_method_invocation_take_error (ctx->invocation, error); handle_cancel_context_free (ctx); return; @@ -120,7 +120,7 @@ handle_cancel (MmGdbusModem3gppUssd *skeleton, ctx->invocation = g_object_ref (invocation); ctx->self = g_object_ref (self); - mm_base_modem_authorize (MM_BASE_MODEM (self), + mm_iface_auth_authorize (MM_IFACE_AUTH (self), invocation, MM_AUTHORIZATION_USSD, (GAsyncReadyCallback)handle_cancel_auth_ready, @@ -168,13 +168,13 @@ handle_respond_ready (MMIfaceModem3gppUssd *self, } static void -handle_respond_auth_ready (MMBaseModem *self, +handle_respond_auth_ready (MMIfaceAuth *self, GAsyncResult *res, HandleRespondContext *ctx) { GError *error = NULL; - if (!mm_base_modem_authorize_finish (self, res, &error)) { + if (!mm_iface_auth_authorize_finish (self, res, &error)) { mm_dbus_method_invocation_take_error (ctx->invocation, error); handle_respond_context_free (ctx); return; @@ -230,7 +230,7 @@ handle_respond (MmGdbusModem3gppUssd *skeleton, ctx->self = g_object_ref (self); ctx->command = g_strdup (command); - mm_base_modem_authorize (MM_BASE_MODEM (self), + mm_iface_auth_authorize (MM_IFACE_AUTH (self), invocation, MM_AUTHORIZATION_USSD, (GAsyncReadyCallback)handle_respond_auth_ready, @@ -278,13 +278,13 @@ handle_initiate_ready (MMIfaceModem3gppUssd *self, } static void -handle_initiate_auth_ready (MMBaseModem *self, +handle_initiate_auth_ready (MMIfaceAuth *self, GAsyncResult *res, HandleInitiateContext *ctx) { GError *error = NULL; - if (!mm_base_modem_authorize_finish (self, res, &error)) { + if (!mm_iface_auth_authorize_finish (self, res, &error)) { mm_dbus_method_invocation_take_error (ctx->invocation, error); handle_initiate_context_free (ctx); return; @@ -340,7 +340,7 @@ handle_initiate (MmGdbusModem3gppUssd *skeleton, ctx->self = g_object_ref (self); ctx->command = g_strdup (command); - mm_base_modem_authorize (MM_BASE_MODEM (self), + mm_iface_auth_authorize (MM_IFACE_AUTH (self), invocation, MM_AUTHORIZATION_USSD, (GAsyncReadyCallback)handle_initiate_auth_ready, |