From 4bf87cb9f4f6b9812c06a8d2c500869c48ebc2dc Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 18 Jun 2009 17:12:22 +0000 Subject: Complete almost all code, compiles. --- module/mod_auth_singleid.h | 81 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 module/mod_auth_singleid.h (limited to 'module/mod_auth_singleid.h') 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 + +#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_ */ -- cgit v1.2.3