]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: auth-cache - Drop auth_cache_parse_key()
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 25 Jul 2025 09:00:57 +0000 (12:00 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 1 Aug 2025 08:18:11 +0000 (08:18 +0000)
It's only used by tests and can now just call
auth_cache_parse_key_and_fields().

src/auth/auth-cache.c
src/auth/auth-cache.h
src/auth/test-auth-cache.c

index 32959f5d0f4a74f4eb0ab8ee1d6260a6e8357227..82cc0d526eb1fe02774b56ddc50972c71bec5226 100644 (file)
@@ -130,11 +130,6 @@ static int auth_cache_parse_key_exclude(pool_t pool, const char *query,
        return 0;
 }
 
-char *auth_cache_parse_key(pool_t pool, const char *query)
-{
-       return auth_cache_parse_key_and_fields(pool, query, NULL, NULL);
-}
-
 char *auth_cache_parse_key_and_fields(pool_t pool, const char *query,
                                      const ARRAY_TYPE(const_string) *fields,
                                      const char *exclude_driver)
index 9bdb918517045bd14c31dd8935b50bf5f804d851..d63621b1a4cb0d44ca9df10149e55c41556ea826 100644 (file)
@@ -16,10 +16,8 @@ struct auth_cache_node {
 struct auth_cache;
 struct auth_request;
 
-/* Parses all %x variables from query and compresses them into tab-separated
-   list, so it can be used as a cache key. */
-char *auth_cache_parse_key(pool_t pool, const char *query);
-/* Same as auth_cache_parse_key(), but add also variables from "fields",
+/* Parses all %variables from query and compresses them into tab-separated
+   list, so it can be used as a cache key. Adds also variables from "fields",
    except variables prefixed with <exclude_driver>":" */
 char *auth_cache_parse_key_and_fields(pool_t pool, const char *query,
                                      const ARRAY_TYPE(const_string) *fields,
index b36d83ec022969de5268fca3633c0a4b33b179b6..f58c21f7afb532dca491f3e65f70d03abbc18c21 100644 (file)
@@ -93,8 +93,8 @@ static void test_auth_cache_parse_key(void)
        test_begin("auth cache parse key");
 
        for (i = 0; i < N_ELEMENTS(tests); i++) {
-               cache_key = auth_cache_parse_key(pool_datastack_create(),
-                                                tests[i].in);
+               cache_key = auth_cache_parse_key_and_fields(pool_datastack_create(),
+                                                           tests[i].in, NULL, NULL);
                test_assert_strcmp_idx(cache_key, tests[i].out, i);
        }
 
@@ -119,8 +119,8 @@ static enum fatal_test_state test_cache_key_missing_variable(unsigned int i)
 
        if (i < N_ELEMENTS(tests_bad)) {
                test_expect_fatal_string(tests_bad[i].out);
-               (void)auth_cache_parse_key(pool_datastack_create(),
-                                          tests_bad[i].in);
+               (void)auth_cache_parse_key_and_fields(pool_datastack_create(),
+                                                     tests_bad[i].in, NULL, NULL);
                return FATAL_TEST_FAILURE;
        }