{"_id":"clarity","_rev":"25-e40f3b4c2b6d556b09751b2cebcfa890","name":"clarity","description":"Simple utility to convert obfuscated strings (primary use case is password urls) into the actual equivalent","dist-tags":{"latest":"1.0.2"},"versions":{"0.1.0":{"name":"clarity","description":"Simple utility to convert obfuscated strings (primary use case is password urls) into the actual equivalent","author":{"name":"Damon Oehlman","email":"damon.oehlman@sidelab.com"},"tags":["password","obfuscate","security"],"version":"0.1.0","engines":{"node":">= 0.6.x < 0.9.0"},"dependencies":{"debug":"*"},"devDependencies":{"mocha":"1.4.x"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/clarity.git"},"bugs":{"url":"http://github.com/DamonOehlman/clarity/issues"},"scripts":{"test":"./node_modules/.bin/mocha --reporter spec"},"contributors":[],"optionalDependencies":{},"_id":"clarity@0.1.0","dist":{"shasum":"a4bb2a6fd3a7d387bbb5b5c3be6213324d57c5f4","tarball":"https://registry.npmjs.org/clarity/-/clarity-0.1.0.tgz","integrity":"sha512-oFh4oBgj3zhWBQiaRMJMZccQ9zAVAMxEY7+wmPZJFBs6koMzXvZ9lAb5hU0gsuXHiHnrPCfqBdB5dJB3k/vasQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCj1dfMMWVIn5Ovk4bJks+7t754SloeIV9tVAdNNj5GAIgbaMmHq8mDRn8wbjRwkY1q9Vwt1cPqNUt+NGguqGMc+E="}]},"_npmVersion":"1.1.52","_npmUser":{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}],"directories":{}},"0.1.1":{"name":"clarity","description":"Simple utility to convert obfuscated strings (primary use case is password urls) into the actual equivalent","author":{"name":"Damon Oehlman","email":"damon.oehlman@sidelab.com"},"tags":["password","obfuscate","security"],"version":"0.1.1","engines":{"node":">= 0.6.x < 0.9.0"},"dependencies":{"debug":"*"},"devDependencies":{"mocha":"1.4.x"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/clarity.git"},"bugs":{"url":"http://github.com/DamonOehlman/clarity/issues"},"scripts":{"test":"./node_modules/.bin/mocha --reporter spec"},"contributors":[],"optionalDependencies":{},"_id":"clarity@0.1.1","dist":{"shasum":"04d27e37f40bb719d74adaf2645ff25ec4d464e7","tarball":"https://registry.npmjs.org/clarity/-/clarity-0.1.1.tgz","integrity":"sha512-/XpNOUwj8ermPZFJGucJ/dSZvhd6hdv7qU/madcSWa1dBZZFeBJvAKULtnBXOhM1LzWcqT57bF3tEUnhe0ZUBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIByqbMYC23WhzJcY6FOhYXqEAP+lzJp06sEvkXmS8ud+AiA+SsaZIvdSuTiNUh/80bt0Tjr1TsEhYvQv/Qj/9pSkhQ=="}]},"_npmVersion":"1.1.52","_npmUser":{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}]},"0.1.2":{"name":"clarity","description":"Simple utility to convert obfuscated strings (primary use case is password urls) into the actual equivalent","author":{"name":"Damon Oehlman","email":"damon.oehlman@sidelab.com"},"tags":["password","obfuscate","security"],"version":"0.1.2","engines":{"node":">= 0.6.x < 0.9.0"},"dependencies":{"debug":"*"},"devDependencies":{"mocha":"1.4.x"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/clarity.git"},"bugs":{"url":"http://github.com/DamonOehlman/clarity/issues"},"scripts":{"test":"./node_modules/.bin/mocha --reporter spec"},"contributors":[],"optionalDependencies":{},"_id":"clarity@0.1.2","dist":{"shasum":"f25308e1eea98aa14bd397f001252eee2d83da1b","tarball":"https://registry.npmjs.org/clarity/-/clarity-0.1.2.tgz","integrity":"sha512-lVXj9s2itbJxPF/foEb1KGIiBSajqFg36dm5j6tGQFz/kPgXmMB3wV2sDZyrZI1w3MzDFzb920fwzqmluLX2rQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFE7CDiELAmmWPJliKzwZEIb4JuCTcTZSokmrhxg0n3SAiEA4ZEpLwFHPbjDKq4RTR3nYUPPLq4iSmeuCsdFWKNViMQ="}]},"_npmVersion":"1.1.52","_npmUser":{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}]},"0.1.3":{"name":"clarity","description":"Simple utility to convert obfuscated strings (primary use case is password urls) into the actual equivalent","author":{"name":"Damon Oehlman","email":"damon.oehlman@sidelab.com"},"tags":["password","obfuscate","security"],"version":"0.1.3","engines":{"node":">= 0.6.x < 0.9.0"},"dependencies":{"debug":"*"},"devDependencies":{"mocha":"1.4.x"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/clarity.git"},"bugs":{"url":"http://github.com/DamonOehlman/clarity/issues"},"scripts":{"test":"./node_modules/.bin/mocha --reporter spec"},"contributors":[],"optionalDependencies":{},"_id":"clarity@0.1.3","dist":{"shasum":"78dd6725314300730e95bc14111c9d23c91aa84e","tarball":"https://registry.npmjs.org/clarity/-/clarity-0.1.3.tgz","integrity":"sha512-bdOWee71QeLBXgC4NdYNJFiZfYxek8p4HyZE3VNNWdPnunS1OwUsRDvTdUNYFwKbkBnsA155qFBmrl7UGge9mw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgBp8Mi3YUEyuVjieLzzo3Eh3WrlJztqTGx5cSDk4QIgIhAMBz4ecgPKOT4VUeKJ1e1mlI7CUTg6TMIeNJ7RRUDNQp"}]},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}]},"0.1.4":{"name":"clarity","description":"Simple utility to convert obfuscated strings (primary use case is password urls) into the actual equivalent","author":{"name":"Damon Oehlman","email":"damon.oehlman@sidelab.com"},"tags":["password","obfuscate","security"],"version":"0.1.4","engines":{"node":">= 0.6.x < 0.9.0"},"dependencies":{"debug":"*"},"devDependencies":{"mocha":"1.4.x"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/clarity.git"},"bugs":{"url":"http://github.com/DamonOehlman/clarity/issues"},"scripts":{"test":"./node_modules/.bin/mocha --reporter spec"},"contributors":[],"optionalDependencies":{},"_id":"clarity@0.1.4","dist":{"shasum":"513ae3db89fde780e95447697564cd6fb14ca506","tarball":"https://registry.npmjs.org/clarity/-/clarity-0.1.4.tgz","integrity":"sha512-iFp86Or3s6e0UbcnfXEZNYMB35IG3xGvo5MjxdrzTK8O6b2Y3kSfphaOlUL9aOiH/aNsI9vFN0DZSTsqS4P/NA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDD7AuW3Te0CN+ExvqfIehQIwulw5j74C/dfjcYaFiE1AiBYJmcZk1vEDayhttgcap8exPcJbOb3/qS185zMf3Y6/Q=="}]},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}]},"0.1.5":{"name":"clarity","description":"Simple utility to convert obfuscated strings (primary use case is password urls) into the actual equivalent","author":{"name":"Damon Oehlman","email":"damon.oehlman@sidelab.com"},"tags":["password","obfuscate","security"],"version":"0.1.5","engines":{"node":">= 0.6.x < 0.9.0"},"dependencies":{"debug":"*"},"devDependencies":{"mocha":"1.4.x"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/clarity.git"},"bugs":{"url":"http://github.com/DamonOehlman/clarity/issues"},"scripts":{"test":"./node_modules/.bin/mocha --reporter spec"},"contributors":[],"optionalDependencies":{},"_id":"clarity@0.1.5","dist":{"shasum":"59f57e83bcb9d01d82d359809363335ccc99427c","tarball":"https://registry.npmjs.org/clarity/-/clarity-0.1.5.tgz","integrity":"sha512-ZkpptzpNgnG5z9yycDrEC/22myKC7FuIukUnJAX2QwsVRaFNYeiu1nFruGyWuqee6Xnq53God5eKM7cbBExxIQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBDAbSIdNzrMJZLG0LqS9DswoJOCTnTmq+SfFiUMgVBZAiEA+iT8cmBEVIX0T2eeoy2I3hv2hENiKs6jznnANTlj+Hs="}]},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}]},"1.0.0":{"name":"clarity","description":"Simple utility to convert obfuscated strings (primary use case is password urls) into the actual equivalent","author":{"name":"Damon Oehlman","email":"damon.oehlman@gmail.com"},"keywords":["password","obfuscate","security"],"version":"1.0.0","dependencies":{},"devDependencies":{"tape":"~1.0.4"},"repository":{"type":"git","url":"git://github.com/DamonOehlman/clarity.git"},"bugs":{"url":"http://github.com/DamonOehlman/clarity/issues"},"scripts":{"test":"node test/all.js","gendocs":"gendocs > README.md"},"main":"index.js","directories":{"test":"test"},"license":"MIT","_id":"clarity@1.0.0","dist":{"shasum":"ba1f7d3bc2add55774428bde330c310844344138","tarball":"https://registry.npmjs.org/clarity/-/clarity-1.0.0.tgz","integrity":"sha512-c0EKuBUJKsQde4TBhqxU5K1eZcoNN8s/NduUrPVXMQSQHtZRWJWQ8YSZft/6WEdJHsybFlTMDubodBLQk47TQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDfQdHQ6zd/RSLkUbAQ9KrcWawkJkdn0N4gUphGCgbfTAiEAjV/UY63mEFXTm+tFoPQ8fPIRqfOr9zD9gE6ZAM0yTTY="}]},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"damonoehlman","email":"damon.oehlman@gmail.com"},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}]},"1.0.1":{"name":"clarity","description":"Simple utility to convert obfuscated strings (primary use case is password urls) into the actual equivalent","author":{"name":"Damon Oehlman","email":"damon.oehlman@gmail.com"},"keywords":["password","obfuscate","security"],"version":"1.0.1","dependencies":{},"devDependencies":{"tape":"~1.0.4"},"repository":{"type":"git","url":"https://bitbucket.org/DamonOehlman/clarity.git"},"bugs":{"url":"https://bitbucket.org/DamonOehlman/clarity/issues"},"scripts":{"test":"node test/all.js","gendocs":"gendocs > README.md"},"main":"index.js","directories":{"test":"test"},"license":"MIT","_id":"clarity@1.0.1","dist":{"shasum":"dac9004772d007771cbe6f5a6616c2bacb757930","tarball":"https://registry.npmjs.org/clarity/-/clarity-1.0.1.tgz","integrity":"sha512-JzPULg9juDQUWe+tv5jLyR39KqfBnn/HZGgzu14A2Xs1QzJyJVxde5dpXliK52qTtFWTMbKikf0PBG1dqR4vPg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCC+SrVaNVS5SIM2CzSouegiuZhqcJytxC63YzRY/BQGwIhAOxYwzywuGZMuoTrebGOR2Zo9WuFJuei7dnyx/XIFGkQ"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"damonoehlman","email":"damon.oehlman@gmail.com"},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}]},"1.0.2":{"name":"clarity","description":"Simple utility to convert obfuscated strings (primary use case is password urls) into the actual equivalent","author":{"name":"Damon Oehlman","email":"damon.oehlman@gmail.com"},"keywords":["password","obfuscate","security"],"version":"1.0.2","dependencies":{},"devDependencies":{"tape":"^2"},"scripts":{"test":"node test/all.js","gendocs":"gendocs > README.md"},"main":"index.js","directories":{"test":"test"},"license":"MIT","repository":{"type":"git","url":"https://github.com/DamonOehlman/clarity.git"},"bugs":{"url":"https://github.com/DamonOehlman/clarity/issues"},"homepage":"https://github.com/DamonOehlman/clarity","gitHead":"8696a3b144867a34250168223020c7059413357e","_id":"clarity@1.0.2","_shasum":"c512f9a9f4ed7d2f73598a508e4fcd9ce8e8cfea","_from":".","_npmVersion":"1.4.13","_npmUser":{"name":"damonoehlman","email":"damon.oehlman@gmail.com"},"maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}],"dist":{"shasum":"c512f9a9f4ed7d2f73598a508e4fcd9ce8e8cfea","tarball":"https://registry.npmjs.org/clarity/-/clarity-1.0.2.tgz","integrity":"sha512-u4cliNZkQfQ5HUJh0ROnPWzqGQbGHYnvva+Niq3nAVZiIaih1X9bOlBBDvn8VU6B6nuFMjSRdFRXEX6TvehF2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDO7UJA8x07NktT14dN/Cd7gtnrR5Xs4SqyOZKJWCQQlAIhAJMHgtdMFUwchZa8cv2gi/JPNX29o5xYtufj+RcIqgIE"}]}}},"readme":"# clarity\n\nClarity is a small utility library that is used to provide \"deobfuscation\"\nsupport for your secure data.  The library has been created to deal with \nthe fact that configuration information is generally stored in plaintext\nand saved to repositories such as source control, or centralized\nconfiguration stores (at least that is the idea behind\n[sharedconfig](https://github.com/DamonOehlman/sharedconfig).\n\nWhen this happens, it's very easy to accidently leak passwords or other\ninformation that should remain hidden.\n\nClarity makes it possible to store generalized information in these\ncentralized stores, while storing more sensitive information in alternative\nstores and will reconcile the information at runtime when required.\n\n\n[![NPM](https://nodei.co/npm/clarity.png)](https://nodei.co/npm/clarity/)\n\n[![Build Status](https://img.shields.io/travis/DamonOehlman/clarity.svg?branch=master)](https://travis-ci.org/DamonOehlman/clarity) [![stable](https://img.shields.io/badge/stability-stable-green.svg)](https://github.com/badges/stability-badges) \n\n## Replacing Simple Values\n\nThe most common use case when using clarity is to use it to replace\nconfiguration values with configuration values that are stored in\nenvironment variables.  For instance, consider the following simple\nexample `config.json` file:\n\n```json\n{\n  \"dbserver\": \"localhost\",\n  \"dbport\":   \"7632\",\n  \"dbuser\":   \"admin\",\n  \"dbpass\":   \"teapot\"\n}\n```\n\nIf we were then to import our configuration into our node program, we\nwould be able to access the configuration values:\n\n```js\nvar config = require('./config.json');\n```\n\nUsing this technique for configuration, however, means that we don't\nhave configurations for each of our environments (dev, test, staging,\nproduction) and we have also exposed some sensitive data in our\nconfiguration file.  While we can use a package such as\n[node-config](https://github.com/lorenwest/node-config) to assist with\nmanaging configurations for different environments, we still have\npotentially sensitive information stored in our configuration files.\n\nThis can be avoided by using clarity to put value placeholders in our\nconfiguration instead:\n\n```json\n{\n  \"dbserver\": \"**DB_SERVER**\",\n  \"dbport\":   \"**DB_PORT**\",\n  \"dbuser\":   \"**DB_USER**\",\n  \"dbpass\":   \"**DB_PASS**\"\n}\n```\n\nNow if we were to load the configuration via clarity we could use\nmachine environment variables to replace the values:\n\n```js\nvar clarity = require('clarity')(process.env);\nvar config = clarity.decode(require('./config.json'));\n```\n\nAll values that have appropriate environment variables (e.g.\n`process.env.DB_SERVER`) would be replaced with the relevant value\ninstead.  The only downside of this technique is that in development you\nneed a whole swag of environment variables configured which can be quite\nannoying.\n\nTo make life easier in development, you can use the default value\nfunctionality of clarity.  This is implemented by separating the\nenvironment key with the default value using a pipe (|) character:\n\n```json\n{\n  \"dbserver\": \"**DB_SERVER|localhost**\",\n  \"dbport\":   \"**DB_PORT|7632**\",\n  \"dbuser\":   \"**DB_USER|admin**\",\n  \"dbpass\":   \"**DB_PASS|teapot**\"\n}\n```\n\n## Replacing values from nested data\n\nIt is possible to access nested data values using a period to traverse\nthe data structure. Such as:\n\n```json\n{\n  \"dbserver\": \"**database.host**\",\n  \"dbport\":   \"**database.port**\",\n  \"dbuser\":   \"**database.user**\",\n  \"dbpass\":   \"**database.password**\"\n}\n```\n\n## Reference\n\n### Clarity constructor\n\nCreate a new instance of clarity.\n\n```js\nvar clarity = require('clarity')(process.env);\n```\n\nWhich is equivalent to:\n\n```js\nvar Clarity = require('clarity');\nvar clarity = new Clarity(process.env);\n```\n\n### Clarity#clear()\n\nClear the data currently stored within the clarity store\n\n### Clarity#deepDecode(input)\n\nThe `deepDecode` method is used to unpack an object and decode each\nof the values within the object into it's actual value.\n\n### Clarity#use(data*)\n\nExtend the data stored within clarity with additional data that will be\nused at decode time.\n\n## License(s)\n\n### MIT\n\nCopyright (c) 2014 Damon Oehlman <damon.oehlman@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"damonoehlman","email":"damon.oehlman@sidelab.com"}],"time":{"modified":"2022-06-13T06:05:24.525Z","created":"2012-09-18T02:26:10.868Z","0.0.0":"2012-09-18T02:26:34.145Z","0.1.0":"2012-09-18T04:29:34.906Z","0.1.1":"2012-09-20T06:57:17.454Z","0.1.2":"2012-09-24T01:23:48.173Z","0.1.3":"2012-12-31T01:30:46.090Z","0.1.4":"2012-12-31T01:40:31.217Z","0.1.5":"2013-01-25T06:52:16.481Z","1.0.0":"2013-08-28T23:35:05.805Z","1.0.1":"2013-10-09T23:00:22.726Z","1.0.2":"2014-06-09T05:45:17.866Z"},"author":{"name":"Damon Oehlman","email":"damon.oehlman@gmail.com"},"repository":{"type":"git","url":"https://github.com/DamonOehlman/clarity.git"},"homepage":"https://github.com/DamonOehlman/clarity","keywords":["password","obfuscate","security"],"bugs":{"url":"https://github.com/DamonOehlman/clarity/issues"},"license":"MIT","readmeFilename":"README.md"}