feat: add auth step

This commit is contained in:
Jef Roosens 2023-05-29 23:37:23 +02:00
parent 16103f9b24
commit 1e42dc04dc
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
4 changed files with 27 additions and 1 deletions

View file

@ -30,6 +30,7 @@ typedef struct http_loop_gctx {
http_route *routes;
size_t route_count;
Trie *trie;
const char *api_key;
} http_loop_gctx;
/*
@ -110,6 +111,11 @@ void http_loop_res_add_header(http_loop_ctx *ctx, http_header type,
*/
bool http_loop_step_body_to_buf(event_loop_conn *conn);
/*
* Authenticate the request using the X-Api-Key header
*/
bool http_loop_step_auth(event_loop_conn *conn);
/**
* Initialize a new http loop
*/