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-time.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-time.c')
-rw-r--r-- | src/mm-iface-modem-time.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mm-iface-modem-time.c b/src/mm-iface-modem-time.c index 53d03b30..4f9e7f3f 100644 --- a/src/mm-iface-modem-time.c +++ b/src/mm-iface-modem-time.c @@ -75,14 +75,15 @@ load_network_time_ready (MMIfaceModemTime *self, } static void -handle_get_network_time_auth_ready (MMBaseModem *self, +handle_get_network_time_auth_ready (MMIfaceAuth *_self, GAsyncResult *res, HandleGetNetworkTimeContext *ctx) { - MMModemState state; - GError *error = NULL; + MMIfaceModemTime *self = MM_IFACE_MODEM_TIME (_self); + MMModemState state; + 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_get_network_time_context_free (ctx); return; @@ -127,7 +128,7 @@ handle_get_network_time (MmGdbusModemTime *skeleton, ctx->skeleton = g_object_ref (skeleton); 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_TIME, (GAsyncReadyCallback)handle_get_network_time_auth_ready, |