@things-factory/auth-base 6.1.172 → 6.1.174

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/config/config.production.js +3 -1
  2. package/dist-client/tsconfig.tsbuildinfo +1 -1
  3. package/dist-server/middlewares/index.js +26 -11
  4. package/dist-server/middlewares/index.js.map +1 -1
  5. package/dist-server/middlewares/jwt-authenticate-middleware.js +3 -4
  6. package/dist-server/middlewares/jwt-authenticate-middleware.js.map +1 -1
  7. package/dist-server/middlewares/signin-middleware.js +3 -3
  8. package/dist-server/middlewares/signin-middleware.js.map +1 -1
  9. package/dist-server/router/oauth2/passport-oauth2-client-password.js +3 -3
  10. package/dist-server/router/oauth2/passport-oauth2-client-password.js.map +1 -1
  11. package/dist-server/router/oauth2/passport-refresh-token.js +3 -3
  12. package/dist-server/router/oauth2/passport-refresh-token.js.map +1 -1
  13. package/dist-server/router/site-root-router.js +2 -2
  14. package/dist-server/router/site-root-router.js.map +1 -1
  15. package/dist-server/routes.js +10 -6
  16. package/dist-server/routes.js.map +1 -1
  17. package/dist-server/service/user/user.d.ts +1 -0
  18. package/dist-server/service/user/user.js +45 -0
  19. package/dist-server/service/user/user.js.map +1 -1
  20. package/dist-server/tsconfig.tsbuildinfo +1 -1
  21. package/package.json +9 -10
  22. package/server/middlewares/index.ts +38 -15
  23. package/server/middlewares/jwt-authenticate-middleware.ts +1 -2
  24. package/server/middlewares/signin-middleware.ts +1 -1
  25. package/server/router/oauth2/passport-oauth2-client-password.ts +1 -1
  26. package/server/router/oauth2/passport-refresh-token.ts +1 -1
  27. package/server/router/site-root-router.ts +1 -1
  28. package/server/routes.ts +15 -7
  29. package/server/service/user/user.ts +50 -0
@@ -12,5 +12,7 @@ module.exports = {
12
12
  looseCharacterLength: 15,
13
13
  history: 4
14
14
  },
15
- accessTokenCookieKey: 'access_token'
15
+ accessTokenCookieKey: 'access_token',
16
+ applianceJwtExpiresIn: '1y',
17
+ publicHomeRoute: '/public/home'
16
18
  }
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../../node_modules/lerna/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../client/auth.ts","../../../node_modules/@operato/shell/dist/src/types/domain.d.ts","../../../node_modules/@operato/shell/dist/src/types/user.d.ts","../../../node_modules/@operato/shell/dist/src/types/role.d.ts","../../../node_modules/@operato/shell/dist/src/types/privilege.d.ts","../../../node_modules/@operato/shell/dist/src/types/types.d.ts","../../../node_modules/@operato/shell/dist/src/types/index.d.ts","../../../node_modules/redux/index.d.ts","../../../node_modules/pwa-helpers/lazy-reducer-enhancer.d.ts","../../../node_modules/@operato/shell/dist/src/store.d.ts","../../../node_modules/@operato/shell/dist/src/actions/app.d.ts","../../../node_modules/@operato/shell/dist/src/actions/route.d.ts","../../../node_modules/@operato/shell/dist/src/actions/busy.d.ts","../../../node_modules/@operato/shell/dist/src/actions/const.d.ts","../../../node_modules/@operato/shell/dist/src/actions/index.d.ts","../../../node_modules/@lit/reactive-element/css-tag.d.ts","../../../node_modules/@lit/reactive-element/reactive-controller.d.ts","../../../node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/@types/trusted-types/lib/index.d.ts","../../../node_modules/@types/trusted-types/index.d.ts","../../../node_modules/lit-html/directive.d.ts","../../../node_modules/lit-html/lit-html.d.ts","../../../node_modules/lit-element/lit-element.d.ts","../../../node_modules/lit-html/is-server.d.ts","../../../node_modules/lit/index.d.ts","../../../node_modules/@operato/shell/dist/src/app/pages/page-view.d.ts","../../../node_modules/@operato/shell/dist/src/object-store.d.ts","../../../node_modules/@operato/shell/dist/src/index.d.ts","../../../node_modules/redux-thunk/es/types.d.ts","../../../node_modules/redux-thunk/es/index.d.ts","../client/actions/auth.ts","../client/reducers/auth.ts","../client/bootstrap.ts","../client/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@jest/expect-utils/build/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/@sinclair/typebox/typebox.d.ts","../../../node_modules/@jest/schemas/build/index.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/expect/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"f3d4da15233e593eacb3965cde7960f3fddf5878528d882bcedd5cbaba0193c7","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"7a1971efcba559ea9002ada4c4e3c925004fb67a755300d53b5edf9399354900",{"version":"bad4d7b5a5214c4d9f744e1d62bdd6f2cbf1636230ef18ed8584a7996a0d5b1d","signature":"a72c434f56a00b2f0aee1a999599c93b381efbe029e3bdeab5e5b942f0090a24"},"4d4cf93a6b4c81851ad759e4569b6feb7a701e80b13a6f9d8d9c6012bbb86bd6","2e6035af8f3e43bf95e4983329c8277d66f9b271106af27b99a85d1c1b9daf4a","774308610e8d4a9954cd93840f99decbf340accfe3ad7365547950ede8162c92","36c15dd26c66c97b9df26ce34baacdb13fc760c5b9a2d789dcc317d27b189257","3d7c0b593a29d717b2b2ba3f03f819c3c48bf9e250d79c4a31860af80f177e8c","f228d440342f5d0933f5db093aafab2f07de24a427b4488ccfae27b7457d7666",{"version":"fd624f7d7b264922476685870f08c5e1c6d6a0f05dee2429a9747b41f6b699d4","affectsGlobalScope":true},"701978f3975f96e76e3ffc2e1762e3a97e3d323812049fb6fdfd559579b89708",{"version":"4ab17f80ced148d509345cee706b2b85941515dd76e32cf47118bcdf6a4bd56a","affectsGlobalScope":true},"641089f0b8094ef74b9d4b3364d5dec1592d5e3b8a51c1ba491bc8872049e79a","9197b3ca76c01df6120b4ee288fe2d08f8a2089221da97956bee402de0ffd37e","b42033bf1067564808e4d360d79281667c2b3b0792c2d615ab641eb85974d4ba","7af29b0589483f7bb8a99405ddb849f34bc053146184561ed4179e02f5fe4d0f","78faa3783191b2d5d5f7a9e835ee3f6a1456dc391d6eb5b40d3a27dfd9decd6e","52dd370c807255c61765347fc90a9bee3c522b8744dc222714e2bf6b5be3a823","1e5743b25a63fd34ffbae89adcbf248ee17db6ed08d90079ffa93803c3e80d2a","ccf8ea81b0ac699c220b874b804ad02b8aabc5b494e1c3bda0d255ec8d08694d","15fe687c59d62741b4494d5e623d497d55eb38966ecf5bea7f36e48fc3fbe15e",{"version":"17f2b4d00e42e0cc1dfc3be692a6da5a14a6cb73b87259e6d20ff02bcd6d573f","affectsGlobalScope":true},"c567d37119d6f56381af48eb7516030ccf35a36f9aca045e238d9c207a7c536c","b448dfbb5a6c4505f6b6beab587cf41f180ad62bcb506b44e3f2c09d20ba63a9","eba7cf33380cc3a3cf614faf67300e14d0bdff9ea6c5cd6f4b040b1756a48ab1","5e7e090243bf203382a5cb04eabbdc38d78f6d5922f16f543e4da8fa007d5ff9","cd823094ded7c8ac4f94ab6dc387dab699293eb8323d9f948304efc07e4ae7b2","6bf72b2541469cac7a7882468d25a04fdff489625452ff7d3e670c764e5a9ba1","fc48282c397084016a939e1b3f91dcaf4199b6cba339d91d8b2dc2acade79762","981fc22acc36b6a33c9f5b3d468e975b104cf3409b881ca6cffe84c5f9fda7c1","d50a158fc581be7b1c51253ad33cb29c0a8ce3c42ca38775ffadf104c36376d0","1f2cdbf59d0b7933678a64ac26ae2818c48ff9ebf93249dde775dc3e173e16bf",{"version":"d9ada24b70b5731f77ad997ad1bb671b80dcdff931e7c46171fef07ee0dad104","signature":"64b224909f444ceb75c3306e078b6cd5f484b1487ffe18e13f150c9d2689dcd8"},{"version":"d3a72e3acec55990c739ec2c7ec487ace738418d0650356c2db86b67a3d1b818","signature":"6a716b8d3a52002354a3e530ee6c90d52209af1f53eaefb9c4527228bf0a6f67"},{"version":"8d55dba17babd73716321b2ed065017dcbe6c84fc21aa0cab4e3cc48fbdc526e","signature":"aac4ddff3d5c1247433870879e9838b1e23b81a9b62c75f59c3e1b64802f2b16"},{"version":"f528a2210943d5d3f1f4a154387da39afab55e9e91ca68f6fb4e3ef8a43a9823","signature":"0d1e9013237428428f2c4b8c4c64e3b5fce66d8140bc75629c0cc320c85c4925"},"09df3b4f1c937f02e7fee2836d4c4d7a63e66db70fd4d4e97126f4542cc21d9d","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419",{"version":"32465ea19404cb188e84cf08c6b1f6b12d739140436402cdbc184a3fd20a7d81","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"45c22e7e615c8bb6e27325339490f6bd83828d843f9f3cf0ce9fd4d81f6cd923","affectsGlobalScope":true},"546ab07e19116d935ad982e76a223275b53bff7771dab94f433b7ab04652936e","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"aefb5a4a209f756b580eb53ea771cca8aad411603926f307a5e5b8ec6b16dcf6","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","f5a8b7ec4b798c88679194a8ebc25dcb6f5368e6e5811fcda9fe12b0d445b8db","b86e1a45b29437f3a99bad4147cb9fe2357617e8008c0484568e5bb5138d6e13","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","42c431e7965b641106b5e25ab3283aa4865ca7bb9909610a2abfa6226e4348be","0b7e732af0a9599be28c091d6bd1cb22c856ec0d415d4749c087c3881ca07a56","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"738a0de235edb5caf581c5aa86f5dd48ee28b2d0da1e327cbc57cdabde116bda","affectsGlobalScope":true},"3b4c85eea12187de9929a76792b98406e8778ce575caca8c574f06da82622c54","f788131a39c81e0c9b9e463645dd7132b5bc1beb609b0e31e5c1ceaea378b4df","1ee64912f7961165a3b6e6209fb7a8aced98b578ca1373b9f0ea144edfe17f6c","21894466693f64957b9bd4c80fa3ec7fdfd4efa9d1861e070aca23f10220c9b2","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","ad8848c289c0b633452e58179f46edccd14b5a0fe90ebce411f79ff040b803e0",{"version":"5d4ef3f46c7f9d62f7c964f9f9ccdd293be99fb3dcc66c983f2aea7430e3c7c6","affectsGlobalScope":true},"91f8b5abcdff8f9ecb9656b9852878718416fb7700b2c4fad8331e5b97c080bb","59d8f064f86a4a2be03b33c0efcc9e7a268ad27b22f82dce16899f3364f70ba8","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"f49fb15c4aa06b65b0dce4db4584bfd8a9f74644baef1511b404dc95be34af00","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"7aaeb5e62f90e1b2be0fc4844df78cdb1be15c22b427bc6c39d57308785b8f10","3ba30205a029ebc0c91d7b1ab4da73f6277d730ca1fc6692d5a9144c6772c76b","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","8258e69a3b0de494ea55eeea7a4d3216ac112c12006c74dfd381c0d5e42a2607","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"786dd9ad95e335a5e76759d078940fdb5001b74498a31f90fad98afe196a84ca","affectsGlobalScope":true},{"version":"cbf046714f3a3ba2544957e1973ac94aa819fa8aa668846fa8de47eb1c41b0b2","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eae74e3d50820f37c72c0679fed959cd1e63c98f6a146a55b8c4361582fa6a52","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"aed89e3c18f4c659ee8153a76560dffda23e2d801e1e60d7a67abd84bc555f8d","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","2f940651c2f30e6b29f8743fae3f40b7b1c03615184f837132b56ea75edad08b","5749c327c3f789f658072f8340786966c8b05ea124a56c1d8d60e04649495a4d",{"version":"c9d62b2a51b2ff166314d8be84f6881a7fcbccd37612442cf1c70d27d5352f50","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"d3f4c342fb62f348f25f54b473b0ab7371828cbf637134194fa9cdf04856f87b","cdcc132f207d097d7d3aa75615ab9a2e71d6a478162dde8b67f88ea19f3e54de","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","c085e9aa62d1ae1375794c1fb927a445fa105fed891a7e24edbb1c3300f7384a","f315e1e65a1f80992f0509e84e4ae2df15ecd9ef73df975f7c98813b71e4c8da","5b9586e9b0b6322e5bfbd2c29bd3b8e21ab9d871f82346cb71020e3d84bae73e","3e70a7e67c2cb16f8cd49097360c0309fe9d1e3210ff9222e9dac1f8df9d4fb6","ab68d2a3e3e8767c3fba8f80de099a1cfc18c0de79e42cb02ae66e22dfe14a66","d96cc6598148bf1a98fb2e8dcf01c63a4b3558bdaec6ef35e087fd0562eb40ec",{"version":"c8950367d1812758e9e354c695c60c3e6311bf2cd98b9f9eb469a19df8a9a486","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"noImplicitAny":false,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"target":4,"useDefineForClassFields":false},"fileIdsList":[[125],[125,135],[60,61,125],[55,56,57,58,125],[69,125],[51,54,59,70,71,125],[52,53,125],[46,47,48,49,50,125],[47,48,125],[46,47,49,125],[125,137,140],[79,125],[82,125],[83,88,116,125],[84,95,96,103,113,124,125],[84,85,95,103,125],[86,125],[87,88,96,104,125],[88,113,121,125],[89,91,95,103,125],[90,125],[91,92,125],[95,125],[93,95,125],[95,96,97,113,124,125],[95,96,97,110,113,116,125],[125,129],[91,95,98,103,113,124,125],[95,96,98,99,103,113,121,124,125],[98,100,113,121,124,125],[79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131],[95,101,125],[102,124,125,129],[91,95,103,113,125],[104,125],[105,125],[82,106,125],[107,123,125,129],[108,125],[109,125],[95,110,111,125],[110,112,125,127],[83,95,113,114,115,116,125],[83,113,115,125],[113,114,125],[116,125],[117,125],[82,113,125],[95,119,120,125],[119,120,125],[88,103,113,121,125],[122,125],[103,123,125],[83,98,109,124,125],[88,125],[113,125,126],[102,125,127],[125,128],[83,88,95,97,106,113,124,125,127,129],[113,125,130],[63,125],[125,133,139],[125,137],[125,134,138],[62,66,125],[66,125],[64,65,125],[62,66,67,68,125],[125,136],[52,125],[52,73,125],[44,52,74,125],[44,125],[44,45,72,75,76,125],[44,45,125],[44,75,125],[52,74],[45]],"referencedMap":[[133,1],[136,2],[60,1],[61,1],[62,3],[55,1],[57,1],[58,1],[59,4],[56,1],[70,5],[72,6],[71,1],[54,7],[46,1],[51,8],[49,9],[48,10],[50,1],[47,1],[135,1],[141,11],[79,12],[80,12],[82,13],[83,14],[84,15],[85,16],[86,17],[87,18],[88,19],[89,20],[90,21],[91,22],[92,22],[94,23],[93,24],[95,23],[96,25],[97,26],[81,27],[131,1],[98,28],[99,29],[100,30],[132,31],[101,32],[102,33],[103,34],[104,35],[105,36],[106,37],[107,38],[108,39],[109,40],[110,41],[111,41],[112,42],[113,43],[115,44],[114,45],[116,46],[117,47],[118,48],[119,49],[120,50],[121,51],[122,52],[123,53],[124,54],[125,55],[126,56],[127,57],[128,58],[129,59],[130,60],[64,61],[63,1],[134,1],[140,62],[138,63],[139,64],[8,1],[9,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[34,1],[31,1],[32,1],[33,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[1,1],[43,1],[67,65],[65,66],[68,1],[66,67],[69,68],[137,69],[53,70],[74,71],[73,70],[52,1],[44,1],[75,72],[45,73],[77,74],[78,75],[76,76]],"exportedModulesMap":[[133,1],[136,2],[60,1],[61,1],[62,3],[55,1],[57,1],[58,1],[59,4],[56,1],[70,5],[72,6],[71,1],[54,7],[46,1],[51,8],[49,9],[48,10],[50,1],[47,1],[135,1],[141,11],[79,12],[80,12],[82,13],[83,14],[84,15],[85,16],[86,17],[87,18],[88,19],[89,20],[90,21],[91,22],[92,22],[94,23],[93,24],[95,23],[96,25],[97,26],[81,27],[131,1],[98,28],[99,29],[100,30],[132,31],[101,32],[102,33],[103,34],[104,35],[105,36],[106,37],[107,38],[108,39],[109,40],[110,41],[111,41],[112,42],[113,43],[115,44],[114,45],[116,46],[117,47],[118,48],[119,49],[120,50],[121,51],[122,52],[123,53],[124,54],[125,55],[126,56],[127,57],[128,58],[129,59],[130,60],[64,61],[63,1],[134,1],[140,62],[138,63],[139,64],[8,1],[9,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[34,1],[31,1],[32,1],[33,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[1,1],[43,1],[67,65],[65,66],[68,1],[66,67],[69,68],[137,69],[53,70],[74,71],[73,70],[52,1],[44,1],[75,77],[78,78]],"semanticDiagnosticsPerFile":[133,136,60,61,62,55,57,58,59,56,70,72,71,54,46,51,49,48,50,47,135,141,79,80,82,83,84,85,86,87,88,89,90,91,92,94,93,95,96,97,81,131,98,99,100,132,101,102,103,104,105,106,107,108,109,110,111,112,113,115,114,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,64,63,134,140,138,139,8,9,11,10,2,12,13,14,15,16,17,18,19,3,4,23,20,21,22,24,25,26,5,27,28,29,30,6,34,31,32,33,35,7,36,41,42,37,38,39,40,1,43,67,65,68,66,69,137,53,74,73,52,44,75,45,77,78,76]},"version":"4.9.5"}
1
+ {"program":{"fileNames":["../../../node_modules/lerna/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/lerna/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../client/auth.ts","../../../node_modules/@operato/shell/dist/src/types/domain.d.ts","../../../node_modules/@operato/shell/dist/src/types/user.d.ts","../../../node_modules/@operato/shell/dist/src/types/role.d.ts","../../../node_modules/@operato/shell/dist/src/types/privilege.d.ts","../../../node_modules/@operato/shell/dist/src/types/types.d.ts","../../../node_modules/@operato/shell/dist/src/types/index.d.ts","../../../node_modules/redux/index.d.ts","../../../node_modules/pwa-helpers/lazy-reducer-enhancer.d.ts","../../../node_modules/@operato/shell/dist/src/store.d.ts","../../../node_modules/@operato/shell/dist/src/actions/app.d.ts","../../../node_modules/@operato/shell/dist/src/actions/route.d.ts","../../../node_modules/@operato/shell/dist/src/actions/busy.d.ts","../../../node_modules/@operato/shell/dist/src/actions/const.d.ts","../../../node_modules/@operato/shell/dist/src/actions/index.d.ts","../../../node_modules/@lit/reactive-element/css-tag.d.ts","../../../node_modules/@lit/reactive-element/reactive-controller.d.ts","../../../node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/@types/trusted-types/lib/index.d.ts","../../../node_modules/@types/trusted-types/index.d.ts","../../../node_modules/lit-html/directive.d.ts","../../../node_modules/lit-html/lit-html.d.ts","../../../node_modules/lit-element/lit-element.d.ts","../../../node_modules/lit-html/is-server.d.ts","../../../node_modules/lit/index.d.ts","../../../node_modules/@operato/shell/dist/src/app/pages/page-view.d.ts","../../../node_modules/@operato/shell/dist/src/object-store.d.ts","../../../node_modules/@operato/shell/dist/src/index.d.ts","../../../node_modules/redux-thunk/es/types.d.ts","../../../node_modules/redux-thunk/es/index.d.ts","../client/actions/auth.ts","../client/reducers/auth.ts","../client/bootstrap.ts","../client/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@jest/expect-utils/build/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/@sinclair/typebox/typebox.d.ts","../../../node_modules/@jest/schemas/build/index.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/expect/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"f3d4da15233e593eacb3965cde7960f3fddf5878528d882bcedd5cbaba0193c7","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"7a1971efcba559ea9002ada4c4e3c925004fb67a755300d53b5edf9399354900",{"version":"bad4d7b5a5214c4d9f744e1d62bdd6f2cbf1636230ef18ed8584a7996a0d5b1d","signature":"a72c434f56a00b2f0aee1a999599c93b381efbe029e3bdeab5e5b942f0090a24"},"4d4cf93a6b4c81851ad759e4569b6feb7a701e80b13a6f9d8d9c6012bbb86bd6","2e6035af8f3e43bf95e4983329c8277d66f9b271106af27b99a85d1c1b9daf4a","774308610e8d4a9954cd93840f99decbf340accfe3ad7365547950ede8162c92","36c15dd26c66c97b9df26ce34baacdb13fc760c5b9a2d789dcc317d27b189257","3d7c0b593a29d717b2b2ba3f03f819c3c48bf9e250d79c4a31860af80f177e8c","f228d440342f5d0933f5db093aafab2f07de24a427b4488ccfae27b7457d7666",{"version":"fd624f7d7b264922476685870f08c5e1c6d6a0f05dee2429a9747b41f6b699d4","affectsGlobalScope":true},"701978f3975f96e76e3ffc2e1762e3a97e3d323812049fb6fdfd559579b89708",{"version":"4ab17f80ced148d509345cee706b2b85941515dd76e32cf47118bcdf6a4bd56a","affectsGlobalScope":true},"641089f0b8094ef74b9d4b3364d5dec1592d5e3b8a51c1ba491bc8872049e79a","9197b3ca76c01df6120b4ee288fe2d08f8a2089221da97956bee402de0ffd37e","b42033bf1067564808e4d360d79281667c2b3b0792c2d615ab641eb85974d4ba","7af29b0589483f7bb8a99405ddb849f34bc053146184561ed4179e02f5fe4d0f","78faa3783191b2d5d5f7a9e835ee3f6a1456dc391d6eb5b40d3a27dfd9decd6e","52dd370c807255c61765347fc90a9bee3c522b8744dc222714e2bf6b5be3a823","1e5743b25a63fd34ffbae89adcbf248ee17db6ed08d90079ffa93803c3e80d2a","ccf8ea81b0ac699c220b874b804ad02b8aabc5b494e1c3bda0d255ec8d08694d","15fe687c59d62741b4494d5e623d497d55eb38966ecf5bea7f36e48fc3fbe15e",{"version":"17f2b4d00e42e0cc1dfc3be692a6da5a14a6cb73b87259e6d20ff02bcd6d573f","affectsGlobalScope":true},"c567d37119d6f56381af48eb7516030ccf35a36f9aca045e238d9c207a7c536c","b448dfbb5a6c4505f6b6beab587cf41f180ad62bcb506b44e3f2c09d20ba63a9","eba7cf33380cc3a3cf614faf67300e14d0bdff9ea6c5cd6f4b040b1756a48ab1","5e7e090243bf203382a5cb04eabbdc38d78f6d5922f16f543e4da8fa007d5ff9","cd823094ded7c8ac4f94ab6dc387dab699293eb8323d9f948304efc07e4ae7b2","6bf72b2541469cac7a7882468d25a04fdff489625452ff7d3e670c764e5a9ba1","fc48282c397084016a939e1b3f91dcaf4199b6cba339d91d8b2dc2acade79762","981fc22acc36b6a33c9f5b3d468e975b104cf3409b881ca6cffe84c5f9fda7c1","d50a158fc581be7b1c51253ad33cb29c0a8ce3c42ca38775ffadf104c36376d0","1f2cdbf59d0b7933678a64ac26ae2818c48ff9ebf93249dde775dc3e173e16bf",{"version":"d9ada24b70b5731f77ad997ad1bb671b80dcdff931e7c46171fef07ee0dad104","signature":"64b224909f444ceb75c3306e078b6cd5f484b1487ffe18e13f150c9d2689dcd8"},{"version":"d3a72e3acec55990c739ec2c7ec487ace738418d0650356c2db86b67a3d1b818","signature":"6a716b8d3a52002354a3e530ee6c90d52209af1f53eaefb9c4527228bf0a6f67"},{"version":"8d55dba17babd73716321b2ed065017dcbe6c84fc21aa0cab4e3cc48fbdc526e","signature":"aac4ddff3d5c1247433870879e9838b1e23b81a9b62c75f59c3e1b64802f2b16"},{"version":"f528a2210943d5d3f1f4a154387da39afab55e9e91ca68f6fb4e3ef8a43a9823","signature":"0d1e9013237428428f2c4b8c4c64e3b5fce66d8140bc75629c0cc320c85c4925"},"09df3b4f1c937f02e7fee2836d4c4d7a63e66db70fd4d4e97126f4542cc21d9d","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419",{"version":"32465ea19404cb188e84cf08c6b1f6b12d739140436402cdbc184a3fd20a7d81","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"45c22e7e615c8bb6e27325339490f6bd83828d843f9f3cf0ce9fd4d81f6cd923","affectsGlobalScope":true},"546ab07e19116d935ad982e76a223275b53bff7771dab94f433b7ab04652936e","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"aefb5a4a209f756b580eb53ea771cca8aad411603926f307a5e5b8ec6b16dcf6","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","f5a8b7ec4b798c88679194a8ebc25dcb6f5368e6e5811fcda9fe12b0d445b8db","b86e1a45b29437f3a99bad4147cb9fe2357617e8008c0484568e5bb5138d6e13","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","42c431e7965b641106b5e25ab3283aa4865ca7bb9909610a2abfa6226e4348be","0b7e732af0a9599be28c091d6bd1cb22c856ec0d415d4749c087c3881ca07a56","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"c65eca1f892b9e5ee97af93963b2bdf813e4be3b599d06dfb681da19df8358b0","affectsGlobalScope":true},"3b4c85eea12187de9929a76792b98406e8778ce575caca8c574f06da82622c54","f788131a39c81e0c9b9e463645dd7132b5bc1beb609b0e31e5c1ceaea378b4df","1ee64912f7961165a3b6e6209fb7a8aced98b578ca1373b9f0ea144edfe17f6c","21894466693f64957b9bd4c80fa3ec7fdfd4efa9d1861e070aca23f10220c9b2","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","ad8848c289c0b633452e58179f46edccd14b5a0fe90ebce411f79ff040b803e0",{"version":"5d4ef3f46c7f9d62f7c964f9f9ccdd293be99fb3dcc66c983f2aea7430e3c7c6","affectsGlobalScope":true},"91f8b5abcdff8f9ecb9656b9852878718416fb7700b2c4fad8331e5b97c080bb","59d8f064f86a4a2be03b33c0efcc9e7a268ad27b22f82dce16899f3364f70ba8","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"f49fb15c4aa06b65b0dce4db4584bfd8a9f74644baef1511b404dc95be34af00","affectsGlobalScope":true},{"version":"d48009cbe8a30a504031cc82e1286f78fed33b7a42abf7602c23b5547b382563","affectsGlobalScope":true},"7aaeb5e62f90e1b2be0fc4844df78cdb1be15c22b427bc6c39d57308785b8f10","3ba30205a029ebc0c91d7b1ab4da73f6277d730ca1fc6692d5a9144c6772c76b","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"786dd9ad95e335a5e76759d078940fdb5001b74498a31f90fad98afe196a84ca","affectsGlobalScope":true},{"version":"cbf046714f3a3ba2544957e1973ac94aa819fa8aa668846fa8de47eb1c41b0b2","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eae74e3d50820f37c72c0679fed959cd1e63c98f6a146a55b8c4361582fa6a52","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"aed89e3c18f4c659ee8153a76560dffda23e2d801e1e60d7a67abd84bc555f8d","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","2f940651c2f30e6b29f8743fae3f40b7b1c03615184f837132b56ea75edad08b","5749c327c3f789f658072f8340786966c8b05ea124a56c1d8d60e04649495a4d",{"version":"c9d62b2a51b2ff166314d8be84f6881a7fcbccd37612442cf1c70d27d5352f50","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"d3f4c342fb62f348f25f54b473b0ab7371828cbf637134194fa9cdf04856f87b","cdcc132f207d097d7d3aa75615ab9a2e71d6a478162dde8b67f88ea19f3e54de","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","c085e9aa62d1ae1375794c1fb927a445fa105fed891a7e24edbb1c3300f7384a","f315e1e65a1f80992f0509e84e4ae2df15ecd9ef73df975f7c98813b71e4c8da","5b9586e9b0b6322e5bfbd2c29bd3b8e21ab9d871f82346cb71020e3d84bae73e","3e70a7e67c2cb16f8cd49097360c0309fe9d1e3210ff9222e9dac1f8df9d4fb6","ab68d2a3e3e8767c3fba8f80de099a1cfc18c0de79e42cb02ae66e22dfe14a66","d96cc6598148bf1a98fb2e8dcf01c63a4b3558bdaec6ef35e087fd0562eb40ec",{"version":"c8950367d1812758e9e354c695c60c3e6311bf2cd98b9f9eb469a19df8a9a486","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"noImplicitAny":false,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"target":4,"useDefineForClassFields":false},"fileIdsList":[[125],[125,135],[60,61,125],[55,56,57,58,125],[69,125],[51,54,59,70,71,125],[52,53,125],[46,47,48,49,50,125],[47,48,125],[46,47,49,125],[125,137,140],[79,125],[82,125],[83,88,116,125],[84,95,96,103,113,124,125],[84,85,95,103,125],[86,125],[87,88,96,104,125],[88,113,121,125],[89,91,95,103,125],[90,125],[91,92,125],[95,125],[93,95,125],[82,95,125],[95,96,97,113,124,125],[95,96,97,110,113,116,125],[125,129],[91,95,98,103,113,124,125],[95,96,98,99,103,113,121,124,125],[98,100,113,121,124,125],[79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131],[95,101,125],[102,124,125,129],[91,95,103,113,125],[104,125],[105,125],[82,106,125],[107,123,125,129],[108,125],[109,125],[95,110,111,125],[110,112,125,127],[83,95,113,114,115,116,125],[83,113,115,125],[113,114,125],[116,125],[117,125],[82,113,125],[95,119,120,125],[119,120,125],[88,103,113,121,125],[122,125],[103,123,125],[83,98,109,124,125],[88,125],[113,125,126],[102,125,127],[125,128],[83,88,95,97,106,113,124,125,127,129],[113,125,130],[63,125],[125,133,139],[125,137],[125,134,138],[62,66,125],[66,125],[64,65,125],[62,66,67,68,125],[125,136],[52,125],[52,73,125],[44,52,74,125],[44,125],[44,45,72,75,76,125],[44,45,125],[44,75,125],[52,74],[45]],"referencedMap":[[133,1],[136,2],[60,1],[61,1],[62,3],[55,1],[57,1],[58,1],[59,4],[56,1],[70,5],[72,6],[71,1],[54,7],[46,1],[51,8],[49,9],[48,10],[50,1],[47,1],[135,1],[141,11],[79,12],[80,12],[82,13],[83,14],[84,15],[85,16],[86,17],[87,18],[88,19],[89,20],[90,21],[91,22],[92,22],[94,23],[93,24],[95,25],[96,26],[97,27],[81,28],[131,1],[98,29],[99,30],[100,31],[132,32],[101,33],[102,34],[103,35],[104,36],[105,37],[106,38],[107,39],[108,40],[109,41],[110,42],[111,42],[112,43],[113,44],[115,45],[114,46],[116,47],[117,48],[118,49],[119,50],[120,51],[121,52],[122,53],[123,54],[124,55],[125,56],[126,57],[127,58],[128,59],[129,60],[130,61],[64,62],[63,1],[134,1],[140,63],[138,64],[139,65],[8,1],[9,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[34,1],[31,1],[32,1],[33,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[1,1],[43,1],[67,66],[65,67],[68,1],[66,68],[69,69],[137,70],[53,71],[74,72],[73,71],[52,1],[44,1],[75,73],[45,74],[77,75],[78,76],[76,77]],"exportedModulesMap":[[133,1],[136,2],[60,1],[61,1],[62,3],[55,1],[57,1],[58,1],[59,4],[56,1],[70,5],[72,6],[71,1],[54,7],[46,1],[51,8],[49,9],[48,10],[50,1],[47,1],[135,1],[141,11],[79,12],[80,12],[82,13],[83,14],[84,15],[85,16],[86,17],[87,18],[88,19],[89,20],[90,21],[91,22],[92,22],[94,23],[93,24],[95,25],[96,26],[97,27],[81,28],[131,1],[98,29],[99,30],[100,31],[132,32],[101,33],[102,34],[103,35],[104,36],[105,37],[106,38],[107,39],[108,40],[109,41],[110,42],[111,42],[112,43],[113,44],[115,45],[114,46],[116,47],[117,48],[118,49],[119,50],[120,51],[121,52],[122,53],[123,54],[124,55],[125,56],[126,57],[127,58],[128,59],[129,60],[130,61],[64,62],[63,1],[134,1],[140,63],[138,64],[139,65],[8,1],[9,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[4,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[34,1],[31,1],[32,1],[33,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[1,1],[43,1],[67,66],[65,67],[68,1],[66,68],[69,69],[137,70],[53,71],[74,72],[73,71],[52,1],[44,1],[75,78],[78,79]],"semanticDiagnosticsPerFile":[133,136,60,61,62,55,57,58,59,56,70,72,71,54,46,51,49,48,50,47,135,141,79,80,82,83,84,85,86,87,88,89,90,91,92,94,93,95,96,97,81,131,98,99,100,132,101,102,103,104,105,106,107,108,109,110,111,112,113,115,114,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,64,63,134,140,138,139,8,9,11,10,2,12,13,14,15,16,17,18,19,3,4,23,20,21,22,24,25,26,5,27,28,29,30,6,34,31,32,33,35,7,36,41,42,37,38,39,40,1,43,67,65,68,66,69,137,53,74,73,52,44,75,45,77,78,76]},"version":"4.9.5"}
@@ -2,18 +2,43 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initMiddlewares = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const koa_session_1 = tslib_1.__importDefault(require("koa-session"));
5
6
  const koa_passport_1 = tslib_1.__importDefault(require("koa-passport"));
7
+ const env_1 = require("@things-factory/env");
8
+ const get_secret_1 = require("../utils/get-secret");
6
9
  const authenticate_401_middleware_1 = require("./authenticate-401-middleware");
7
10
  const domain_authenticate_middleware_1 = require("./domain-authenticate-middleware");
8
11
  const graphql_authenticate_middleware_1 = require("./graphql-authenticate-middleware");
9
12
  const jwt_authenticate_middleware_1 = require("./jwt-authenticate-middleware");
13
+ const user_1 = require("../service/user/user");
14
+ const max_age_1 = require("../constants/max-age");
15
+ const accessTokenCookieKey = env_1.config.get('accessTokenCookieKey', 'access_token');
10
16
  function initMiddlewares(app) {
17
+ /* oauth2orize-koa 에서 oauth 트랜잭션 관리를 위해서 session을 사용함. */
18
+ app.keys = [get_secret_1.SECRET];
19
+ app.use((0, koa_session_1.default)({
20
+ key: accessTokenCookieKey,
21
+ maxAge: max_age_1.MAX_AGE,
22
+ overwrite: true,
23
+ httpOnly: true,
24
+ signed: true,
25
+ rolling: false,
26
+ renew: false
27
+ }, app));
28
+ koa_passport_1.default.serializeUser((profile, done) => {
29
+ done(null, profile);
30
+ });
31
+ koa_passport_1.default.deserializeUser(async (profile, done) => {
32
+ done(null, await user_1.User.checkAuth(profile));
33
+ });
11
34
  /* passport initialize */
12
35
  app.use(koa_passport_1.default.initialize());
36
+ /* passport use session - for oauth transaction */
37
+ app.use(koa_passport_1.default.session());
13
38
  /* authentication error handling */
14
39
  app.use(authenticate_401_middleware_1.authenticate401Middleware);
15
40
  /*
16
- * post:graphql 에 대해서는 authenticationMiddleware를 적용한다.
41
+ * post:graphql 에 대해서는 graphqlAuthenticationMiddleware를 적용한다.
17
42
  * graphql app을 router에 적용하지 못하기 때문임.
18
43
  */
19
44
  app.use(graphql_authenticate_middleware_1.graphqlAuthenticateMiddleware);
@@ -21,16 +46,6 @@ function initMiddlewares(app) {
21
46
  exports.initMiddlewares = initMiddlewares;
22
47
  process.on('bootstrap-module-subscription', (app, subscriptionMiddleware) => {
23
48
  subscriptionMiddleware.push(jwt_authenticate_middleware_1.jwtAuthenticateMiddleware, domain_authenticate_middleware_1.domainAuthenticateMiddleware);
24
- // subscriptionMiddleware.push(jwtAuthenticateMiddleware, async (context, next) => {
25
- // const { domain, user } = context.state
26
- // if (domain && !user.domains.find(d => d.subdomain === domain.subdomain)) {
27
- // let message = `subdomain '${domain.subdomain}' is not allowed for the user`
28
- // debug('subscription', message)
29
- // context.throw(401, message)
30
- // }
31
- // debug('subscription', user.email, domain?.subdomain)
32
- // await next()
33
- // })
34
49
  });
35
50
  tslib_1.__exportStar(require("./jwt-authenticate-middleware"), exports);
36
51
  tslib_1.__exportStar(require("./domain-authenticate-middleware"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":";;;;AAAA,wEAAmC;AAEnC,+EAAyE;AACzE,qFAA+E;AAC/E,uFAAiF;AACjF,+EAAyE;AAEzE,SAAgB,eAAe,CAAC,GAAQ;IACtC,yBAAyB;IACzB,GAAG,CAAC,GAAG,CAAC,sBAAQ,CAAC,UAAU,EAAE,CAAC,CAAA;IAE9B,mCAAmC;IACnC,GAAG,CAAC,GAAG,CAAC,uDAAyB,CAAC,CAAA;IAElC;;;OAGG;IACH,GAAG,CAAC,GAAG,CAAC,+DAA6B,CAAC,CAAA;AACxC,CAAC;AAZD,0CAYC;AAED,OAAO,CAAC,EAAE,CAAC,+BAAsC,EAAE,CAAC,GAAG,EAAE,sBAAsB,EAAE,EAAE;IACjF,sBAAsB,CAAC,IAAI,CAAC,uDAAyB,EAAE,6DAA4B,CAAC,CAAA;IAEpF,oFAAoF;IACpF,2CAA2C;IAE3C,+EAA+E;IAC/E,kFAAkF;IAClF,qCAAqC;IACrC,kCAAkC;IAClC,MAAM;IAEN,yDAAyD;IAEzD,iBAAiB;IACjB,KAAK;AACP,CAAC,CAAC,CAAA;AAEF,wEAA6C;AAC7C,2EAAgD;AAChD,8DAAmC;AACnC,wEAA6C","sourcesContent":["import passport from 'koa-passport'\n\nimport { authenticate401Middleware } from './authenticate-401-middleware'\nimport { domainAuthenticateMiddleware } from './domain-authenticate-middleware'\nimport { graphqlAuthenticateMiddleware } from './graphql-authenticate-middleware'\nimport { jwtAuthenticateMiddleware } from './jwt-authenticate-middleware'\n\nexport function initMiddlewares(app: any) {\n /* passport initialize */\n app.use(passport.initialize())\n\n /* authentication error handling */\n app.use(authenticate401Middleware)\n\n /*\n * post:graphql 대해서는 authenticationMiddleware를 적용한다.\n * graphql app을 router에 적용하지 못하기 때문임.\n */\n app.use(graphqlAuthenticateMiddleware)\n}\n\nprocess.on('bootstrap-module-subscription' as any, (app, subscriptionMiddleware) => {\n subscriptionMiddleware.push(jwtAuthenticateMiddleware, domainAuthenticateMiddleware)\n\n // subscriptionMiddleware.push(jwtAuthenticateMiddleware, async (context, next) => {\n // const { domain, user } = context.state\n\n // if (domain && !user.domains.find(d => d.subdomain === domain.subdomain)) {\n // let message = `subdomain '${domain.subdomain}' is not allowed for the user`\n // debug('subscription', message)\n // context.throw(401, message)\n // }\n\n // debug('subscription', user.email, domain?.subdomain)\n\n // await next()\n // })\n})\n\nexport * from './jwt-authenticate-middleware'\nexport * from './domain-authenticate-middleware'\nexport * from './signin-middleware'\nexport * from './authenticate-401-middleware'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":";;;;AAAA,sEAAiC;AACjC,wEAAmC;AAEnC,6CAA4C;AAC5C,oDAA4C;AAE5C,+EAAyE;AACzE,qFAA+E;AAC/E,uFAAiF;AACjF,+EAAyE;AAEzE,+CAA2C;AAC3C,kDAA8C;AAE9C,MAAM,oBAAoB,GAAG,YAAM,CAAC,GAAG,CAAC,sBAAsB,EAAE,cAAc,CAAC,CAAA;AAE/E,SAAgB,eAAe,CAAC,GAAQ;IACtC,yDAAyD;IACzD,GAAG,CAAC,IAAI,GAAG,CAAC,mBAAM,CAAC,CAAA;IACnB,GAAG,CAAC,GAAG,CACL,IAAA,qBAAO,EACL;QACE,GAAG,EAAE,oBAAoB;QACzB,MAAM,EAAE,iBAAO;QACf,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;KACb,EACD,GAAG,CACJ,CACF,CAAA;IAED,sBAAQ,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACvC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,sBAAQ,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/C,IAAI,CAAC,IAAI,EAAE,MAAM,WAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;IAEF,yBAAyB;IACzB,GAAG,CAAC,GAAG,CAAC,sBAAQ,CAAC,UAAU,EAAE,CAAC,CAAA;IAE9B,kDAAkD;IAClD,GAAG,CAAC,GAAG,CAAC,sBAAQ,CAAC,OAAO,EAAE,CAAC,CAAA;IAE3B,mCAAmC;IACnC,GAAG,CAAC,GAAG,CAAC,uDAAyB,CAAC,CAAA;IAElC;;;OAGG;IACH,GAAG,CAAC,GAAG,CAAC,+DAA6B,CAAC,CAAA;AACxC,CAAC;AAxCD,0CAwCC;AAED,OAAO,CAAC,EAAE,CAAC,+BAAsC,EAAE,CAAC,GAAG,EAAE,sBAAsB,EAAE,EAAE;IACjF,sBAAsB,CAAC,IAAI,CAAC,uDAAyB,EAAE,6DAA4B,CAAC,CAAA;AACtF,CAAC,CAAC,CAAA;AAEF,wEAA6C;AAC7C,2EAAgD;AAChD,8DAAmC;AACnC,wEAA6C","sourcesContent":["import session from 'koa-session'\nimport passport from 'koa-passport'\n\nimport { config } from '@things-factory/env'\nimport { SECRET } from '../utils/get-secret'\n\nimport { authenticate401Middleware } from './authenticate-401-middleware'\nimport { domainAuthenticateMiddleware } from './domain-authenticate-middleware'\nimport { graphqlAuthenticateMiddleware } from './graphql-authenticate-middleware'\nimport { jwtAuthenticateMiddleware } from './jwt-authenticate-middleware'\n\nimport { User } from '../service/user/user'\nimport { MAX_AGE } from '../constants/max-age'\n\nconst accessTokenCookieKey = config.get('accessTokenCookieKey', 'access_token')\n\nexport function initMiddlewares(app: any) {\n /* oauth2orize-koa 에서 oauth 트랜잭션 관리를 위해서 session을 사용함. */\n app.keys = [SECRET]\n app.use(\n session(\n {\n key: accessTokenCookieKey,\n maxAge: MAX_AGE,\n overwrite: true,\n httpOnly: true,\n signed: true,\n rolling: false,\n renew: false\n },\n app\n )\n )\n\n passport.serializeUser((profile, done) => {\n done(null, profile)\n })\n\n passport.deserializeUser(async (profile, done) => {\n done(null, await User.checkAuth(profile))\n })\n\n /* passport initialize */\n app.use(passport.initialize())\n\n /* passport use session - for oauth transaction */\n app.use(passport.session())\n\n /* authentication error handling */\n app.use(authenticate401Middleware)\n\n /*\n * post:graphql 대해서는 graphqlAuthenticationMiddleware를 적용한다.\n * graphql app을 router에 적용하지 못하기 때문임.\n */\n app.use(graphqlAuthenticateMiddleware)\n}\n\nprocess.on('bootstrap-module-subscription' as any, (app, subscriptionMiddleware) => {\n subscriptionMiddleware.push(jwtAuthenticateMiddleware, domainAuthenticateMiddleware)\n})\n\nexport * from './jwt-authenticate-middleware'\nexport * from './domain-authenticate-middleware'\nexport * from './signin-middleware'\nexport * from './authenticate-401-middleware'\n"]}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.jwtAuthenticateMiddleware = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const passport_1 = tslib_1.__importDefault(require("passport"));
5
+ const koa_passport_1 = tslib_1.__importDefault(require("koa-passport"));
6
6
  const passport_jwt_1 = require("passport-jwt");
7
7
  const make_verification_token_1 = require("../controllers/utils/make-verification-token");
8
8
  const save_verification_token_1 = require("../controllers/utils/save-verification-token");
@@ -10,7 +10,7 @@ const user_1 = require("../service/user/user");
10
10
  const verification_token_1 = require("../service/verification-token/verification-token");
11
11
  const access_token_cookie_1 = require("../utils/access-token-cookie");
12
12
  const get_secret_1 = require("../utils/get-secret");
13
- passport_1.default.use(new passport_jwt_1.Strategy({
13
+ koa_passport_1.default.use(new passport_jwt_1.Strategy({
14
14
  secretOrKey: get_secret_1.SECRET,
15
15
  passReqToCallback: true,
16
16
  jwtFromRequest: passport_jwt_1.ExtractJwt.fromExtractors([
@@ -39,10 +39,9 @@ async function jwtAuthenticateMiddleware(context, next) {
39
39
  if (user) {
40
40
  return await next();
41
41
  }
42
- return await passport_1.default.authenticate('jwt', { session: false }, async (err, decoded, info) => {
42
+ return await koa_passport_1.default.authenticate('jwt', { session: false }, async (err, decoded, info) => {
43
43
  if (err || !decoded) {
44
44
  const e = (context.state.error = err || info);
45
- // TODO cookie 가 authenticate에 적용된 상황에서 오류가 발생한 경우만, 쿠키를 클리어한다.
46
45
  (0, access_token_cookie_1.clearAccessTokenCookie)(context);
47
46
  context.throw(401, e.message);
48
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"jwt-authenticate-middleware.js","sourceRoot":"","sources":["../../server/middlewares/jwt-authenticate-middleware.ts"],"names":[],"mappings":";;;;AAAA,gEAA+B;AAC/B,+CAAkE;AAElE,0FAAoF;AACpF,0FAAoF;AACpF,+CAAuD;AACvD,yFAAwF;AACxF,sEAA2F;AAC3F,oDAA4C;AAE5C,kBAAQ,CAAC,GAAG,CACV,IAAI,uBAAW,CACb;IACE,WAAW,EAAE,mBAAM;IACnB,iBAAiB,EAAE,IAAI;IACvB,cAAc,EAAE,yBAAU,CAAC,cAAc,CAAC;QACxC,yBAAU,CAAC,2BAA2B,EAAE;QACxC,yBAAU,CAAC,UAAU,CAAC,eAAe,CAAC;QACtC,yBAAU,CAAC,UAAU,CAAC,gBAAgB,CAAC;QACvC,yBAAU,CAAC,qBAAqB,CAAC,cAAc,CAAC;QAChD,yBAAU,CAAC,aAAa,CAAC,cAAc,CAAC;QACxC,GAAG,CAAC,EAAE;YACJ,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,KAAK,GAAG,IAAA,0CAAoB,EAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,GAAG,CAAC,CAAA;YACtC,OAAO,KAAK,CAAA;QACd,CAAC;KACF,CAAC;CACH,EACD,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC/B,IAAI;QACF,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;KAC3B;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,CAAA;KACnB;AACH,CAAC,CACF,CACF,CAAA;AAEM,KAAK,UAAU,yBAAyB,CAAC,OAAO,EAAE,IAAI;IAC3D,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IACxB,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAC9B,IAAI,IAAI,EAAE;QACR,OAAO,MAAM,IAAI,EAAE,CAAA;KACpB;IAED,OAAO,MAAM,kBAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACzF,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE;YACnB,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,IAAI,IAAI,CAAC,CAAA;YAE7C,+DAA+D;YAC/D,IAAA,4CAAsB,EAAC,OAAO,CAAC,CAAA;YAE/B,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;SAC9B;aAAM;YACL,MAAM,UAAU,GAAG,MAAM,WAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;YAEhD,IAAI,UAAU,CAAC,MAAM,KAAK,iBAAU,CAAC,kBAAkB,EAAE;gBACvD,IAAI;oBACF,MAAM,KAAK,GAAG,IAAA,+CAAqB,GAAE,CAAA;oBACrC,MAAM,IAAA,+CAAqB,EAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,0CAAqB,CAAC,cAAc,CAAC,CAAA;oBACvF,IAAA,4CAAsB,EAAC,OAAO,CAAC,CAAA;oBAC/B,OAAO,CAAC,QAAQ,CAAC,8BAA8B,KAAK,EAAE,CAAC,CAAA;iBACxD;gBAAC,OAAO,CAAC,EAAE;oBACV,MAAM,GAAG,CAAA;iBACV;aACF;iBAAM;gBACL,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,UAAU,CAAA;gBAC/B,OAAO,CAAC,KAAK,CAAC,YAAY,GAAG,OAAO,CAAA;gBACpC,MAAM,IAAI,EAAE,CAAA;aACb;SACF;IACH,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACnB,CAAC;AAlCD,8DAkCC","sourcesContent":["import passport from 'passport'\nimport { ExtractJwt, Strategy as JWTstrategy } from 'passport-jwt'\n\nimport { makeVerificationToken } from '../controllers/utils/make-verification-token'\nimport { saveVerificationToken } from '../controllers/utils/save-verification-token'\nimport { User, UserStatus } from '../service/user/user'\nimport { VerificationTokenType } from '../service/verification-token/verification-token'\nimport { clearAccessTokenCookie, getAccessTokenCookie } from '../utils/access-token-cookie'\nimport { SECRET } from '../utils/get-secret'\n\npassport.use(\n new JWTstrategy(\n {\n secretOrKey: SECRET,\n passReqToCallback: true,\n jwtFromRequest: ExtractJwt.fromExtractors([\n ExtractJwt.fromAuthHeaderAsBearerToken(),\n ExtractJwt.fromHeader('authorization'),\n ExtractJwt.fromHeader('x-access-token'),\n ExtractJwt.fromUrlQueryParameter('access_token'),\n ExtractJwt.fromBodyField('access_token'),\n req => {\n var token = null\n token = getAccessTokenCookie(req?.ctx)\n return token\n }\n ])\n },\n async (request, decoded, done) => {\n try {\n return done(null, decoded)\n } catch (error) {\n return done(error)\n }\n }\n )\n)\n\nexport async function jwtAuthenticateMiddleware(context, next) {\n const { path } = context\n const { user } = context.state\n if (user) {\n return await next()\n }\n\n return await passport.authenticate('jwt', { session: false }, async (err, decoded, info) => {\n if (err || !decoded) {\n const e = (context.state.error = err || info)\n\n // TODO cookie 가 authenticate에 적용된 상황에서 오류가 발생한 경우만, 쿠키를 클리어한다.\n clearAccessTokenCookie(context)\n\n context.throw(401, e.message)\n } else {\n const userEntity = await User.checkAuth(decoded)\n\n if (userEntity.status === UserStatus.PWD_RESET_REQUIRED) {\n try {\n const token = makeVerificationToken()\n await saveVerificationToken(userEntity.id, token, VerificationTokenType.PASSWORD_RESET)\n clearAccessTokenCookie(context)\n context.redirect(`/auth/reset-password?token=${token}`)\n } catch (e) {\n throw err\n }\n } else {\n context.state.user = userEntity\n context.state.decodedToken = decoded\n await next()\n }\n }\n })(context, next)\n}\n"]}
1
+ {"version":3,"file":"jwt-authenticate-middleware.js","sourceRoot":"","sources":["../../server/middlewares/jwt-authenticate-middleware.ts"],"names":[],"mappings":";;;;AAAA,wEAAmC;AACnC,+CAAkE;AAElE,0FAAoF;AACpF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ACzF,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE;YACnB,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,IAAI,IAAI,CAAC,CAAA;YAE7C,IAAA,4CAAsB,EAAC,OAAO,CAAC,CAAA;YAE/B,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;SAC9B;aAAM;YACL,MAAM,UAAU,GAAG,MAAM,WAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;YAEhD,IAAI,UAAU,CAAC,MAAM,KAAK,iBAAU,CAAC,kBAAkB,EAAE;gBACvD,IAAI;oBACF,MAAM,KAAK,GAAG,IAAA,+CAAqB,GAAE,CAAA;oBACrC,MAAM,IAAA,+CAAqB,EAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,0CAAqB,CAAC,cAAc,CAAC,CAAA;oBACvF,IAAA,4CAAsB,EAAC,OAAO,CAAC,CAAA;oBAC/B,OAAO,CAAC,QAAQ,CAAC,8BAA8B,KAAK,EAAE,CAAC,CAAA;iBACxD;gBAAC,OAAO,CAAC,EAAE;oBACV,MAAM,GAAG,CAAA;iBACV;aACF;iBAAM;gBACL,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,UAAU,CAAA;gBAC/B,OAAO,CAAC,KAAK,CAAC,YAAY,GAAG,OAAO,CAAA;gBACpC,MAAM,IAAI,EAAE,CAAA;aACb;SACF;IACH,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACnB,CAAC;AAjCD,8DAiCC","sourcesContent":["import passport from 'koa-passport'\nimport { ExtractJwt, Strategy as JWTstrategy } from 'passport-jwt'\n\nimport { makeVerificationToken } from '../controllers/utils/make-verification-token'\nimport { saveVerificationToken } from '../controllers/utils/save-verification-token'\nimport { User, UserStatus } from '../service/user/user'\nimport { VerificationTokenType } from '../service/verification-token/verification-token'\nimport { clearAccessTokenCookie, getAccessTokenCookie } from '../utils/access-token-cookie'\nimport { SECRET } from '../utils/get-secret'\n\npassport.use(\n new JWTstrategy(\n {\n secretOrKey: SECRET,\n passReqToCallback: true,\n jwtFromRequest: ExtractJwt.fromExtractors([\n ExtractJwt.fromAuthHeaderAsBearerToken(),\n ExtractJwt.fromHeader('authorization'),\n ExtractJwt.fromHeader('x-access-token'),\n ExtractJwt.fromUrlQueryParameter('access_token'),\n ExtractJwt.fromBodyField('access_token'),\n req => {\n var token = null\n token = getAccessTokenCookie(req?.ctx)\n return token\n }\n ])\n },\n async (request, decoded, done) => {\n try {\n return done(null, decoded)\n } catch (error) {\n return done(error)\n }\n }\n )\n)\n\nexport async function jwtAuthenticateMiddleware(context, next) {\n const { path } = context\n const { user } = context.state\n if (user) {\n return await next()\n }\n\n return await passport.authenticate('jwt', { session: false }, async (err, decoded, info) => {\n if (err || !decoded) {\n const e = (context.state.error = err || info)\n\n clearAccessTokenCookie(context)\n\n context.throw(401, e.message)\n } else {\n const userEntity = await User.checkAuth(decoded)\n\n if (userEntity.status === UserStatus.PWD_RESET_REQUIRED) {\n try {\n const token = makeVerificationToken()\n await saveVerificationToken(userEntity.id, token, VerificationTokenType.PASSWORD_RESET)\n clearAccessTokenCookie(context)\n context.redirect(`/auth/reset-password?token=${token}`)\n } catch (e) {\n throw err\n }\n } else {\n context.state.user = userEntity\n context.state.decodedToken = decoded\n await next()\n }\n }\n })(context, next)\n}\n"]}
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.signinMiddleware = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const passport_1 = tslib_1.__importDefault(require("passport"));
5
+ const koa_passport_1 = tslib_1.__importDefault(require("koa-passport"));
6
6
  const passport_local_1 = require("passport-local");
7
7
  const signin_1 = require("../controllers/signin");
8
- passport_1.default.use('signin', new passport_local_1.Strategy({
8
+ koa_passport_1.default.use('signin', new passport_local_1.Strategy({
9
9
  usernameField: 'email',
10
10
  passwordField: 'password'
11
11
  }, async (email, password, done) => {
@@ -27,7 +27,7 @@ passport_1.default.use('signin', new passport_local_1.Strategy({
27
27
  }
28
28
  }));
29
29
  async function signinMiddleware(context, next) {
30
- return passport_1.default.authenticate('signin', { session: false }, async (err, user, info) => {
30
+ return koa_passport_1.default.authenticate('signin', { session: false }, async (err, user, info) => {
31
31
  if (err || !user) {
32
32
  throw err;
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"signin-middleware.js","sourceRoot":"","sources":["../../server/middlewares/signin-middleware.ts"],"names":[],"mappings":";;;;AAAA,gEAA+B;AAC/B,mDAA0D;AAE1D,kDAA8C;AAE9C,kBAAQ,CAAC,GAAG,CACV,QAAQ,EACR,IAAI,yBAAa,CACf;IACE,aAAa,EAAE,OAAO;IACtB,aAAa,EAAE,UAAU;CAC1B,EACD,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;IAC9B,IAAI;QACF,MAAM,EACJ,IAAI,EAAE,QAAQ,EACd,KAAK,EACL,OAAO,EACR,GAAG,MAAM,IAAA,eAAM,EAAC;YACf,KAAK;YACL,QAAQ;SACT,CAAC,CAAA;QAEF,OAAO,IAAI,CACT,IAAI,EACJ;YACE,IAAI,EAAE,QAAQ;YACd,KAAK;YACL,OAAO;SACR,EACD;YACE,OAAO,EAAE,wBAAwB;SAClC,CACF,CAAA;KACF;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,CAAA;KACnB;AACH,CAAC,CACF,CACF,CAAA;AAEM,KAAK,UAAU,gBAAgB,CAAC,OAAO,EAAE,IAAI;IAClD,OAAO,kBAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QACnF,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE;YAChB,MAAM,GAAG,CAAA;SACV;aAAM;YACL,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;YAEtC,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAA;YAC7B,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAA;YAE3B,MAAM,IAAI,EAAE,CAAA;SACb;IACH,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACnB,CAAC;AAbD,4CAaC","sourcesContent":["import passport from 'passport'\nimport { Strategy as localStrategy } from 'passport-local'\n\nimport { signin } from '../controllers/signin'\n\npassport.use(\n 'signin',\n new localStrategy(\n {\n usernameField: 'email',\n passwordField: 'password'\n },\n async (email, password, done) => {\n try {\n const {\n user: userInfo,\n token,\n domains\n } = await signin({\n email,\n password\n })\n\n return done(\n null,\n {\n user: userInfo,\n token,\n domains\n },\n {\n message: 'Logged in Successfully'\n }\n )\n } catch (error) {\n return done(error)\n }\n }\n )\n)\n\nexport async function signinMiddleware(context, next) {\n return passport.authenticate('signin', { session: false }, async (err, user, info) => {\n if (err || !user) {\n throw err\n } else {\n const { user: userInfo, token } = user\n\n context.state.user = userInfo\n context.state.token = token\n\n await next()\n }\n })(context, next)\n}\n"]}
1
+ {"version":3,"file":"signin-middleware.js","sourceRoot":"","sources":["../../server/middlewares/signin-middleware.ts"],"names":[],"mappings":";;;;AAAA,wEAAmC;AACnC,mDAA0D;AAE1D,kDAA8C;AAE9C,sBAAQ,CAAC,GAAG,CACV,QAAQ,EACR,IAAI,yBAAa,CACf;IACE,aAAa,EAAE,OAAO;IACtB,aAAa,EAAE,UAAU;CAC1B,EACD,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;IAC9B,IAAI;QACF,MAAM,EACJ,IAAI,EAAE,QAAQ,EACd,KAAK,EACL,OAAO,EACR,GAAG,MAAM,IAAA,eAAM,EAAC;YACf,KAAK;YACL,QAAQ;SACT,CAAC,CAAA;QAEF,OAAO,IAAI,CACT,IAAI,EACJ;YACE,IAAI,EAAE,QAAQ;YACd,KAAK;YACL,OAAO;SACR,EACD;YACE,OAAO,EAAE,wBAAwB;SAClC,CACF,CAAA;KACF;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,CAAA;KACnB;AACH,CAAC,CACF,CACF,CAAA;AAEM,KAAK,UAAU,gBAAgB,CAAC,OAAO,EAAE,IAAI;IAClD,OAAO,sBAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QACnF,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE;YAChB,MAAM,GAAG,CAAA;SACV;aAAM;YACL,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;YAEtC,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAA;YAC7B,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAA;YAE3B,MAAM,IAAI,EAAE,CAAA;SACb;IACH,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACnB,CAAC;AAbD,4CAaC","sourcesContent":["import passport from 'koa-passport'\nimport { Strategy as localStrategy } from 'passport-local'\n\nimport { signin } from '../controllers/signin'\n\npassport.use(\n 'signin',\n new localStrategy(\n {\n usernameField: 'email',\n passwordField: 'password'\n },\n async (email, password, done) => {\n try {\n const {\n user: userInfo,\n token,\n domains\n } = await signin({\n email,\n password\n })\n\n return done(\n null,\n {\n user: userInfo,\n token,\n domains\n },\n {\n message: 'Logged in Successfully'\n }\n )\n } catch (error) {\n return done(error)\n }\n }\n )\n)\n\nexport async function signinMiddleware(context, next) {\n return passport.authenticate('signin', { session: false }, async (err, user, info) => {\n if (err || !user) {\n throw err\n } else {\n const { user: userInfo, token } = user\n\n context.state.user = userInfo\n context.state.token = token\n\n await next()\n }\n })(context, next)\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Strategy = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const passport_1 = tslib_1.__importDefault(require("passport"));
5
+ const koa_passport_1 = tslib_1.__importDefault(require("koa-passport"));
6
6
  const util_1 = tslib_1.__importDefault(require("util"));
7
7
  /**
8
8
  * `Oauth2ClientPasswordStrategy` constructor.
@@ -17,7 +17,7 @@ function Strategy(options, verify) {
17
17
  }
18
18
  if (!verify)
19
19
  throw new Error('OAuth 2.0 client password strategy requires a verify function');
20
- passport_1.default.Strategy.call(this);
20
+ koa_passport_1.default.Strategy.call(this);
21
21
  this.name = 'oauth2-client-password';
22
22
  this._verify = verify;
23
23
  this._passReqToCallback = options.passReqToCallback;
@@ -26,7 +26,7 @@ exports.Strategy = Strategy;
26
26
  /**
27
27
  * Inherit from `passport.Strategy`.
28
28
  */
29
- util_1.default.inherits(Strategy, passport_1.default.Strategy);
29
+ util_1.default.inherits(Strategy, koa_passport_1.default.Strategy);
30
30
  function fetchBasicCredential(authorization = '') {
31
31
  var parts = authorization.split(' ');
32
32
  if (parts.length < 2) {
@@ -1 +1 @@
1
- {"version":3,"file":"passport-oauth2-client-password.js","sourceRoot":"","sources":["../../../server/router/oauth2/passport-oauth2-client-password.ts"],"names":[],"mappings":";;;;AAAA,gEAA+B;AAC/B,wDAAuB;AAEvB;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM;IACtC,IAAI,OAAO,OAAO,IAAI,UAAU,EAAE;QAChC,MAAM,GAAG,OAAO,CAAA;QAChB,OAAO,GAAG,EAAE,CAAA;KACb;IACD,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAA;IAE7F,kBAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAA;IACpC,IAAI,CAA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,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE;YACrE,OAAO,IAAI,CAAC,IAAI,EAAE,CAAA;SACnB;QAED,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QAChC,YAAY,GAAG,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;KACzC;IAED,IAAI,IAAI,GAAG,IAAI,CAAA;IAEf,SAAS,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI;QACjC,IAAI,GAAG,EAAE;YACP,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;SACvB;QACD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,IAAI,CAAC,IAAI,EAAE,CAAA;SACnB;QACD,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;IAC5B,CAAC;IAED,IAAI,IAAI,CAAC,kBAAkB,EAAE;QAC3B,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAA;KACpD;SAAM;QACL,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAA;KAC/C;AACH,CAAC,CAAA","sourcesContent":["import passport from 'passport'\nimport util from 'util'\n\n/**\n * `Oauth2ClientPasswordStrategy` constructor.\n *\n * @api protected\n * Basic Authorization Header와 Body 형식을 모두 지원한다.\n */\nexport function Strategy(options, verify) {\n if (typeof options == 'function') {\n verify = options\n options = {}\n }\n if (!verify) throw new Error('OAuth 2.0 client password strategy requires a verify function')\n\n passport.Strategy.call(this)\n this.name = 'oauth2-client-password'\n this._verify = verify\n this._passReqToCallback = options.passReqToCallback\n}\n\n/**\n * Inherit from `passport.Strategy`.\n */\nutil.inherits(Strategy, passport.Strategy)\n\nfunction fetchBasicCredential(authorization = '') {\n var parts = authorization.split(' ')\n if (parts.length < 2) {\n return\n }\n\n var scheme = parts[0]\n var credentials = new Buffer(parts[1], 'base64').toString().split(':')\n\n if (!/Basic/i.test(scheme)) {\n return\n }\n if (credentials.length < 2) {\n return\n }\n\n var clientId = credentials[0]\n var clientSecret = credentials[1]\n if (!clientId || !clientSecret) {\n return\n }\n\n return [clientId, clientSecret]\n}\n\n/**\n * Authenticate request based on client credentials in the request body.\n *\n * @param {Object} req\n * @api protected\n */\nStrategy.prototype.authenticate = function (req) {\n var [clientId, clientSecret] = fetchBasicCredential(req.headers['authorization']) || []\n if (!clientId) {\n if (!req.body || !req.body['client_id'] || !req.body['client_secret']) {\n return this.fail()\n }\n\n clientId = req.body['client_id']\n clientSecret = req.body['client_secret']\n }\n\n var self = this\n\n function verified(err, client, info) {\n if (err) {\n return self.error(err)\n }\n if (!client) {\n return self.fail()\n }\n self.success(client, info)\n }\n\n if (self._passReqToCallback) {\n this._verify(req, clientId, clientSecret, verified)\n } else {\n this._verify(clientId, clientSecret, verified)\n }\n}\n"]}
1
+ {"version":3,"file":"passport-oauth2-client-password.js","sourceRoot":"","sources":["../../../server/router/oauth2/passport-oauth2-client-password.ts"],"names":[],"mappings":";;;;AAAA,wEAAmC;AACnC,wDAAuB;AAEvB;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM;IACtC,IAAI,OAAO,OAAO,IAAI,UAAU,EAAE;QAChC,MAAM,GAAG,OAAO,CAAA;QAChB,OAAO,GAAG,EAAE,CAAA;KACb;IACD,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAA;IAE7F,sBAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAA;IACpC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;IACrB,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAA;AACrD,CAAC;AAXD,4BAWC;AA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I,EAAE,CAAA;SACnB;QAED,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QAChC,YAAY,GAAG,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;KACzC;IAED,IAAI,IAAI,GAAG,IAAI,CAAA;IAEf,SAAS,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI;QACjC,IAAI,GAAG,EAAE;YACP,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;SACvB;QACD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,IAAI,CAAC,IAAI,EAAE,CAAA;SACnB;QACD,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;IAC5B,CAAC;IAED,IAAI,IAAI,CAAC,kBAAkB,EAAE;QAC3B,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAA;KACpD;SAAM;QACL,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAA;KAC/C;AACH,CAAC,CAAA","sourcesContent":["import passport from 'koa-passport'\nimport util from 'util'\n\n/**\n * `Oauth2ClientPasswordStrategy` constructor.\n *\n * @api protected\n * Basic Authorization Header와 Body 형식을 모두 지원한다.\n */\nexport function Strategy(options, verify) {\n if (typeof options == 'function') {\n verify = options\n options = {}\n }\n if (!verify) throw new Error('OAuth 2.0 client password strategy requires a verify function')\n\n passport.Strategy.call(this)\n this.name = 'oauth2-client-password'\n this._verify = verify\n this._passReqToCallback = options.passReqToCallback\n}\n\n/**\n * Inherit from `passport.Strategy`.\n */\nutil.inherits(Strategy, passport.Strategy)\n\nfunction fetchBasicCredential(authorization = '') {\n var parts = authorization.split(' ')\n if (parts.length < 2) {\n return\n }\n\n var scheme = parts[0]\n var credentials = new Buffer(parts[1], 'base64').toString().split(':')\n\n if (!/Basic/i.test(scheme)) {\n return\n }\n if (credentials.length < 2) {\n return\n }\n\n var clientId = credentials[0]\n var clientSecret = credentials[1]\n if (!clientId || !clientSecret) {\n return\n }\n\n return [clientId, clientSecret]\n}\n\n/**\n * Authenticate request based on client credentials in the request body.\n *\n * @param {Object} req\n * @api protected\n */\nStrategy.prototype.authenticate = function (req) {\n var [clientId, clientSecret] = fetchBasicCredential(req.headers['authorization']) || []\n if (!clientId) {\n if (!req.body || !req.body['client_id'] || !req.body['client_secret']) {\n return this.fail()\n }\n\n clientId = req.body['client_id']\n clientSecret = req.body['client_secret']\n }\n\n var self = this\n\n function verified(err, client, info) {\n if (err) {\n return self.error(err)\n }\n if (!client) {\n return self.fail()\n }\n self.success(client, info)\n }\n\n if (self._passReqToCallback) {\n this._verify(req, clientId, clientSecret, verified)\n } else {\n this._verify(clientId, clientSecret, verified)\n }\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Strategy = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const passport_1 = tslib_1.__importDefault(require("passport"));
5
+ const koa_passport_1 = tslib_1.__importDefault(require("koa-passport"));
6
6
  const util_1 = tslib_1.__importDefault(require("util"));
7
7
  /**
8
8
  * `PassportRefreshTokenStrategy` constructor.
@@ -17,7 +17,7 @@ function Strategy(options, verify) {
17
17
  }
18
18
  if (!verify)
19
19
  throw new Error('OAuth 2.0 refresh-token strategy requires a verify function');
20
- passport_1.default.Strategy.call(this);
20
+ koa_passport_1.default.Strategy.call(this);
21
21
  this.name = 'refresh-token';
22
22
  this._verify = verify;
23
23
  this._passReqToCallback = options.passReqToCallback;
@@ -26,7 +26,7 @@ exports.Strategy = Strategy;
26
26
  /**
27
27
  * Inherit from `passport.Strategy`.
28
28
  */
29
- util_1.default.inherits(Strategy, passport_1.default.Strategy);
29
+ util_1.default.inherits(Strategy, koa_passport_1.default.Strategy);
30
30
  function fetchBasicCredential(authorization = '') {
31
31
  var parts = authorization.split(' ');
32
32
  if (parts.length < 2) {
@@ -1 +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AO,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAA;KAC/C;AACH,CAAC,CAAA","sourcesContent":["import passport from 'passport'\nimport util from 'util'\n\n/**\n * `PassportRefreshTokenStrategy` constructor.\n *\n * @api protected\n * Basic Authorization Header와 Body 형식을 모두 지원한다.\n */\nexport function Strategy(options, verify) {\n if (typeof options == 'function') {\n verify = options\n options = {}\n }\n if (!verify) throw new Error('OAuth 2.0 refresh-token strategy requires a verify function')\n\n passport.Strategy.call(this)\n this.name = 'refresh-token'\n this._verify = verify\n this._passReqToCallback = options.passReqToCallback\n}\n\n/**\n * Inherit from `passport.Strategy`.\n */\nutil.inherits(Strategy, passport.Strategy)\n\nfunction fetchBasicCredential(authorization = '') {\n var parts = authorization.split(' ')\n if (parts.length < 2) {\n return\n }\n\n var scheme = parts[0]\n var credentials = new Buffer(parts[1], 'base64').toString().split(':')\n\n if (!/Basic/i.test(scheme)) {\n return\n }\n if (credentials.length < 2) {\n return\n }\n\n var clientId = credentials[0]\n var clientSecret = credentials[1]\n if (!clientId || !clientSecret) {\n return\n }\n\n return [clientId, clientSecret]\n}\n\n/**\n * Authenticate request based on client credentials in the request body.\n *\n * @param {Object} req\n * @api protected\n */\nStrategy.prototype.authenticate = function (req) {\n var [clientId, clientSecret] = fetchBasicCredential(req.headers['authorization']) || []\n if (!clientId) {\n if (!req.body || !req.body['client_id'] || !req.body['client_secret']) {\n return this.fail()\n }\n\n clientId = req.body['client_id']\n clientSecret = req.body['client_secret']\n }\n\n var self = this\n\n function verified(err, client, info) {\n if (err) {\n return self.error(err)\n }\n if (!client) {\n return self.fail()\n }\n self.success(client, info)\n }\n\n if (self._passReqToCallback) {\n this._verify(req, clientId, clientSecret, verified)\n } else {\n this._verify(clientId, clientSecret, verified)\n }\n}\n"]}
1
+ {"version":3,"file":"passport-refresh-token.js","sourceRoot":"","sources":["../../../server/router/oauth2/passport-refresh-token.ts"],"names":[],"mappings":";;;;AAAA,wEAAmC;AACnC,wDAA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* `PassportRefreshTokenStrategy` constructor.\n *\n * @api protected\n * Basic Authorization Header와 Body 형식을 모두 지원한다.\n */\nexport function Strategy(options, verify) {\n if (typeof options == 'function') {\n verify = options\n options = {}\n }\n if (!verify) throw new Error('OAuth 2.0 refresh-token strategy requires a verify function')\n\n passport.Strategy.call(this)\n this.name = 'refresh-token'\n this._verify = verify\n this._passReqToCallback = options.passReqToCallback\n}\n\n/**\n * Inherit from `passport.Strategy`.\n */\nutil.inherits(Strategy, passport.Strategy)\n\nfunction fetchBasicCredential(authorization = '') {\n var parts = authorization.split(' ')\n if (parts.length < 2) {\n return\n }\n\n var scheme = parts[0]\n var credentials = new Buffer(parts[1], 'base64').toString().split(':')\n\n if (!/Basic/i.test(scheme)) {\n return\n }\n if (credentials.length < 2) {\n return\n }\n\n var clientId = credentials[0]\n var clientSecret = credentials[1]\n if (!clientId || !clientSecret) {\n return\n }\n\n return [clientId, clientSecret]\n}\n\n/**\n * Authenticate request based on client credentials in the request body.\n *\n * @param {Object} req\n * @api protected\n */\nStrategy.prototype.authenticate = function (req) {\n var [clientId, clientSecret] = fetchBasicCredential(req.headers['authorization']) || []\n if (!clientId) {\n if (!req.body || !req.body['client_id'] || !req.body['client_secret']) {\n return this.fail()\n }\n\n clientId = req.body['client_id']\n clientSecret = req.body['client_secret']\n }\n\n var self = this\n\n function verified(err, client, info) {\n if (err) {\n return self.error(err)\n }\n if (!client) {\n return self.fail()\n }\n self.success(client, info)\n }\n\n if (self._passReqToCallback) {\n this._verify(req, clientId, clientSecret, verified)\n } else {\n this._verify(clientId, clientSecret, verified)\n }\n}\n"]}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.siteRootRouter = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const koa_router_1 = tslib_1.__importDefault(require("koa-router"));
6
- const passport_1 = tslib_1.__importDefault(require("passport"));
6
+ const koa_passport_1 = tslib_1.__importDefault(require("koa-passport"));
7
7
  const shell_1 = require("@things-factory/shell");
8
8
  const env_1 = require("@things-factory/env");
9
9
  const user_1 = require("../service/user/user");
@@ -11,7 +11,7 @@ const get_user_domains_1 = require("../utils/get-user-domains");
11
11
  const PUBLIC_HOME_ROUTE = env_1.config.get('publicHomeRoute', '/public/home');
12
12
  exports.siteRootRouter = new koa_router_1.default();
13
13
  async function findAuth(context, next) {
14
- return await passport_1.default.authenticate('jwt', { session: false }, async (err, decoded, info) => {
14
+ return await koa_passport_1.default.authenticate('jwt', { session: false }, async (err, decoded, info) => {
15
15
  if (decoded) {
16
16
  try {
17
17
  const user = await user_1.User.checkAuth(decoded);
@@ -1 +1 @@
1
- {"version":3,"file":"site-root-router.js","sourceRoot":"","sources":["../../server/router/site-root-router.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAC/B,gEAA+B;AAE/B,iDAAgE;AAChE,6CAA4C;AAE5C,+CAA2C;AAC3C,gEAA0D;AAE1D,MAAM,iBAAiB,GAAG,YAAM,CAAC,GAAG,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAA;AAE1D,QAAA,cAAc,GAAG,IAAI,oBAAM,EAAE,CAAA;AAE1C,KAAK,UAAU,QAAQ,CAAC,OAAO,EAAE,IAAI;IACnC,OAAO,MAAM,kBAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACzF,IAAI,OAAO,EAAE;YACX,IAAI;gBACF,MAAM,IAAI,GAAG,MAAM,WAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;gBAC1C,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAA;aAC1B;YAAC,OAAO,CAAC,EAAE,GAAE;SACf;QAED,MAAM,IAAI,EAAE,CAAA;IACd,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACnB,CAAC;AAED,sBAAc,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,wBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC1E,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAEtC,MAAM,SAAS,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAA;IAEnC,IAAI,IAAI,IAAI,SAAS,EAAE;QACrB,MAAM,WAAW,GAAa,MAAM,IAAA,iCAAc,EAAC,IAAI,CAAC,CAAA;QACxD,IAAI,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,IAAI,SAAS,CAAC,EAAE;YACrE,OAAO,MAAM,IAAI,EAAE,CAAA;SACpB;QAED,OAAO,OAAO,CAAC,QAAQ,CAAC,iBAAiB,SAAS,EAAE,CAAC,CAAA;KACtD;IAED,IAAI,IAAI,IAAI,CAAC,SAAS,EAAE;QACtB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAA;QAEjC,OAAM;KACP;IAED,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAA;AACrC,CAAC,CAAC,CAAA","sourcesContent":["import Router from 'koa-router'\nimport passport from 'passport'\n\nimport { Domain, domainMiddleware } from '@things-factory/shell'\nimport { config } from '@things-factory/env'\n\nimport { User } from '../service/user/user'\nimport { getUserDomains } from '../utils/get-user-domains'\n\nconst PUBLIC_HOME_ROUTE = config.get('publicHomeRoute', '/public/home')\n\nexport const siteRootRouter = new Router()\n\nasync function findAuth(context, next) {\n return await passport.authenticate('jwt', { session: false }, async (err, decoded, info) => {\n if (decoded) {\n try {\n const user = await User.checkAuth(decoded)\n context.state.user = user\n } catch (e) {}\n }\n\n await next()\n })(context, next)\n}\n\nsiteRootRouter.get('/', findAuth, domainMiddleware, async (context, next) => {\n const { user, domain } = context.state\n\n const subdomain = domain?.subdomain\n\n if (user && subdomain) {\n const userDomains: Domain[] = await getUserDomains(user)\n if (userDomains.find(userDomain => userDomain.subdomain == subdomain)) {\n return await next()\n }\n\n return context.redirect(`/auth/checkin/${subdomain}`)\n }\n\n if (user && !subdomain) {\n context.redirect('/auth/checkin')\n\n return\n }\n\n context.redirect(PUBLIC_HOME_ROUTE)\n})\n"]}
1
+ {"version":3,"file":"site-root-router.js","sourceRoot":"","sources":["../../server/router/site-root-router.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAC/B,wEAAmC;AAEnC,iDAAgE;AAChE,6CAA4C;AAE5C,+CAA2C;AAC3C,gEAA0D;AAE1D,MAAM,iBAAiB,GAAG,YAAM,CAAC,GAAG,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAA;AAE1D,QAAA,cAAc,GAAG,IAAI,oBAAM,EAAE,CAAA;AAE1C,KAAK,UAAU,QAAQ,CAAC,OAAO,EAAE,IAAI;IACnC,OAAO,MAAM,sBAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACzF,IAAI,OAAO,EAAE;YACX,IAAI;gBACF,MAAM,IAAI,GAAG,MAAM,WAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;gBAC1C,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAA;aAC1B;YAAC,OAAO,CAAC,EAAE,GAAE;SACf;QAED,MAAM,IAAI,EAAE,CAAA;IACd,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACnB,CAAC;AAED,sBAAc,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,wBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC1E,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAEtC,MAAM,SAAS,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAA;IAEnC,IAAI,IAAI,IAAI,SAAS,EAAE;QACrB,MAAM,WAAW,GAAa,MAAM,IAAA,iCAAc,EAAC,IAAI,CAAC,CAAA;QACxD,IAAI,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,IAAI,SAAS,CAAC,EAAE;YACrE,OAAO,MAAM,IAAI,EAAE,CAAA;SACpB;QAED,OAAO,OAAO,CAAC,QAAQ,CAAC,iBAAiB,SAAS,EAAE,CAAC,CAAA;KACtD;IAED,IAAI,IAAI,IAAI,CAAC,SAAS,EAAE;QACtB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAA;QAEjC,OAAM;KACP;IAED,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAA;AACrC,CAAC,CAAC,CAAA","sourcesContent":["import Router from 'koa-router'\nimport passport from 'koa-passport'\n\nimport { Domain, domainMiddleware } from '@things-factory/shell'\nimport { config } from '@things-factory/env'\n\nimport { User } from '../service/user/user'\nimport { getUserDomains } from '../utils/get-user-domains'\n\nconst PUBLIC_HOME_ROUTE = config.get('publicHomeRoute', '/public/home')\n\nexport const siteRootRouter = new Router()\n\nasync function findAuth(context, next) {\n return await passport.authenticate('jwt', { session: false }, async (err, decoded, info) => {\n if (decoded) {\n try {\n const user = await User.checkAuth(decoded)\n context.state.user = user\n } catch (e) {}\n }\n\n await next()\n })(context, next)\n}\n\nsiteRootRouter.get('/', findAuth, domainMiddleware, async (context, next) => {\n const { user, domain } = context.state\n\n const subdomain = domain?.subdomain\n\n if (user && subdomain) {\n const userDomains: Domain[] = await getUserDomains(user)\n if (userDomains.find(userDomain => userDomain.subdomain == subdomain)) {\n return await next()\n }\n\n return context.redirect(`/auth/checkin/${subdomain}`)\n }\n\n if (user && !subdomain) {\n context.redirect('/auth/checkin')\n\n return\n }\n\n context.redirect(PUBLIC_HOME_ROUTE)\n})\n"]}
@@ -1,15 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const koa_session_1 = tslib_1.__importDefault(require("koa-session"));
5
3
  const env_1 = require("@things-factory/env");
6
4
  const middlewares_1 = require("./middlewares");
7
5
  const router_1 = require("./router");
8
- const get_secret_1 = require("./utils/get-secret");
6
+ const access_token_cookie_1 = require("./utils/access-token-cookie");
9
7
  const isPathBaseDomain = !env_1.config.get('subdomain') && !env_1.config.get('useVirtualHostBasedDomain');
10
8
  process.on('bootstrap-module-global-public-route', (app, globalPublicRouter) => {
11
9
  globalPublicRouter.use(router_1.siteRootRouter.routes(), router_1.siteRootRouter.allowedMethods());
12
10
  globalPublicRouter.use(router_1.authPublicProcessRouter.routes(), router_1.authPublicProcessRouter.allowedMethods());
11
+ /* ssoMiddleware가 정의되어있다면, /auth/sso-signin 패스를 활성화한다. */
12
+ if (app.ssoMiddlewares.length > 0) {
13
+ router_1.authSigninRouter.get('/auth/sso-signin', app.ssoMiddlewares[0], async (context) => {
14
+ const { user } = context.state;
15
+ const token = user.sign();
16
+ (0, access_token_cookie_1.setAccessTokenCookie)(context, token);
17
+ context.redirect('/auth/checkin');
18
+ });
19
+ }
13
20
  });
14
21
  process.on('bootstrap-module-global-private-route', (app, globalPrivateRouter) => {
15
22
  globalPrivateRouter.use(middlewares_1.jwtAuthenticateMiddleware);
@@ -21,9 +28,6 @@ process.on('bootstrap-module-domain-public-route', (app, domainPublicRouter) =>
21
28
  /* domainPublicRouter based nested-routers */
22
29
  domainPublicRouter.use(router_1.authSigninRouter.routes(), router_1.authSigninRouter.allowedMethods());
23
30
  domainPublicRouter.use(router_1.authSignupRouter.routes(), router_1.authSignupRouter.allowedMethods());
24
- /* oauth2orize-koa 에서 oauth 트랜잭션 관리를 위해서 session을 사용함. */
25
- app.keys = [get_secret_1.SECRET];
26
- app.use((0, koa_session_1.default)(app));
27
31
  /* path '/admin/oauth/...' is deprecated. should use path '/oauth/...' for oauth2 related routing */
28
32
  domainPublicRouter.use('/oauth', router_1.oauth2Router.routes(), router_1.oauth2Router.allowedMethods()); // if i use context
29
33
  });
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":";;;AAAA,sEAAiC;AAEjC,6CAA4C;AAE5C,+CAAuF;AACvF,qCAUiB;AACjB,mDAA2C;AAE3C,MAAM,gBAAgB,GAAG,CAAC,YAAM,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,YAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;AAE7F,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF,kBAAkB,CAAC,GAAG,CAAC,uBAAc,CAAC,MAAM,EAAE,EAAE,uBAAc,CAAC,cAAc,EAAE,CAAC,CAAA;IAChF,kBAAkB,CAAC,GAAG,CAAC,gCAAuB,CAAC,MAAM,EAAE,EAAE,gCAAuB,CAAC,cAAc,EAAE,CAAC,CAAA;AACpG,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF,mBAAmB,CAAC,GAAG,CAAC,uCAAyB,CAAC,CAAA;IAElD,8CAA8C;IAC9C,mBAAmB,CAAC,GAAG,CAAC,0BAAiB,CAAC,MAAM,EAAE,EAAE,0BAAiB,CAAC,cAAc,EAAE,CAAC,CAAA;IACvF,mBAAmB,CAAC,GAAG,CAAC,iCAAwB,CAAC,MAAM,EAAE,EAAE,iCAAwB,CAAC,cAAc,EAAE,CAAC,CAAA;AACvG,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF,6CAA6C;IAC7C,kBAAkB,CAAC,GAAG,CAAC,yBAAgB,CAAC,MAAM,EAAE,EAAE,yBAAgB,CAAC,cAAc,EAAE,CAAC,CAAA;IACpF,k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AuthenticateMiddleware, jwtAuthenticateMiddleware } from './middlewares'\nimport {\n authCheckinRouter,\n authPrivateProcessRouter,\n authPublicProcessRouter,\n authSigninRouter,\n authSignupRouter,\n oauth2AuthorizeRouter,\n oauth2Router,\n pathBaseDomainRouter,\n siteRootRouter\n} from './router'\nimport { SECRET } from './utils/get-secret'\n\nconst isPathBaseDomain = !config.get('subdomain') && !config.get('useVirtualHostBasedDomain')\n\nprocess.on('bootstrap-module-global-public-route' as any, (app, globalPublicRouter) => {\n globalPublicRouter.use(siteRootRouter.routes(), siteRootRouter.allowedMethods())\n globalPublicRouter.use(authPublicProcessRouter.routes(), authPublicProcessRouter.allowedMethods())\n})\n\nprocess.on('bootstrap-module-global-private-route' as any, (app, globalPrivateRouter) => {\n globalPrivateRouter.use(jwtAuthenticateMiddleware)\n\n /* globalPrivateRouter based nested-routers */\n globalPrivateRouter.use(authCheckinRouter.routes(), authCheckinRouter.allowedMethods())\n globalPrivateRouter.use(authPrivateProcessRouter.routes(), authPrivateProcessRouter.allowedMethods())\n})\n\nprocess.on('bootstrap-module-domain-public-route' as any, (app, domainPublicRouter) => {\n /* domainPublicRouter based nested-routers */\n domainPublicRouter.use(authSigninRouter.routes(), authSigninRouter.allowedMethods())\n domainPublicRouter.use(authSignupRouter.routes(), authSignupRouter.allowedMethods())\n\n /* oauth2orize-koa 에서 oauth 트랜잭션 관리를 위해서 session을 사용함. */\n app.keys = [SECRET]\n app.use(session(app))\n\n /* path '/admin/oauth/...' is deprecated. should use path '/oauth/...' for oauth2 related routing */\n domainPublicRouter.use('/oauth', oauth2Router.routes(), oauth2Router.allowedMethods()) // if i use context\n})\n\nprocess.on('bootstrap-module-domain-private-route' as any, (app, domainPrivateRouter) => {\n domainPrivateRouter.use(jwtAuthenticateMiddleware)\n domainPrivateRouter.use(domainAuthenticateMiddleware)\n\n /* domainPrivateRouter based nested-routers */\n if (isPathBaseDomain) {\n // pathBaseDomainRouter는 history-fallback의 경우에 인증 처리를 하기 위한 라우터이다.\n // (보통, URL 링크등을 통해서 domain path URL로 바로 요청하는 경우에 해당한다.)\n // pathBaseDomainRouter는 domain path를 domain-private-router를 사용하는 것을 전제로 한다.\n domainPrivateRouter.use(\n '/domain/:domain/oauth',\n oauth2AuthorizeRouter.routes(),\n oauth2AuthorizeRouter.allowedMethods()\n )\n domainPrivateRouter.use('/domain', pathBaseDomainRouter.routes(), pathBaseDomainRouter.allowedMethods())\n }\n\n // Client Routing : path 확장자가 없는 경우는 대부분 client 라우팅에 해당한다.\n // 즉, browser-history-fallback 으로 index.html을 send 하는 경우에, 사용자 로그인이 필요한 경우에,\n // 화면깜박임없이 signin page로 redirect 하고자하는 목적의 설정이다.\n // domain-private 라우트를 통과하고 싶지 않다면, regexp를 조정한다.\n // '(.[^.]+)' 은 '', '/'는 제외하고, '/xxx', '/yyy/zzz' 등 모두를 포함하지만, path에 '.'가 있는 경우는 제외한다.\n // (테스트는 여기서 : http://forbeslindesay.github.io/express-route-tester/)\n domainPrivateRouter.get('(.[^.]+)', async (context, next) => {\n await next()\n })\n})\n"]}
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":";;AAAA,6CAA4C;AAE5C,+CAAuF;AACvF,qCAUiB;AAEjB,qEAAkE;AAGlE,MAAM,gBAAgB,GAAG,CAAC,YAAM,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,YAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;AAE7F,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF,kBAAkB,CAAC,GAAG,CAAC,uBAAc,CAAC,MAAM,EAAE,EAAE,uBAAc,CAAC,cAAc,EAAE,CAAC,CAAA;IAChF,kBAAkB,CAAC,GAAG,CAAC,gCAAuB,CAAC,MAAM,EAAE,EAAE,gCAAuB,CAAC,cAAc,EAAE,CAAC,CAAA;IAElG,yDAAyD;IACzD,IAAI,GAAG,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AAc,EAAE,CAAC,CAAA,CAAC,mBAAmB;AAC5G,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF,mBAAmB,CAAC,GAAG,CAAC,uCAAyB,CAAC,CAAA;IAClD,mBAAmB,CAAC,GAAG,CAAC,0CAA4B,CAAC,CAAA;IAErD,8CAA8C;IAC9C,IAAI,gBAAgB,EAAE;QACpB,kEAAkE;QAClE,wDAAwD;QACxD,4EAA4E;QAC5E,mBAAmB,CAAC,GAAG,CACrB,uBAAuB,EACvB,8BAAqB,CAAC,MAAM,EAAE,EAC9B,8BAAqB,CAAC,cAAc,EAAE,CACvC,CAAA;QACD,mBAAmB,CAAC,GAAG,CAAC,SAAS,EAAE,6BAAoB,CAAC,MAAM,EAAE,EAAE,6BAAoB,CAAC,cAAc,EAAE,CAAC,CAAA;KACzG;IAED,0DAA0D;IAC1D,4EAA4E;IAC5E,gDAAgD;IAChD,iDAAiD;IACjD,sFAAsF;IACtF,qEAAqE;IACrE,mBAAmB,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC1D,MAAM,IAAI,EAAE,CAAA;IACd,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { config } from '@things-factory/env'\n\nimport { domainAuthenticateMiddleware, jwtAuthenticateMiddleware } from './middlewares'\nimport {\n authCheckinRouter,\n authPrivateProcessRouter,\n authPublicProcessRouter,\n authSigninRouter,\n authSignupRouter,\n oauth2AuthorizeRouter,\n oauth2Router,\n pathBaseDomainRouter,\n siteRootRouter\n} from './router'\n\nimport { setAccessTokenCookie } from './utils/access-token-cookie'\nimport { User } from './service/user/user'\n\nconst isPathBaseDomain = !config.get('subdomain') && !config.get('useVirtualHostBasedDomain')\n\nprocess.on('bootstrap-module-global-public-route' as any, (app, globalPublicRouter) => {\n globalPublicRouter.use(siteRootRouter.routes(), siteRootRouter.allowedMethods())\n globalPublicRouter.use(authPublicProcessRouter.routes(), authPublicProcessRouter.allowedMethods())\n\n /* ssoMiddleware가 정의되어있다면, /auth/sso-signin 패스를 활성화한다. */\n if (app.ssoMiddlewares.length > 0) {\n authSigninRouter.get('/auth/sso-signin', app.ssoMiddlewares[0], async context => {\n const { user } = context.state\n\n const token = user.sign()\n setAccessTokenCookie(context, token)\n\n context.redirect('/auth/checkin')\n })\n }\n})\n\nprocess.on('bootstrap-module-global-private-route' as any, (app, globalPrivateRouter) => {\n globalPrivateRouter.use(jwtAuthenticateMiddleware)\n\n /* globalPrivateRouter based nested-routers */\n globalPrivateRouter.use(authCheckinRouter.routes(), authCheckinRouter.allowedMethods())\n globalPrivateRouter.use(authPrivateProcessRouter.routes(), authPrivateProcessRouter.allowedMethods())\n})\n\nprocess.on('bootstrap-module-domain-public-route' as any, (app, domainPublicRouter) => {\n /* domainPublicRouter based nested-routers */\n domainPublicRouter.use(authSigninRouter.routes(), authSigninRouter.allowedMethods())\n domainPublicRouter.use(authSignupRouter.routes(), authSignupRouter.allowedMethods())\n\n /* path '/admin/oauth/...' is deprecated. should use path '/oauth/...' for oauth2 related routing */\n domainPublicRouter.use('/oauth', oauth2Router.routes(), oauth2Router.allowedMethods()) // if i use context\n})\n\nprocess.on('bootstrap-module-domain-private-route' as any, (app, domainPrivateRouter) => {\n domainPrivateRouter.use(jwtAuthenticateMiddleware)\n domainPrivateRouter.use(domainAuthenticateMiddleware)\n\n /* domainPrivateRouter based nested-routers */\n if (isPathBaseDomain) {\n // pathBaseDomainRouter는 history-fallback의 경우에 인증 처리를 하기 위한 라우터이다.\n // (보통, URL 링크등을 통해서 domain path URL로 바로 요청하는 경우에 해당한다.)\n // pathBaseDomainRouter는 domain path를 domain-private-router를 사용하는 것을 전제로 한다.\n domainPrivateRouter.use(\n '/domain/:domain/oauth',\n oauth2AuthorizeRouter.routes(),\n oauth2AuthorizeRouter.allowedMethods()\n )\n domainPrivateRouter.use('/domain', pathBaseDomainRouter.routes(), pathBaseDomainRouter.allowedMethods())\n }\n\n // Client Routing : path 확장자가 없는 경우는 대부분 client 라우팅에 해당한다.\n // 즉, browser-history-fallback 으로 index.html을 send 하는 경우에, 사용자 로그인이 필요한 경우에,\n // 화면깜박임없이 signin page로 redirect 하고자하는 목적의 설정이다.\n // domain-private 라우트를 통과하고 싶지 않다면, regexp를 조정한다.\n // '(.[^.]+)' 은 '', '/'는 제외하고, '/xxx', '/yyy/zzz' 등 모두를 포함하지만, path에 '.'가 있는 경우는 제외한다.\n // (테스트는 여기서 : http://forbeslindesay.github.io/express-route-tester/)\n domainPrivateRouter.get('(.[^.]+)', async (context, next) => {\n await next()\n })\n})\n"]}
@@ -35,6 +35,7 @@ export declare class User {
35
35
  static generateSalt(): string;
36
36
  static encode(password: string, salt: any): string;
37
37
  static verify(hashed: any, password: any, salt: any): boolean;
38
+ static checkAuthWithEmail(decoded: any): Promise<User>;
38
39
  static checkAuth(decoded: any): Promise<User>;
39
40
  static hasPrivilege(name: string, category: string, domain: Domain, user: User): Promise<boolean>;
40
41
  static getDomainsWithPrivilege(name: string, category: string, user: User): Promise<Domain[]>;