New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@basis-theory/basis-theory-js-encryption-azure

Package Overview
Dependencies
Maintainers
10
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@basis-theory/basis-theory-js-encryption-azure

Azure (Key Vault) Encryption Provider for the [Basis Theory](https://basistheory.com/) JS [Encryption SDK](https://github.com/Basis-Theory/basis-theory-js-encryption).

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
10
Created
Source

BasisTheory JS Azure Encryption Provider

Azure (Key Vault) Encryption Provider for the Basis Theory JS Encryption SDK.

Installation

Using Node Package Manager

npm install --save @basis-theory/basis-theory-js-encryption-azure

Using Yarn

yarn add @basis-theory/basis-theory-js-encryption-azure

Documentation

For further documentation and examples, please refer to our Docs.

Usage

Initialization and Usage with BasisTheoryEncryption

It's required that user provides the vaulUrl to be used for fetching keys/secrets during initialization.

import { BasisTheoryEncryption } from '@basis-theory/basis-theory-js-encryption';
import { BasisTheoryAzureEncryptionProvider } from '@basis-theory/basis-theory-js-encryption-azure';

const azureProvider = new BasisTheoryAzureEncryptionProvider().init({
  vaulUrl: 'https://custom-kms.vault.azure.net'
});
const btEncryption = await new BasisTheoryEncryption().init([azureProvider]);

Caching, VaultUrl and Additional Options

The default cache implementation uses node-cache, but users can implement their own from the interface. Users can also provide their own methods for fetching/saving keys using the keyVaultOptions object.

import { BasisTheoryEncryption } from '@basis-theory/basis-theory-js-encryption';
import { BasisTheoryAzureEncryptionProvider } from '@basis-theory/basis-theory-js-encryption-azure';

const azureProvider = new BasisTheoryAzureEncryptionProvider().init({
  cache: new CacheService(),
  tokenCredential: new DefaultAzureCredential()
  vaulUrl: 'https://custom-kms.vault.azure.net',
  keyVaultOptions: {
    rsaKeySize: 2048,
    keyExpirationInDays: 90,
    getKeyByKeyId: (keyId: string) => { return key; },
    getKeyByName: (name: string, prov: string, alg: string) => { return key; },
    saveKey: (key: ProviderEncryptionKey ) => { return key; },
  },
});


const btEncryption = await new BasisTheoryEncryption().init([azureProvider]);

Development

The provided scripts with the SDK will check for all dependencies, build the solution, and run all tests.

Dependencies

Build the SDK and run Tests

Run the following command from the root of the project:

make verify

FAQs

Package last updated on 24 Sep 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc