1.2.6 • Published 6 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
6 years ago
1.2.5
6 years ago
1.2.4
6 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.2.0-alpha.2
6 years ago
1.2.0-alpha.1
6 years ago
1.1.18
6 years ago
1.1.17
6 years ago
1.1.16
6 years ago
1.1.15
6 years ago
1.1.14
6 years ago
1.1.13
6 years ago
1.1.12
6 years ago
1.1.11
6 years ago
1.1.10
6 years ago
1.1.9
7 years ago
1.1.8
7 years ago
1.1.7
7 years ago
1.1.6
7 years ago
1.1.5
7 years ago
1.1.4
7 years ago
1.1.3
7 years ago
1.1.2
7 years ago
1.1.1
7 years ago
1.1.0
7 years ago
1.0.17
7 years ago
1.0.16
7 years ago
1.0.15
7 years ago
1.0.14
7 years ago
1.0.13
7 years ago
1.0.12
7 years ago
1.0.11
7 years ago
1.0.10
7 years ago
1.0.9
7 years ago
1.0.8
7 years ago
1.0.7
7 years ago
1.0.6
7 years ago
1.0.5
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago