get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/116131/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 116131,
    "url": "http://patches.dpdk.org/api/patches/116131/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220909093523.471727-2-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20220909093523.471727-2-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220909093523.471727-2-bruce.richardson@intel.com",
    "date": "2022-09-09T09:35:11",
    "name": "[v3,01/13] telemetry: limit characters allowed in dictionary names",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "946a59cf9091426433d23e06f21c6f1ea9932405",
    "submitter": {
        "id": 20,
        "url": "http://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220909093523.471727-2-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 24617,
            "url": "http://patches.dpdk.org/api/series/24617/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24617",
            "date": "2022-09-09T09:35:13",
            "name": "telemetry JSON escaping and other enhancements",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/24617/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/116131/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/116131/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id EB6C0A0540;\n\tFri,  9 Sep 2022 11:36:10 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6DC6442B71;\n\tFri,  9 Sep 2022 11:35:51 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 1CD2541141\n for <dev@dpdk.org>; Fri,  9 Sep 2022 11:35:46 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Sep 2022 02:35:40 -0700",
            "from silpixa00401385.ir.intel.com ([10.237.214.161])\n by orsmga004.jf.intel.com with ESMTP; 09 Sep 2022 02:35:39 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1662716147; x=1694252147;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=8gY7ypd+bbmXlOdpfNoiEm8gtMeL86IWU2icgCarunQ=;\n b=hbng/ETeODLrq2IHDtBVZut/Su2woWeNIXpKxa8epo3usSAo5jNIvbbS\n 5A1yCLnTBlDEevdP8c3XJiAphj8Hs/fQt1R2TfFBFCQC5FTA1MiCZsJTl\n dtRSzdvVvGIDOaAqt0z92tE/FVf9pfPlzYycK4JayO81EbgDnHcYLRTqk\n SnBfeBytazYWYWFNsg3bhOMc0DomuIXZ++VwkDgxj0zWCYBaqF1ogKxjD\n lFgf0SVCnbHMdXivI6A/aNtMNUt0/+VPT9pE4Blfmob/QzB9/jxpI84/+\n /QGo8YTe/q9OK5RDSzGj9LKki0DIIjScaNfBrXENBEbFZAsWZ8cggHDB2 g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10464\"; a=\"298241087\"",
            "E=Sophos;i=\"5.93,302,1654585200\"; d=\"scan'208\";a=\"298241087\"",
            "E=Sophos;i=\"5.93,302,1654585200\"; d=\"scan'208\";a=\"740996349\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Bruce Richardson <bruce.richardson@intel.com>,\n Ciara Power <ciara.power@intel.com>,\n =?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>",
        "Subject": "[PATCH v3 01/13] telemetry: limit characters allowed in dictionary\n names",
        "Date": "Fri,  9 Sep 2022 10:35:11 +0100",
        "Message-Id": "<20220909093523.471727-2-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20220909093523.471727-1-bruce.richardson@intel.com>",
        "References": "<20220623164245.561371-1-bruce.richardson@intel.com>\n <20220909093523.471727-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "To save issues with encoding the names of values in dicts, we limit the\nallowed names to a subset of character values. This list of allowed\ncharacters can be expanded as necessary in future.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nAcked-by: Ciara Power <ciara.power@intel.com>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\n---\n lib/telemetry/rte_telemetry.h  |  8 ++++++++\n lib/telemetry/telemetry_data.c | 32 ++++++++++++++++++++++++++++++++\n 2 files changed, 40 insertions(+)",
    "diff": "diff --git a/lib/telemetry/rte_telemetry.h b/lib/telemetry/rte_telemetry.h\nindex d586dd0fc1..a0d21d6b7f 100644\n--- a/lib/telemetry/rte_telemetry.h\n+++ b/lib/telemetry/rte_telemetry.h\n@@ -64,6 +64,10 @@ rte_tel_data_start_array(struct rte_tel_data *d, enum rte_tel_value_type type);\n /**\n  * Start a dictionary of values for returning from a callback\n  *\n+ * Dictionaries consist of key-values pairs to be returned, where the keys,\n+ * or names, are strings and the values can be any of the types supported by telemetry.\n+ * Name strings may only contain alphanumeric characters as well as '_' or '/'\n+ *\n  * @param d\n  *   The data structure passed to the callback\n  * @return\n@@ -159,6 +163,7 @@ rte_tel_data_add_array_container(struct rte_tel_data *d,\n  *   The data structure passed to the callback\n  * @param name\n  *   The name the value is to be stored under in the dict\n+ *   Must contain only alphanumeric characters or the symbols: '_' or '/'\n  * @param val\n  *   The string to be stored in the dict\n  * @return\n@@ -177,6 +182,7 @@ rte_tel_data_add_dict_string(struct rte_tel_data *d, const char *name,\n  *   The data structure passed to the callback\n  * @param name\n  *   The name the value is to be stored under in the dict\n+ *   Must contain only alphanumeric characters or the symbols: '_' or '/'\n  * @param val\n  *   The number to be stored in the dict\n  * @return\n@@ -193,6 +199,7 @@ rte_tel_data_add_dict_int(struct rte_tel_data *d, const char *name, int val);\n  *   The data structure passed to the callback\n  * @param name\n  *   The name the value is to be stored under in the dict\n+ *   Must contain only alphanumeric characters or the symbols: '_' or '/'\n  * @param val\n  *   The number to be stored in the dict\n  * @return\n@@ -212,6 +219,7 @@ rte_tel_data_add_dict_u64(struct rte_tel_data *d,\n  *   The data structure passed to the callback\n  * @param name\n  *   The name the value is to be stored under in the dict.\n+ *   Must contain only alphanumeric characters or the symbols: '_' or '/'\n  * @param val\n  *   The pointer to the container to be stored in the dict.\n  * @param keep\ndiff --git a/lib/telemetry/telemetry_data.c b/lib/telemetry/telemetry_data.c\nindex e14ae3c4d4..b5cd74b25b 100644\n--- a/lib/telemetry/telemetry_data.c\n+++ b/lib/telemetry/telemetry_data.c\n@@ -3,6 +3,8 @@\n  */\n \n #undef RTE_USE_LIBBSD\n+#include <stdbool.h>\n+\n #include <rte_string_fns.h>\n \n #include \"telemetry_data.h\"\n@@ -92,6 +94,24 @@ rte_tel_data_add_array_container(struct rte_tel_data *d,\n \treturn 0;\n }\n \n+static bool\n+valid_name(const char *name)\n+{\n+\tchar allowed[128] = {\n+\t\t\t['0' ... '9'] = 1,\n+\t\t\t['A' ... 'Z'] = 1,\n+\t\t\t['a' ... 'z'] = 1,\n+\t\t\t['_'] = 1,\n+\t\t\t['/'] = 1,\n+\t};\n+\twhile (*name != '\\0') {\n+\t\tif ((size_t)*name >= RTE_DIM(allowed) || allowed[(int)*name] == 0)\n+\t\t\treturn false;\n+\t\tname++;\n+\t}\n+\treturn true;\n+}\n+\n int\n rte_tel_data_add_dict_string(struct rte_tel_data *d, const char *name,\n \t\tconst char *val)\n@@ -104,6 +124,9 @@ rte_tel_data_add_dict_string(struct rte_tel_data *d, const char *name,\n \tif (d->data_len >= RTE_TEL_MAX_DICT_ENTRIES)\n \t\treturn -ENOSPC;\n \n+\tif (!valid_name(name))\n+\t\treturn -EINVAL;\n+\n \td->data_len++;\n \te->type = RTE_TEL_STRING_VAL;\n \tvbytes = strlcpy(e->value.sval, val, RTE_TEL_MAX_STRING_LEN);\n@@ -123,6 +146,9 @@ rte_tel_data_add_dict_int(struct rte_tel_data *d, const char *name, int val)\n \tif (d->data_len >= RTE_TEL_MAX_DICT_ENTRIES)\n \t\treturn -ENOSPC;\n \n+\tif (!valid_name(name))\n+\t\treturn -EINVAL;\n+\n \td->data_len++;\n \te->type = RTE_TEL_INT_VAL;\n \te->value.ival = val;\n@@ -140,6 +166,9 @@ rte_tel_data_add_dict_u64(struct rte_tel_data *d,\n \tif (d->data_len >= RTE_TEL_MAX_DICT_ENTRIES)\n \t\treturn -ENOSPC;\n \n+\tif (!valid_name(name))\n+\t\treturn -EINVAL;\n+\n \td->data_len++;\n \te->type = RTE_TEL_U64_VAL;\n \te->value.u64val = val;\n@@ -161,6 +190,9 @@ rte_tel_data_add_dict_container(struct rte_tel_data *d, const char *name,\n \tif (d->data_len >= RTE_TEL_MAX_DICT_ENTRIES)\n \t\treturn -ENOSPC;\n \n+\tif (!valid_name(name))\n+\t\treturn -EINVAL;\n+\n \td->data_len++;\n \te->type = RTE_TEL_CONTAINER;\n \te->value.container.data = val;\n",
    "prefixes": [
        "v3",
        "01/13"
    ]
}