summaryrefslogtreecommitdiffstats
path: root/src/lib-oauth2/oauth2-private.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:36:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:36:47 +0000
commit0441d265f2bb9da249c7abf333f0f771fadb4ab5 (patch)
tree3f3789daa2f6db22da6e55e92bee0062a7d613fe /src/lib-oauth2/oauth2-private.h
parentInitial commit. (diff)
downloaddovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.tar.xz
dovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.zip
Adding upstream version 1:2.3.21+dfsg1.upstream/1%2.3.21+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib-oauth2/oauth2-private.h')
-rw-r--r--src/lib-oauth2/oauth2-private.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/lib-oauth2/oauth2-private.h b/src/lib-oauth2/oauth2-private.h
new file mode 100644
index 0000000..038f9e1
--- /dev/null
+++ b/src/lib-oauth2/oauth2-private.h
@@ -0,0 +1,50 @@
+#ifndef OAUTH2_PRIVATE_H
+#define OAUTH2_PRIVATE_H
+
+struct json_tree;
+struct dcrypt_public_key;
+
+struct oauth2_request {
+ pool_t pool;
+
+ const struct oauth2_settings *set;
+ struct http_client_request *req;
+ struct json_parser *parser;
+ struct istream *is;
+ struct io *io;
+
+ const char *delayed_error;
+ struct timeout *to_delayed_error;
+
+ const char *username;
+ const char *key_file_template;
+
+ void (*json_parsed_cb)(struct oauth2_request *, const char *error);
+
+ ARRAY_TYPE(oauth2_field) fields;
+ char *field_name;
+
+ oauth2_request_callback_t *req_callback;
+ void *req_context;
+ /* indicates whether token is valid */
+ unsigned int response_status;
+};
+
+void oauth2_request_parse_json(struct oauth2_request *req);
+int oauth2_json_tree_build(const buffer_t *json, struct json_tree **tree_r,
+ const char **error_r);
+
+int oauth2_validation_key_cache_lookup_pubkey(
+ struct oauth2_validation_key_cache *cache, const char *key_id,
+ struct dcrypt_public_key **pubkey_r);
+int oauth2_validation_key_cache_lookup_hmac_key(
+ struct oauth2_validation_key_cache *cache, const char *key_id,
+ const buffer_t **hmac_key_r);
+void oauth2_validation_key_cache_insert_pubkey(
+ struct oauth2_validation_key_cache *cache, const char *key_id,
+ struct dcrypt_public_key *pubkey);
+void oauth2_validation_key_cache_insert_hmac_key(
+ struct oauth2_validation_key_cache *cache, const char *key_id,
+ const buffer_t *hmac_key);
+
+#endif