Skip to content

Commit

Permalink
improve dyncfg src type anon message (netdata#19684)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 authored Feb 20, 2025
1 parent 4046b35 commit 5cf6732
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/daemon/dyncfg/dyncfg-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static void dyncfg_to_json(DYNCFG *df, const char *id, BUFFER *wb, bool anonymou
}
buffer_json_object_close(wb);
buffer_json_member_add_string(wb, "source_type", dyncfg_id2source_type(df->current.source_type));
buffer_json_member_add_string(wb, "source", df->current.source_type == DYNCFG_SOURCE_TYPE_DYNCFG && anonymous ? "anonymous access does not present sensitive user info" : string2str(df->current.source));
buffer_json_member_add_string(wb, "source", df->current.source_type == DYNCFG_SOURCE_TYPE_DYNCFG && anonymous ? "User details hidden in anonymous mode. Sign in to access configuration details." : string2str(df->current.source));
buffer_json_member_add_boolean(wb, "sync", df->sync);
buffer_json_member_add_boolean(wb, "user_disabled", df->dyncfg.user_disabled);
buffer_json_member_add_boolean(wb, "restart_required", df->dyncfg.restart_required);
Expand All @@ -45,7 +45,7 @@ static void dyncfg_to_json(DYNCFG *df, const char *id, BUFFER *wb, bool anonymou
buffer_json_member_add_boolean(wb, "available", true);
buffer_json_member_add_string(wb, "status", dyncfg_id2status(df->dyncfg.status));
buffer_json_member_add_string(wb, "source_type", dyncfg_id2source_type(df->dyncfg.source_type));
buffer_json_member_add_string(wb, "source", df->dyncfg.source_type == DYNCFG_SOURCE_TYPE_DYNCFG && anonymous ? "anonymous access does not present sensitive user info" :string2str(df->dyncfg.source));
buffer_json_member_add_string(wb, "source", df->dyncfg.source_type == DYNCFG_SOURCE_TYPE_DYNCFG && anonymous ? "User details hidden in anonymous mode. Sign in to access configuration details." :string2str(df->dyncfg.source));
buffer_json_member_add_uint64(wb, "created_ut", df->dyncfg.created_ut);
buffer_json_member_add_uint64(wb, "modified_ut", df->dyncfg.modified_ut);
buffer_json_member_add_string(wb, "content_type", content_type_id2string(df->dyncfg.payload->content_type));
Expand Down

0 comments on commit 5cf6732

Please sign in to comment.