From a2d7dede737947d7c6afa20a88e1f0c64e0eb96c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 10 Aug 2023 11:18:52 +0200 Subject: Merging upstream version 1.42.0. Signed-off-by: Daniel Baumann --- web/api/web_api.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'web/api/web_api.h') diff --git a/web/api/web_api.h b/web/api/web_api.h index 840ac8dcb..f7ae45ad0 100644 --- a/web/api/web_api.h +++ b/web/api/web_api.h @@ -11,15 +11,26 @@ extern bool netdata_is_protected_by_bearer; extern DICTIONARY *netdata_authorized_bearers; -bool api_check_bearer_token(struct web_client *w); -bool extract_bearer_token_from_request(struct web_client *w, char *dst, size_t dst_len); -void bearer_tokens_init(void); +typedef enum __attribute__((packed)) { + BEARER_STATUS_NO_BEARER_IN_HEADERS, + BEARER_STATUS_BEARER_DOES_NOT_FIT, + BEARER_STATUS_NOT_PARSABLE, + BEARER_STATUS_EXTRACTED_FROM_HEADER, + BEARER_STATUS_NO_BEARERS_DICTIONARY, + BEARER_STATUS_NOT_FOUND_IN_DICTIONARY, + BEARER_STATUS_EXPIRED, + BEARER_STATUS_AVAILABLE_AND_VALIDATED, +} BEARER_STATUS; + +BEARER_STATUS api_check_bearer_token(struct web_client *w); +BEARER_STATUS extract_bearer_token_from_request(struct web_client *w, char *dst, size_t dst_len); struct web_api_command { const char *command; uint32_t hash; WEB_CLIENT_ACL acl; int (*callback)(RRDHOST *host, struct web_client *w, char *url); + unsigned int allow_subpaths; }; struct web_client; -- cgit v1.2.3