Repository: godaddy/kubernetes-external-secrets
Pull request #74 (2019-06-01 21:42:01)

fix(AWSSM): treat value as object iff the es specifies .property
See https://github.com/godaddy/kubernetes-external-secrets/issues/73 for
discussion.


Patch:
diff --git a/examples/hello-service-external-secret.yml b/examples/hello-service-external-secret.yml
index de259d8..15776d4 100644
--- a/examples/hello-service-external-secret.yml
+++ b/examples/hello-service-external-secret.yml
@@ -4,6 +4,6 @@ metadata:
   name: hello-service
 secretDescriptor:
   backendType: secretsManager
-  properties:
+  data:
     - key: hello-service/password
       name: password
diff --git a/lib/backends/kv-backend.js b/lib/backends/kv-backend.js
index baedc10..894d850 100644
--- a/lib/backends/kv-backend.js
+++ b/lib/backends/kv-backend.js
@@ -28,8 +28,16 @@ class KVBackend extends AbstractBackend {
       const value = await this._get({ secretKey: secretProperty.key })
 
       if ('property' in secretProperty) {
-        return value[secretProperty.property]
+        let parsedValue
+        try {
+          parsedValue = JSON.parse(value)
+        } catch (err) {
+          this._logger.warn(`Failed to JSON.parse '${value}':`, err)
+          return
+        }
+        return parsedValue[secretProperty.property]
       }
+
       return value
     }))
   }
diff --git a/lib/backends/secrets-manager-backend.js b/lib/backends/secrets-manager-backend.js
index 29cd17b..33ff192 100644
--- a/lib/backends/secrets-manager-backend.js
+++ b/lib/backends/secrets-manager-backend.js
@@ -24,12 +24,7 @@ class SecretsManagerBackend extends KVBackend {
       .getSecretValue({ SecretId: secretKey })
       .promise()
 
-    const secretValue = data.SecretString
-    try {
-      return JSON.parse(secretValue)
-    } catch (err) {
-      return secretValue
-    }
+    return data.SecretString
   }
 }
 
diff --git a/package-lock.json b/package-lock.json
index 7475c83..72e61a8 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -112,19 +112,19 @@
       }
     },
     "@kubernetes/client-node": {
-      "version": "0.8.2",
-      "resolved": "https://registry.npmjs.org/@kubernetes/client-node/-/client-node-0.8.2.tgz",
-      "integrity": "sha512-crS3h59+fOGXQgxVdq3XH81ytY7FV2HnB5z/+lSWD3bi5D5lHKu3PVN2PHCDMNExPy0KthcfqBoIVFVy4CoG3A==",
+      "version": "0.9.1",
+      "resolved": "https://registry.npmjs.org/@kubernetes/client-node/-/client-node-0.9.1.tgz",
+      "integrity": "sha512-eDs79/NsxN508tYUUJZqIYVz/YZcE63W6GYsE0P4Foq9+rfCdPCBLOGZ2Wibk3bxo2a5G1JKy4AUWoLBKMZrvA==",
       "requires": {
         "@types/js-yaml": "^3.11.2",
         "@types/node": "^10.12.0",
         "@types/request": "^2.47.1",
         "@types/underscore": "^1.8.9",
         "@types/ws": "^6.0.1",
-        "byline": "^5.0.0",
         "isomorphic-ws": "^4.0.1",
         "js-yaml": "^3.12.0",
-        "jsonpath": "^1.0.0",
+        "json-stream": "^1.0.0",
+        "jsonpath-plus": "^0.19.0",
         "request": "^2.88.0",
         "shelljs": "^0.8.2",
         "tslib": "^1.9.3",
@@ -143,9 +143,9 @@
       }
     },
     "@panva/jose": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/@panva/jose/-/jose-1.0.2.tgz",
