summaryrefslogtreecommitdiffstats
path: root/web/api/web_api.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-10 09:18:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-10 09:19:08 +0000
commita2d7dede737947d7c6afa20a88e1f0c64e0eb96c (patch)
treefed4aff7dbe0be00cf91de6261d98bc0eb9a2449 /web/api/web_api.h
parentReleasing debian version 1.41.0-1. (diff)
downloadnetdata-a2d7dede737947d7c6afa20a88e1f0c64e0eb96c.tar.xz
netdata-a2d7dede737947d7c6afa20a88e1f0c64e0eb96c.zip
Merging upstream version 1.42.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/api/web_api.h')
-rw-r--r--web/api/web_api.h17
1 files changed, 14 insertions, 3 deletions
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;