ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
basic_auth.h
Go to the documentation of this file.
1#pragma once
2
4#include <stdbool.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
11struct http_response;
12
13#define HTTP_BASIC_AUTH_VALUE_CAPACITY 1024
14
15typedef struct http_basic_auth_config {
16 bool enabled;
17 const char *username;
18 const char *password;
19 const char *realm;
21
26
28bool http_basic_auth_matches(const http_basic_credentials_t *provided, const char *username, const char *password);
29bool http_basic_auth_authorize(const http_basic_auth_config_t *config, const char *authorization);
30bool http_server_authorize(const http_basic_auth_config_t *config, const struct http_request_info *request, struct http_response *response);
32
33#ifdef __cplusplus
34}
35#endif
Synchronized per-thread pending error stacks and value snapshots. SET_ERRNO pushes,...
void http_basic_credentials_clear(http_basic_credentials_t *credentials)
Definition basic_auth.c:9
struct http_basic_auth_config http_basic_auth_config_t
bool http_server_authorize(const http_basic_auth_config_t *config, const struct http_request_info *request, struct http_response *response)
Definition basic_auth.c:114
bool http_basic_auth_authorize(const http_basic_auth_config_t *config, const char *authorization)
Definition basic_auth.c:97
#define HTTP_BASIC_AUTH_VALUE_CAPACITY
Definition basic_auth.h:13
bool http_basic_auth_matches(const http_basic_credentials_t *provided, const char *username, const char *password)
Definition basic_auth.c:60
struct http_basic_credentials http_basic_credentials_t
asciichat_error_t http_basic_auth_parse(const char *authorization, http_basic_credentials_t *out)
Definition basic_auth.c:14
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
static bool size_t gotel_query_t * out
Definition queries.h:10
const char * password
Definition basic_auth.h:18
const char * username
Definition basic_auth.h:17