comparison mod_auth_oauth_external/mod_auth_oauth_external.lua @ 5442:7480dde4cd2e

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.
author Kim Alvefur <zash@zash.se>
date Wed, 10 May 2023 19:11:25 +0200
parents 82a14082be3f
children 4e79f344ae2f
comparison
equal deleted inserted replaced
5441:533808db6c18 5442:7480dde4cd2e
27 } 27 }
28 --]] 28 --]]
29 29
30 local host = module.host; 30 local host = module.host;
31 local provider = {}; 31 local provider = {};
32
33 local function not_implemented()
34 return nil, "method not implemented"
35 end
36
37 -- With proper OAuth 2, most of these should be handled at the atuhorization
38 -- server, no there.
39 provider.test_password = not_implemented;
40 provider.get_password = not_implemented;
41 provider.set_password = not_implemented;
42 provider.create_user = not_implemented;
43 provider.delete_user = not_implemented;
44
45 function provider.user_exists(_username)
46 -- Can this even be done in a generic way in OAuth 2?
47 -- OIDC and WebFinger perhaps?
48 return true;
49 end
50
51 function provider.users()
52 -- TODO this could be done by recording known users locally
53 return function ()
54 module:log("debug", "User iteration not supported");
55 return nil;
56 end
57 end
32 58
33 function provider.get_sasl_handler() 59 function provider.get_sasl_handler()
34 local profile = {}; 60 local profile = {};
35 profile.http_client = http.default; -- TODO configurable 61 profile.http_client = http.default; -- TODO configurable
36 local extra = { oidc_discovery_url = oidc_discovery_url }; 62 local extra = { oidc_discovery_url = oidc_discovery_url };