# HG changeset patch # User Kim Alvefur # Date 1683738685 -7200 # Node ID 7480dde4cd2ebdf43ea4be9abc7b61a7480cb712 # Parent 533808db6c180d7d14dbf500be8e487e20fd305f mod_auth_oauth_external: Stub not implemented auth module methods Not providing some of these may trigger errors on use, which is something that would be nice to fix on the Prosody side, one day. diff -r 533808db6c18 -r 7480dde4cd2e mod_auth_oauth_external/mod_auth_oauth_external.lua --- a/mod_auth_oauth_external/mod_auth_oauth_external.lua Wed May 10 18:32:47 2023 +0200 +++ b/mod_auth_oauth_external/mod_auth_oauth_external.lua Wed May 10 19:11:25 2023 +0200 @@ -30,6 +30,32 @@ local host = module.host; local provider = {}; +local function not_implemented() + return nil, "method not implemented" +end + +-- With proper OAuth 2, most of these should be handled at the atuhorization +-- server, no there. +provider.test_password = not_implemented; +provider.get_password = not_implemented; +provider.set_password = not_implemented; +provider.create_user = not_implemented; +provider.delete_user = not_implemented; + +function provider.user_exists(_username) + -- Can this even be done in a generic way in OAuth 2? + -- OIDC and WebFinger perhaps? + return true; +end + +function provider.users() + -- TODO this could be done by recording known users locally + return function () + module:log("debug", "User iteration not supported"); + return nil; + end +end + function provider.get_sasl_handler() local profile = {}; profile.http_client = http.default; -- TODO configurable