diff options
Diffstat (limited to 'web/api/web_api.h')
-rw-r--r-- | web/api/web_api.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/web/api/web_api.h b/web/api/web_api.h index 840ac8dc..f7ae45ad 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; |