Git Product home page Git Product logo

typeorm-encrypted-column's Introduction

Typeorm Encrypted Column

Build Status Coverage Status

Typeorm Encrypted Column is a replacement for typeorm-encrypted.

Differences

Typeorm Encrypted Column works slightly differently.

Typeorm Encrypted Column uses a decorator instead of retyping the options object passed to column. Using this decorator it validates the key and algorithm provided throwing an error if they are not valid. This moves config errors to startup not the first time the encrypted column is accessed.

Usage

import {Entity, PrimaryGeneratedColumn, Column, createConnection} from 'typeorm'
import {Subscriber as EncryptedColumnSubscriber, EncryptedColumn} from 'typeorm-encrypted-column'

@Entity()
class ProtectedData{
  @PrimaryGeneratedColumn()
  id: number

  @Column()
  name: string

  @EncryptedColumn({
    encrypt: {
      key: 'd85117047fd06d3afa79b6e44ee3a52eb426fc24c3a2e3667732e8da0342b4da',
      algorithm: 'aes-256-cbc',
      ivLength: 16,
      looseMatching: false // If true existance of the column will not be checked.
    }
  })
}

let connection = createConnection({
  ...
  entities: [ProtectedData],
  subscribers: [EncryptedColumnSubscriber]
})

Contributing

Pull requests and issues are welcome on this repository.

To build locally pull a copy of the repository and run npm install to get the dependecies.

Testing is done with npm test which will test the code.

typeorm-encrypted-column's People

Contributors

arcath avatar hanjukim avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.