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:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-10 09:18:49 +0000
commitdd814a7c1a8de056a79f7238578b09236edd5506 (patch)
tree429e7eed5a634a4efe9a6877ce66da8e64aa1782 /web/api/web_api.h
parentAdding upstream version 1.41.0. (diff)
downloadnetdata-dd814a7c1a8de056a79f7238578b09236edd5506.tar.xz
netdata-dd814a7c1a8de056a79f7238578b09236edd5506.zip
Adding upstream version 1.42.0.upstream/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;