-      "integrity": "sha512-aRFdBAEs5t5qmAvGzAAekAV6887n6Kc6JCQWc51hujIIU91yJAG2kklm3WdVYdJCSS+sk/Bw6am7mAUgYiWURg==",
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/@panva/jose/-/jose-1.2.0.tgz",
+      "integrity": "sha512-mIqctuvXJqNlX0netPIEPqmqdxOhBvVa7YcWeXhvUmJal+Ds/WDcoVA7bt6Ue3gbWQ69DAuv9L4EBmQga3lSaQ==",
       "requires": {
         "asn1.js": "^5.0.1"
       }
@@ -223,9 +223,9 @@
       "integrity": "sha512-SGGAhXLHDx+PK4YLNcNGa6goPf9XRWQNAUUbffkwVGGXIxmDKWyGGL4inzq2sPmExu431Ekb9aEMn9BkPqEYFA=="
     },
     "@types/node": {
-      "version": "10.14.7",
-      "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.7.tgz",
-      "integrity": "sha512-on4MmIDgHXiuJDELPk1NFaKVUxxCFr37tm8E9yN6rAiF5Pzp/9bBfBHkoexqRiY+hk/Z04EJU9kKEb59YqJ82A=="
+      "version": "10.14.8",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.8.tgz",
+      "integrity": "sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw=="
     },
     "@types/request": {
       "version": "2.48.1",
@@ -257,11 +257,6 @@
         "@types/node": "*"
       }
     },
-    "JSONSelect": {
-      "version": "0.4.0",
-      "resolved": "https://registry.npmjs.org/JSONSelect/-/JSONSelect-0.4.0.tgz",
-      "integrity": "sha1-oI7cxn6z/L6Z7WMIVTRKDPKCu40="
-    },
     "JSONStream": {
       "version": "1.3.5",
       "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz",
@@ -690,11 +685,6 @@
       "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
       "dev": true
     },
-    "byline": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz",
-      "integrity": "sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE="
-    },
     "cache-base": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
@@ -863,11 +853,6 @@
       "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==",
       "dev": true
     },
-    "cjson": {
-      "version": "0.2.1",
-      "resolved": "https://registry.npmjs.org/cjson/-/cjson-0.2.1.tgz",
-      "integrity": "sha1-c82KrWXZ4VBfmvF0TTt5wVJ2gqU="
-    },
     "class-utils": {
       "version": "0.3.6",
       "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
@@ -989,11 +974,6 @@
       "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
       "dev": true
     },
-    "colors": {
-      "version": "0.5.1",
-      "resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz",
-      "integrity": "sha1-fQAj6usVTo7p/Oddy5I9DtFmd3Q="
-    },
     "combined-stream": {
       "version": "1.0.8",
       "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
@@ -1463,7 +1443,8 @@
     "deep-is": {
       "version": "0.1.3",
       "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
-      "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ="
+      "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
+      "dev": true
     },
     "deepmerge": {
       "version": "3.2.0",
@@ -1601,11 +1582,6 @@
       "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",
       "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI="
     },
-    "ebnf-parser": {
-      "version": "0.1.10",
-      "resolved": "https://registry.npmjs.org/ebnf-parser/-/ebnf-parser-0.1.10.tgz",
-      "integrity": "sha1-zR9rpHfFY4xAyX7ZtXLbW6tdgzE="
-    },
     "ecc-jsbn": {
       "version": "0.1.2",
       "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
@@ -1675,28 +1651,6 @@
       "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
       "dev": true
     },
-    "escodegen": {
-      "version": "0.0.21",
-      "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-0.0.21.tgz",
-      "integrity": "sha1-U9ZSz6EDA4gnlFilJmxf/HCcY8M=",
-      "requires": {
-        "esprima": "~1.0.2",
-        "estraverse": "~0.0.4",
-        "source-map": ">= 0.1.2"
-      },
-      "dependencies": {
-        "esprima": {
-          "version": "1.0.4",
-          "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz",
-          "integrity": "sha1-n1V+CPw7TSbs6d00+Pv0drYlha0="
-        },
-        "estraverse": {
-          "version": "0.0.4",
-          "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-0.0.4.tgz",
-          "integrity": "sha1-AaCTLf7ldGhKWYr1pnw7+bZCjbI="
-        }
-      }
-    },
     "eslint": {
       "version": "5.16.0",
       "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz",
@@ -2087,12 +2041,14 @@
     "estraverse": {
       "version": "4.2.0",
       "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
-      "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM="
+      "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=",
+      "dev": true
     },
     "esutils": {
       "version": "2.0.2",
       "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
-      "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs="
+      "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
+      "dev": true
     },
     "events": {
       "version": "1.1.1",
@@ -2297,7 +2253,8 @@
     "fast-levenshtein": {
       "version": "2.0.6",
       "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
-      "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc="
+      "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
+      "dev": true
     },
     "fast-redact": {
       "version": "1.5.0",
@@ -4113,37 +4070,6 @@
         "handlebars": "^4.1.0"
       }
     },
-    "jison": {
-      "version": "0.4.13",
-      "resolved": "https://registry.npmjs.org/jison/-/jison-0.4.13.tgz",
-      "integrity": "sha1-kEFwfWIkE2f1iDRTK58ZwsNvrHg=",
-      "requires": {
-        "JSONSelect": "0.4.0",
-        "cjson": "~0.2.1",
-        "ebnf-parser": "~0.1.9",
-        "escodegen": "0.0.21",
-        "esprima": "1.0.x",
-        "jison-lex": "0.2.x",
-        "lex-parser": "~0.1.3",
-        "nomnom": "1.5.2"
-      },
-      "dependencies": {
-        "esprima": {
-          "version": "1.0.4",
-          "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz",
-          "integrity": "sha1-n1V+CPw7TSbs6d00+Pv0drYlha0="
-        }
-      }
-    },
-    "jison-lex": {
-      "version": "0.2.1",
-      "resolved": "https://registry.npmjs.org/jison-lex/-/jison-lex-0.2.1.tgz",
-      "integrity": "sha1-rEuBXozOUTLrErXfz+jXB7iETf4=",
-      "requires": {
-        "lex-parser": "0.1.x",
-        "nomnom": "1.5.2"
-      }
-    },
     "jmespath": {
       "version": "0.15.0",
       "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz",
@@ -4202,6 +4128,11 @@
       "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
       "dev": true
     },
+    "json-stream": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/json-stream/-/json-stream-1.0.0.tgz",
+      "integrity": "sha1-GjhU4o0rvuqzHMfd9oPS3cVlJwg="
+    },
     "json-stringify-safe": {
       "version": "5.0.1",
       "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
@@ -4213,28 +4144,10 @@
       "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=",
       "dev": true
     },
-    "jsonpath": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.0.1.tgz",
-      "integrity": "sha512-HY5kSg82LHIs0r0h9gYBwpNc1w1qGY0qJ7al01W1bJltsN2lp+mjjA/a79gXWuvD6Xf8oPkD2d5uKMZQXTGzqA==",
-      "requires": {
-        "esprima": "1.2.2",
-        "jison": "0.4.13",
-        "static-eval": "2.0.2",
-        "underscore": "1.7.0"
-      },
-      "dependencies": {
-        "esprima": {
-          "version": "1.2.2",
-          "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz",
-          "integrity": "sha1-dqD9Zvz+FU/SkmZ9wmQBl1CxZXs="
-        },
-        "underscore": {
-          "version": "1.7.0",
-          "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz",
-          "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk="
-        }
-      }
+    "jsonpath-plus": {
+      "version": "0.19.0",
+      "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-0.19.0.tgz",
+      "integrity": "sha512-GSVwsrzW9LsA5lzsqe4CkuZ9wp+kxBb2GwNniaWzI2YFn5Ig42rSW8ZxVpWXaAfakXNrx5pgY5AbQq7kzX29kg=="
     },
     "jsprim": {
       "version": "1.4.1",
@@ -4268,19 +4181,21 @@
       "dev": true
     },
     "kubernetes-client": {
-      "version": "8.1.1",
-      "resolved": "https://registry.npmjs.org/kubernetes-client/-/kubernetes-client-8.1.1.tgz",
-      "integrity": "sha512-m6b1af0VnpOR6HN1nXTQ7WGwIhHnwZrXx5YeWcITfSphc+NDCZzDz9OKTaP9bFYIwxqFYq5l5vhjW8WAtZGU5Q==",
+      "version": "8.2.0",
+      "resolved": "https://registry.npmjs.org/kubernetes-client/-/kubernetes-client-8.2.0.tgz",
+      "integrity": "sha512-BHrqRZbcN5EUFR0dk29Mwosgu2tcYItwgF0HtoaLJ4yzMFJ91z9lhM4q813k82Px5aRfymDPMHft7nxo9veVbg==",
       "requires": {
-        "@kubernetes/client-node": "^0.8.2",
+        "@kubernetes/client-node": "^0.9.0",
         "deepmerge": "^3.2.0",
         "depd": "^2.0.0",
         "js-yaml": "^3.13.1",
+        "json-stream": "^1.0.0",
         "openid-client": "^3.1.0",
         "pascalcase": "^0.1.1",
+        "pump": "^3.0.0",
         "qs": "^6.7.0",
         "request": "^2.88.0",
-        "swagger-fluent": "^3.1.3",
+        "swagger-fluent": "^3.2.1",
         "url-join": "^4.0.0",
         "ws": "^7.0.0"
       }
@@ -4312,16 +4227,12 @@
       "version": "0.3.0",
       "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
       "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
+      "dev": true,
       "requires": {
         "prelude-ls": "~1.1.2",
         "type-check": "~0.3.2"
       }
     },
-    "lex-parser": {
-      "version": "0.1.4",
-      "resolved": "https://registry.npmjs.org/lex-parser/-/lex-parser-0.1.4.tgz",
-      "integrity": "sha1-ZMTwJfF/1Tv7RXY/rrFvAVp0dVA="
-    },
     "load-json-file": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
@@ -4874,22 +4785,6 @@
         }
       }
     },
-    "nomnom": {
-      "version": "1.5.2",
-      "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.5.2.tgz",
-      "integrity": "sha1-9DRUSKhTz71cDSYyDyR3qwUm/i8=",
-      "requires": {
-        "colors": "0.5.x",
-        "underscore": "1.1.x"
-      },
-      "dependencies": {
-        "underscore": {
-          "version": "1.1.7",
-          "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.1.7.tgz",
-          "integrity": "sha1-QLq4S60Z0jAJbo1u9ii/8FXYPbA="
-        }
-      }
-    },
     "nopt": {
       "version": "1.0.10",
       "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz",
@@ -5234,6 +5129,7 @@
       "version": "0.8.2",
       "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
       "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=",
+      "dev": true,
       "requires": {
         "deep-is": "~0.1.3",
         "fast-levenshtein": "~2.0.4",
@@ -5629,7 +5525,8 @@
     "prelude-ls": {
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
-      "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
+      "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
+      "dev": true
     },
     "prepend-http": {
       "version": "2.0.0",
@@ -5655,9 +5552,9 @@
       "dev": true
     },
     "psl": {
-      "version": "1.1.31",
-      "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz",
-      "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw=="
+      "version": "1.1.32",
+      "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.32.tgz",
+      "integrity": "sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g=="
     },
     "pstree.remy": {
       "version": "1.1.6",
@@ -6308,7 +6205,8 @@
     "source-map": {
       "version": "0.5.7",
       "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
-      "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w="
+      "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
+      "dev": true
     },
     "source-map-resolve": {
       "version": "0.5.2",
@@ -6558,39 +6456,6 @@
         }
       }
     },
-    "static-eval": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz",
-      "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==",
-      "requires": {
-        "escodegen": "^1.8.1"
-      },
-      "dependencies": {
-        "escodegen": {
-          "version": "1.11.1",
-          "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.1.tgz",
-          "integrity": "sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==",
-          "requires": {
-            "esprima": "^3.1.3",
-            "estraverse": "^4.2.0",
-            "esutils": "^2.0.2",
-            "optionator": "^0.8.1",
-            "source-map": "~0.6.1"
-          }
-        },
-        "esprima": {
-          "version": "3.1.3",
-          "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz",
-          "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM="
-        },
-        "source-map": {
-          "version": "0.6.1",
-          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
-          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
-          "optional": true
-        }
-      }
-    },
     "static-extend": {
       "version": "0.1.2",
       "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
@@ -6680,9 +6545,9 @@
       }
     },
     "swagger-fluent": {
-      "version": "3.1.3",
-      "resolved": "https://registry.npmjs.org/swagger-fluent/-/swagger-fluent-3.1.3.tgz",
-      "integrity": "sha512-h58Rq7rpT+8O2FW5qlujoZ5SYv9iOkxqjUIbM49KXWsSuY55UW3mh+TbtXOgtAiiyDpsjnZIRuvN2ESSlkjsNw==",
+      "version": "3.2.1",
+      "resolved": "https://registry.npmjs.org/swagger-fluent/-/swagger-fluent-3.2.1.tgz",
+      "integrity": "sha512-Ol4wwbc9kKNdOGPS3aoKLEkCFPiEioA9gMUeeRzlugHHu0HYVvftLpK9v4X8ZUm8l2n2yGiLUBp+gKqhQzHspw==",
       "requires": {
         "merge-deep": "^3.0.2",
         "request": "^2.88.0"
@@ -6939,6 +6804,7 @@
       "version": "0.3.2",
       "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
       "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
+      "dev": true,
       "requires": {
         "prelude-ls": "~1.1.2"
       }
@@ -7241,7 +7107,8 @@
     "wordwrap": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
-      "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus="
+      "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=",
+      "dev": true
     },
     "wrap-ansi": {
       "version": "2.1.0",
diff --git a/package.json b/package.json
index 6b7c85d..92ca5a9 100644
--- a/package.json
+++ b/package.json
@@ -28,7 +28,7 @@
   },
   "dependencies": {
     "aws-sdk": "^2.433.0",
-    "kubernetes-client": "^8.1.1",
+    "kubernetes-client": "^8.2.0",
     "lodash.clonedeep": "^4.5.0",
     "make-promises-safe": "^5.0.0",
     "pino": "^5.12.0"


Test patch:
diff --git a/lib/backends/kv-backend.test.js b/lib/backends/kv-backend.test.js
index 1bcddc3..8adb03b 100644
--- a/lib/backends/kv-backend.test.js
+++ b/lib/backends/kv-backend.test.js
@@ -13,6 +13,7 @@ describe('SecretsManagerBackend', () => {
   beforeEach(() => {
     loggerMock = sinon.mock()
     loggerMock.info = sinon.stub()
+    loggerMock.warn = sinon.stub()
 
     kvBackend = new KVBackend({
       logger: loggerMock
@@ -26,7 +27,7 @@ describe('SecretsManagerBackend', () => {
     })
 
     it('handles secrets values that are objects', async () => {
-      kvBackend._get.onFirstCall().resolves({ foo: 'bar' })
+      kvBackend._get.onFirstCall().resolves('{"foo":"bar"}')
       const secretPropertyValues = await kvBackend._fetchSecretPropertyValues({
         externalData: [{
           key: 'mocked-key',
@@ -37,6 +38,18 @@ describe('SecretsManagerBackend', () => {
       expect(secretPropertyValues).to.deep.equal(['bar'])
     })
 
+    it('handles invalid JSON objects', async () => {
+      kvBackend._get.onFirstCall().resolves('{')
+      const secretPropertyValues = await kvBackend._fetchSecretPropertyValues({
+        externalData: [{
+          key: 'mocked-key',
+          name: 'mocked-name',
+          property: 'foo'
+        }]
+      })
+      expect(secretPropertyValues).to.deep.equal([undefined])
+    })
+
     it('fetches secret property values', async () => {
       kvBackend._get.onFirstCall().resolves('fakePropertyValue1')
       kvBackend._get.onSecondCall().resolves('fakePropertyValue2')