mirror of
https://github.com/netdata/netdata.git
synced 2025-04-30 15:40:05 +00:00

* wip of migrating to bitmap permissions * replace role with bitmapped permissions * formatting permissions using macros * accept view and edit permissions for all dynamic configuration * work on older compilers * parse the header in hex * agreed permissions updates * map permissions to old roles * new permissions management * fix function rename * build libdatachannel when enabled - currently for code maintainance * dyncfg now keeps 2 sets of statuses, to keep track of what happens to dyncfg and what actually happens with the plugin * complete the additions of jobs and solve unittests * fix renumbering of ACL bits * processes function shows the cmdline based on permissions and the presence of the sensitive data permission * now the agent returns 412 when authorization is missing, 403 when authorization exists but permissions are not enough, 451 when access control list prevents the user from accessing the dashboard * enable cmdline on processes with thhe HTTP_ACCESS_VIEW_AGENT_CONFIG permission * by default functions require anonymous-data access * fix compilation on debian * fix left-over renamed define * updated schema for alerts * updated permissions * require a name when loading json payloads, if the name is not provided by dyncfg
43 lines
1.2 KiB
C
43 lines
1.2 KiB
C
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#ifndef NETDATA_WEB_API_H
|
|
#define NETDATA_WEB_API_H 1
|
|
|
|
#include "daemon/common.h"
|
|
#include "web/api/http_header.h"
|
|
#include "web/api/http_auth.h"
|
|
#include "web/api/badges/web_buffer_svg.h"
|
|
#include "web/api/ilove/ilove.h"
|
|
#include "web/api/formatters/rrd2json.h"
|
|
#include "web/api/queries/weights.h"
|
|
|
|
struct web_api_command {
|
|
const char *api;
|
|
uint32_t hash;
|
|
HTTP_ACL acl;
|
|
HTTP_ACCESS access;
|
|
int (*callback)(RRDHOST *host, struct web_client *w, char *url);
|
|
unsigned int allow_subpaths;
|
|
};
|
|
|
|
struct web_client;
|
|
|
|
int web_client_api_request_vX(RRDHOST *host, struct web_client *w, char *url_path_endpoint, struct web_api_command *api_commands);
|
|
|
|
static inline void fix_google_param(char *s) {
|
|
if(unlikely(!s || !*s)) return;
|
|
|
|
for( ; *s ;s++) {
|
|
if(!isalnum(*s) && *s != '.' && *s != '_' && *s != '-')
|
|
*s = '_';
|
|
}
|
|
}
|
|
|
|
int web_client_api_request_weights(RRDHOST *host, struct web_client *w, char *url, WEIGHTS_METHOD method, WEIGHTS_FORMAT format, size_t api_version);
|
|
|
|
bool web_client_interrupt_callback(void *data);
|
|
|
|
#include "web_api_v1.h"
|
|
#include "web_api_v2.h"
|
|
|
|
#endif //NETDATA_WEB_API_H
|