Socket
Socket
Sign inDemoInstall

clarity

Package Overview
Dependencies
2
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    clarity

Simple utility to convert obfuscated strings (primary use case is password urls) into the actual equivalent


Version published
Weekly downloads
7
decreased by-41.67%
Maintainers
1
Install size
58.6 kB
Created
Weekly downloads
 

Readme

Source

clarity

Clarity is a small utility library that is used to provide "deobfuscation" support for your secure data. The library has been created to deal with the fact that configuration information is generally stored in plaintext and saved to repositories such as source control, or centralized configuration stores (at least that is the idea behind sharedconfig. When this happens, it's very easy to accidently leak passwords or other information that should remain hidden.

Clarity makes it possible to store generalized information in these centralized stores, while storing more sensitive information in alternative stores and will reconcile the information at runtime when required.

Let's look at a really simple example first. In this example, we have a url to a CouchDB instance stored in our application code:

var targetUrl = 'http://test:test@damonoehlman.iriscouch.com/clarity-tests',
    db = require('nano')(targetUrl);

In the case above, both our username and password have been exposed, which is probably less than ideal. Using clarity though, we can obfuscate the connection string in the code and recreate the actual connection string by combining the information with ENVIRONMENT VARIABLES stored on the machine:

var clarity = require('clarity').use(process.env),
    targetUrl = http://test:*****@damonoehlman.iriscouch.com/clarity-tests',
    db = require('nano')(clarity.decode(targetUrl));

In the case above, clarity will be looking for a key of test_pass within the configured stores.

FAQs

Last updated on 31 Dec 2012

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc