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)
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,
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);
}
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;
}