From: Aki Tuomi Date: Tue, 27 Feb 2024 13:22:21 +0000 (+0200) Subject: auth: Remove OIDC configuration URL hack X-Git-Tag: 2.4.0~741 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=44242b3b48f80b606067dcfdb715a39599ff5698;p=thirdparty%2Fdovecot%2Fcore.git auth: Remove OIDC configuration URL hack --- diff --git a/src/auth/auth-request.h b/src/auth/auth-request.h index 6893bfce09..737dda1a91 100644 --- a/src/auth/auth-request.h +++ b/src/auth/auth-request.h @@ -141,9 +141,6 @@ struct auth_request { struct auth_request_handler *handler; struct auth_master_connection *master; - /* FIXME: Remove this once mech-oauth2 correctly does the processing */ - const char *openid_config_url; - unsigned int connect_uid; unsigned int client_pid; unsigned int id; diff --git a/src/auth/db-oauth2.c b/src/auth/db-oauth2.c index 02727ed136..621f350eae 100644 --- a/src/auth/db-oauth2.c +++ b/src/auth/db-oauth2.c @@ -273,21 +273,6 @@ static void db_oauth2_free(struct db_oauth2 **_db) pool_unref(&db->pool); } -static void -db_oauth2_add_openid_config_url(struct db_oauth2_request *req) -{ - /* FIXME: HORRIBLE HACK - REMOVE ME!!! - It is because the mech has not been implemented properly - that we need to pass the config url in this strange way. - - This **must** be moved to mech-oauth2 once the validation - result et al is handled there. - */ - req->auth_request->openid_config_url = - p_strdup_empty(req->auth_request->pool, - req->db->set.openid_configuration_url); -} - const char *db_oauth2_get_openid_configuration_url(const struct db_oauth2 *db) { return db->set.openid_configuration_url; @@ -458,9 +443,6 @@ static void db_oauth2_callback(struct db_oauth2_request *req, i_assert(result == PASSDB_RESULT_OK || error != NULL); - if (result != PASSDB_RESULT_OK) - db_oauth2_add_openid_config_url(req); - /* Successful lookups were logged by the caller. Failed lookups will be logged either with e_error() or e_info() by the callback. */ if (callback != NULL) { diff --git a/src/auth/passdb-oauth2.c b/src/auth/passdb-oauth2.c index a5331d8fd6..f75b894190 100644 --- a/src/auth/passdb-oauth2.c +++ b/src/auth/passdb-oauth2.c @@ -65,16 +65,6 @@ static void oauth2_deinit(struct passdb_module *passdb ATTR_UNUSED) { } -/* FIXME: Remove when oauth2 mech is fixed */ -const char *passdb_oauth2_get_oidc_url(struct passdb_module *passdb) -{ - struct oauth2_passdb_module *module = - container_of(passdb, struct oauth2_passdb_module, module); - if (module->db != NULL) - return db_oauth2_get_openid_configuration_url(module->db); - return NULL; -} - struct passdb_module_interface passdb_oauth2 = { .name = "oauth2", diff --git a/src/auth/passdb.h b/src/auth/passdb.h index baab008ac6..f2eb93a0c8 100644 --- a/src/auth/passdb.h +++ b/src/auth/passdb.h @@ -115,8 +115,6 @@ void passdbs_generate_md5(unsigned char md5[STATIC_ARRAY MD5_RESULTLEN]); void passdbs_init(void); void passdbs_deinit(void); -const char *passdb_oauth2_get_oidc_url(struct passdb_module *passdb); - #include "auth-request.h" #endif