Skip to content

Do not allow limit=0 or limit>maximun in distinct requests#1007

Merged
jesuslinares merged 2 commits into3.5from
fix-distinct-agents-limit
Jul 27, 2018
Merged

Do not allow limit=0 or limit>maximun in distinct requests#1007
jesuslinares merged 2 commits into3.5from
fix-distinct-agents-limit

Conversation

@Lifka
Copy link
Copy Markdown
Contributor

@Lifka Lifka commented Jul 27, 2018

Hi,

this PR fixes the issue #1006.

Sample

$ curl -u foo:bar -k "http://127.0.0.1:55000/agents/stats/distinct?pretty&limit=10000"
{
   "error": 1405,
   "message": "Specified limit exceeds maximum allowed (1000): 10000"
}

$ curl -u foo:bar -k "http://127.0.0.1:55000/agents/stats/distinct?pretty&limit=0"
{
   "error": 1406,
   "message": "0 is not a valid limit."
}

$ curl -u foo:bar -k "http://127.0.0.1:55000/agents/stats/distinct?pretty&limit=1"
{
   "error": 0,
   "data": {
      "totalItems": 4,
      "items": [
         {
            "count": 1,
            "version": "Wazuh v3.5.0",
            "group": null,
            "manager_host": "manager",
            "os": {
               "major": "7",
               "name": "CentOS Linux",
               "uname": "Linux |manager |3.10.0-693.21.1.el7.x86_64 |#1 SMP Wed Mar 7 19:03:37 UTC 2018 |x86_64",
               "platform": "centos",
               "version": "7",
               "build": null,
               "codename": "Core",
               "arch": "x86_64",
               "minor": null
            },
            "node_name": "node01"
         }
      ]
   }
}

Regards,
Javi.

@jesuslinares jesuslinares merged commit 50d2922 into 3.5 Jul 27, 2018
@jesuslinares jesuslinares deleted the fix-distinct-agents-limit branch July 27, 2018 10:26
@wazuh wazuh deleted a comment from wazuhci Jan 30, 2022
@wazuh wazuh deleted a comment from wazuhci Jan 30, 2022
@wazuh wazuh deleted a comment from wazuhci Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants