Skip to content

Commit

Permalink
오류
Browse files Browse the repository at this point in the history
기존 jwt  와  jwe 어떻게 처리할지 더 생각
  • Loading branch information
SangHakLee committed Jun 14, 2017
1 parent 1f16933 commit d9f56b9
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"esversion":6,
"mocha": true,
"asi" : true
}
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sudo: false
language: node_js
before_install: npm i -g mocha
node_js:
- stable
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.0] - 2017-06-12
### Added
- init project
- test spec
- test spec
### Changed
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exports.default = require('lib')
39 changes: 39 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _jsonwebtoken = require('jsonwebtoken');

var _jsonwebtoken2 = _interopRequireDefault(_jsonwebtoken);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var Jwt = function () {
// constructor (payload, secret, option) {
function Jwt() {
_classCallCheck(this, Jwt);
}

_createClass(Jwt, [{
key: 'signE',
value: function signE(payload, secret, option) {}
}, {
key: 'token',
get: function get() {}
}]);

return Jwt;
}();

// NOTE extends not allow. jwt is object


Object.assign(Jwt, _jsonwebtoken2.default);

exports.default = Jwt;
21 changes: 19 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "encrypt payload for JWT",
"main": "index.js",
"scripts": {
"test": "mocha test/*"
"test": "mocha test/*",
"build": "babel src --out-dir lib --presets es2015"
},
"repository": {
"type": "git",
Expand All @@ -21,6 +22,22 @@
},
"homepage": "https://github.com/SangHakLee/jwt-jwe#readme",
"devDependencies": {
"mocha": "^3.4.2"
"babel-cli": "^6.24.1",
"babel-preset-env": "^1.5.2",
"babel-preset-es2015": "^6.24.1",
"debug": "^2.6.8",
"mocha": "^3.4.2",
"standard": "^10.0.2"
},
"dependencies": {
"jsonwebtoken": "^7.4.1"
},
"standard": {
"ignore": [
"lib/*"
],
"env": [
"mocha"
]
}
}
19 changes: 19 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import jwt from 'jsonwebtoken'
class Jwt {
// constructor (payload, secret, option) {
constructor () {
}

get token () {

}

signE (payload, secret, option) {

}
}

// NOTE extends not allow. jwt is object
Object.assign(Jwt, jwt)

export default Jwt
11 changes: 9 additions & 2 deletions test/jwt-jwe.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
'use strict'
const debug = require('debug')

const Jwt = require('../lib').default
console.log('Jwt', Jwt)

describe(`jwt-jwe`, () => {
describe(`test`, () => {
it(`1`, () => {

const jwt = new Jwt()
debug(jwt)
})
})
})
})

0 comments on commit d9f56b9

Please sign in to comment.