40 #define EACCES_USERNAME __einfo_error ( EINFO_EACCES_USERNAME ) 41 #define EINFO_EACCES_USERNAME \ 42 __einfo_uniqify ( EINFO_EACCES, 0x01, \ 43 "No username available for Basic authentication" ) 75 DBGC ( http,
"HTTP %p has no username for Basic " 76 "authentication\n", http );
94 char *buf,
size_t len ) {
98 char user_pw[ user_pw_len + 1 ];
105 snprintf ( user_pw,
sizeof ( user_pw ),
"%s:%s",
struct uri * uri
Request URI.
An HTTP authentication scheme.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
Uniform Resource Identifiers.
REQUIRING_SYMBOL(http_basic_auth)
struct http_request request
Request.
struct http_response response
Response.
Hyper Text Transport Protocol.
const char * username
Username.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define __unused
Declare a variable or data structure as unused.
struct http_request_auth auth
Authentication descriptor.
static int http_basic_authenticate(struct http_transaction *http)
Perform HTTP Basic authentication.
struct http_authentication http_basic_auth __http_authentication
HTTP Basic authentication scheme.
struct http_authentication * auth
Authentication scheme (if any)
static int http_format_basic_auth(struct http_transaction *http, char *buf, size_t len)
Construct HTTP "Authorization" header for Basic authentication.
size_t strlen(const char *src)
Get length of string.
const char * password
Password.
const char * name
Name (e.g.
const char * password
Password.
const char * user
User name.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Transaction may be retried on failure.
HTTP request Basic authentication descriptor.
#define NULL
NULL pointer (VOID *)
static int http_parse_basic_auth(struct http_transaction *http, char *line __unused)
Parse HTTP "WWW-Authenticate" header for Basic authentication.
size_t base64_encode(const void *raw, size_t raw_len, char *data, size_t len)
Base64-encode data.
struct http_request_auth_basic basic
Basic authentication descriptor.