summaryrefslogtreecommitdiff
path: root/module/mod_auth_singleid.h
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2009-06-18 17:12:22 +0000
committerStef Walter <stef@memberwebs.com>2009-06-18 17:12:22 +0000
commit4bf87cb9f4f6b9812c06a8d2c500869c48ebc2dc (patch)
tree72e261b85e8529925992fb330aeab3d5b928f2f6 /module/mod_auth_singleid.h
parent407df90ad78d83cf3666db25af71a9f534123472 (diff)
Complete almost all code, compiles.
Diffstat (limited to 'module/mod_auth_singleid.h')
-rw-r--r--module/mod_auth_singleid.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/module/mod_auth_singleid.h b/module/mod_auth_singleid.h
new file mode 100644
index 0000000..68b5490
--- /dev/null
+++ b/module/mod_auth_singleid.h
@@ -0,0 +1,81 @@
+#ifndef MOD_AUTH_SINGLEID_H_
+#define MOD_AUTH_SINGLEID_H_
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void sid_shared_lock (void);
+
+void sid_shared_unlock (void);
+
+typedef struct sid_request sid_request_t;
+
+void sid_request_log_error (sid_request_t *req,
+ const char *message,
+ const char *detail);
+
+const char* sid_request_qs (sid_request_t *req);
+
+const char* sid_request_url (sid_request_t *req);
+
+void sid_request_respond (sid_request_t *req,
+ int code,
+ const char *reason,
+ const char *header,
+ ...);
+
+void sid_request_authenticated (sid_request_t *req,
+ const char *identifier);
+
+/* -----------------------------------------------------------------------------------
+ * STORAGE: Actually, communications white-board between processes/threads.
+ */
+
+typedef struct sid_storage sid_storage_t;
+
+typedef struct sid_assoc {
+ const char *server;
+ const char *handle;
+ const char *type;
+ const unsigned char *secret;
+ size_t n_secret;
+ time_t expires;
+} sid_assoc_t;
+
+sid_storage_t* sid_storage_initialize (void *memory,
+ size_t n_memory);
+
+int sid_storage_check_nonce (sid_storage_t *storage,
+ const char *server,
+ const char *nonce);
+
+int sid_storage_store_assoc (sid_storage_t *storage,
+ const sid_assoc_t *assoc);
+
+int sid_storage_find_assoc (sid_storage_t *storage,
+ const char *server,
+ const char *handle,
+ sid_assoc_t *assoc);
+
+void sid_storage_invalidate_assoc (sid_storage_t *storage,
+ const char *server,
+ const char *handle);
+
+/* -----------------------------------------------------------------------------------
+ * OPENID CONSUMER
+ */
+
+void sid_consumer_authenticate (sid_request_t *req,
+ sid_storage_t *store,
+ const char *trust_root,
+ const char *identity);
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* MOD_AUTH_SINGLEID_H_ */