1.2.6 • Published 7 years ago
hinos-requesthasher v1.2.6
hinos-requesthasher
A plugin decrypts querystring, body data (except multipart) and encrypts response body data base on BlowFish for hinos
Install
npm i hinos-requesthasher -S
Examples
Typescript
Use like a middleware
import { Server } from 'hinos';
import { hasher } from 'hinos-hasher';
Server.use(hasher('Key is 8 characters', {
baseOnRequest: false,
mode: ['query', 'body', 'response']
}))
Use in controller (Manual apis which you want encrypt data when you not declare in Server.use)
import { GET, POST, PUT, DELETE, HEAD, INJECT } from 'hinos-route';
import { HASHER, Hasher } from 'hinos-requesthasher';
const key = Hasher.create('Key is 8 characters');
export default class TestController {
@GET('/test')
@HASHER(key, {
baseOnRequest: false,
mode: ['query', 'body', 'response']
})
static async test({ body, headers, query }) {
return {
name: 'thanh'
};
}
}
In that:
- baseOnRequest: Plugin auto detect to encrypt, decrypt base on request from client via "accept" field is "text/encryption"
- mode: Which is encrypted or decrypted.
- query: Decrypt query string on request which is sent by client
- body: Decrypt body data in POST, PUT (except multipart type) which is sent by client
- response: Encrypt response body data which is sent from server to client
1.2.6
7 years ago
1.2.5
7 years ago
1.2.4
7 years ago
1.2.3
7 years ago
1.2.2
7 years ago
1.2.1
7 years ago
1.2.0
7 years ago
1.2.0-alpha.2
7 years ago
1.2.0-alpha.1
7 years ago
1.1.18
7 years ago
1.1.17
7 years ago
1.1.16
8 years ago
1.1.15
8 years ago
1.1.14
8 years ago
1.1.13
8 years ago
1.1.12
8 years ago
1.1.11
8 years ago
1.1.10
8 years ago
1.1.9
8 years ago
1.1.8
8 years ago
1.1.7
8 years ago
1.1.6
8 years ago
1.1.5
8 years ago
1.1.4
8 years ago
1.1.3
8 years ago
1.1.2
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.17
8 years ago
1.0.16
8 years ago
1.0.15
8 years ago
1.0.14
8 years ago
1.0.13
8 years ago
1.0.12
8 years ago
1.0.11
8 years ago
1.0.10
8 years ago
1.0.9
8 years ago
1.0.8
8 years ago
1.0.7
8 years ago
1.0.6
8 years ago
1.0.5
8 years ago
1.0.4
8 years ago
1.0.3
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago