@metamask/profile-sync-controller 0.0.0 → 0.1.1
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.
- package/CHANGELOG.md +19 -1
- package/dist/chunk-2XGRQBXI.mjs +70 -0
- package/dist/chunk-2XGRQBXI.mjs.map +1 -0
- package/dist/chunk-32HAX3MW.mjs +224 -0
- package/dist/chunk-32HAX3MW.mjs.map +1 -0
- package/dist/chunk-5SXXO4MV.js +70 -0
- package/dist/chunk-5SXXO4MV.js.map +1 -0
- package/dist/chunk-5TOWF6UW.mjs +11 -0
- package/dist/chunk-5TOWF6UW.mjs.map +1 -0
- package/dist/chunk-6P6CUKKI.mjs +30 -0
- package/dist/chunk-6P6CUKKI.mjs.map +1 -0
- package/dist/chunk-76VRE4BI.mjs +18 -0
- package/dist/chunk-76VRE4BI.mjs.map +1 -0
- package/dist/chunk-AARMY5TW.mjs +86 -0
- package/dist/chunk-AARMY5TW.mjs.map +1 -0
- package/dist/chunk-AK7OTIWA.js +11 -0
- package/dist/chunk-AK7OTIWA.js.map +1 -0
- package/dist/chunk-AUFUOKJW.mjs +25 -0
- package/dist/chunk-AUFUOKJW.mjs.map +1 -0
- package/dist/{chunk-OF3TQWGX.js → chunk-AVOOINGJ.js} +34 -34
- package/dist/chunk-AVOOINGJ.js.map +1 -0
- package/dist/{chunk-CZ7YK35S.mjs → chunk-AXWK4Y23.mjs} +7 -5
- package/dist/{chunk-CZ7YK35S.mjs.map → chunk-AXWK4Y23.mjs.map} +1 -1
- package/dist/{chunk-UMKBFFZ5.mjs → chunk-B5DBQDB3.mjs} +13 -4
- package/dist/chunk-B5DBQDB3.mjs.map +1 -0
- package/dist/chunk-B6CSNLGE.js +25 -0
- package/dist/chunk-B6CSNLGE.js.map +1 -0
- package/dist/{chunk-NRH6O4QZ.js → chunk-BOET676P.js} +45 -14
- package/dist/chunk-BOET676P.js.map +1 -0
- package/dist/{chunk-2FZSWVHT.mjs → chunk-CAIIVJAO.mjs} +1 -1
- package/dist/chunk-CAIIVJAO.mjs.map +1 -0
- package/dist/chunk-ELHJSRS2.js +98 -0
- package/dist/chunk-ELHJSRS2.js.map +1 -0
- package/dist/chunk-FCT2LIGH.mjs +106 -0
- package/dist/chunk-FCT2LIGH.mjs.map +1 -0
- package/dist/chunk-FQ5SDMRE.mjs +77 -0
- package/dist/chunk-FQ5SDMRE.mjs.map +1 -0
- package/dist/chunk-H25EBXG5.mjs +58 -0
- package/dist/chunk-H25EBXG5.mjs.map +1 -0
- package/dist/chunk-H4TDS65R.js +81 -0
- package/dist/chunk-H4TDS65R.js.map +1 -0
- package/dist/{chunk-Z4BLTVTB.js → chunk-IGY2S5BC.js} +9 -3
- package/dist/chunk-IPSBQ3MS.js +30 -0
- package/dist/chunk-IPSBQ3MS.js.map +1 -0
- package/dist/{chunk-4NGEEDGV.mjs → chunk-JLDFMYAH.mjs} +9 -9
- package/dist/chunk-JLDFMYAH.mjs.map +1 -0
- package/dist/chunk-K5UKU454.mjs +158 -0
- package/dist/chunk-K5UKU454.mjs.map +1 -0
- package/dist/chunk-KBCXN3YW.mjs +98 -0
- package/dist/chunk-KBCXN3YW.mjs.map +1 -0
- package/dist/chunk-LSVRA3X2.mjs +81 -0
- package/dist/chunk-LSVRA3X2.mjs.map +1 -0
- package/dist/{chunk-GQLHSQGZ.js → chunk-MBTBE4P5.js} +9 -2
- package/dist/chunk-MBTBE4P5.js.map +1 -0
- package/dist/chunk-NLHLVVOO.js +106 -0
- package/dist/chunk-NLHLVVOO.js.map +1 -0
- package/dist/{chunk-VZXD5DCQ.js → chunk-P4DUDLMY.js} +36 -27
- package/dist/chunk-P4DUDLMY.js.map +1 -0
- package/dist/{chunk-6X6I3HZU.js → chunk-P52TG263.js} +28 -26
- package/dist/chunk-P52TG263.js.map +1 -0
- package/dist/{chunk-CFST6GWE.js → chunk-PBRUOBEQ.js} +1 -1
- package/dist/chunk-PBRUOBEQ.js.map +1 -0
- package/dist/chunk-PCOIRDTO.js +18 -0
- package/dist/chunk-PCOIRDTO.js.map +1 -0
- package/dist/chunk-PTR4DAX6.js +79 -0
- package/dist/chunk-PTR4DAX6.js.map +1 -0
- package/dist/chunk-Q5WIUNX5.js +126 -0
- package/dist/chunk-Q5WIUNX5.js.map +1 -0
- package/dist/chunk-RX5R6BUI.js +86 -0
- package/dist/chunk-RX5R6BUI.js.map +1 -0
- package/dist/chunk-SMKTWM6I.js +77 -0
- package/dist/chunk-SMKTWM6I.js.map +1 -0
- package/dist/chunk-T3FNDVE3.js +158 -0
- package/dist/chunk-T3FNDVE3.js.map +1 -0
- package/dist/{chunk-BHVT2QEA.mjs → chunk-TFFQFIJV.mjs} +8 -1
- package/dist/chunk-TFFQFIJV.mjs.map +1 -0
- package/dist/chunk-TGFMKARH.mjs +274 -0
- package/dist/chunk-TGFMKARH.mjs.map +1 -0
- package/dist/{chunk-XUI43LEZ.mjs → chunk-U5UIDVOO.mjs} +7 -1
- package/dist/chunk-UAXWZN5J.js +58 -0
- package/dist/chunk-UAXWZN5J.js.map +1 -0
- package/dist/{chunk-CYGZ4WLJ.mjs → chunk-WB6MUIML.mjs} +36 -5
- package/dist/chunk-WB6MUIML.mjs.map +1 -0
- package/dist/chunk-WJCKQLKK.mjs +79 -0
- package/dist/chunk-WJCKQLKK.mjs.map +1 -0
- package/dist/{chunk-VXPVURGH.mjs → chunk-Y46NMA3V.mjs} +9 -9
- package/dist/chunk-Y46NMA3V.mjs.map +1 -0
- package/dist/chunk-YASNOFBV.js +274 -0
- package/dist/chunk-YASNOFBV.js.map +1 -0
- package/dist/chunk-YUXN5GSW.js +224 -0
- package/dist/chunk-YUXN5GSW.js.map +1 -0
- package/dist/controllers/authentication/AuthenticationController.js +24 -0
- package/dist/controllers/authentication/AuthenticationController.mjs +24 -0
- package/dist/controllers/authentication/auth-snap-requests.js +10 -0
- package/dist/controllers/authentication/auth-snap-requests.mjs +10 -0
- package/dist/controllers/authentication/index.js +28 -0
- package/dist/controllers/authentication/index.js.map +1 -0
- package/dist/controllers/authentication/index.mjs +28 -0
- package/dist/controllers/authentication/index.mjs.map +1 -0
- package/dist/controllers/authentication/services.js +32 -0
- package/dist/controllers/authentication/services.js.map +1 -0
- package/dist/controllers/authentication/services.mjs +32 -0
- package/dist/controllers/authentication/services.mjs.map +1 -0
- package/dist/controllers/index.js +34 -0
- package/dist/controllers/index.js.map +1 -0
- package/dist/controllers/index.mjs +34 -0
- package/dist/controllers/index.mjs.map +1 -0
- package/dist/controllers/user-storage/UserStorageController.js +29 -0
- package/dist/controllers/user-storage/UserStorageController.js.map +1 -0
- package/dist/controllers/user-storage/UserStorageController.mjs +29 -0
- package/dist/controllers/user-storage/UserStorageController.mjs.map +1 -0
- package/dist/controllers/user-storage/encryption/cache.js +13 -0
- package/dist/controllers/user-storage/encryption/cache.js.map +1 -0
- package/dist/controllers/user-storage/encryption/cache.mjs +13 -0
- package/dist/controllers/user-storage/encryption/cache.mjs.map +1 -0
- package/dist/controllers/user-storage/encryption/encryption.js +12 -0
- package/dist/controllers/user-storage/encryption/encryption.js.map +1 -0
- package/dist/controllers/user-storage/encryption/encryption.mjs +12 -0
- package/dist/controllers/user-storage/encryption/encryption.mjs.map +1 -0
- package/dist/controllers/user-storage/encryption/index.js +16 -0
- package/dist/controllers/user-storage/encryption/index.js.map +1 -0
- package/dist/controllers/user-storage/encryption/index.mjs +16 -0
- package/dist/controllers/user-storage/encryption/index.mjs.map +1 -0
- package/dist/controllers/user-storage/encryption/utils.js +12 -0
- package/dist/controllers/user-storage/encryption/utils.js.map +1 -0
- package/dist/controllers/user-storage/encryption/utils.mjs +12 -0
- package/dist/controllers/user-storage/encryption/utils.mjs.map +1 -0
- package/dist/controllers/user-storage/index.js +38 -0
- package/dist/controllers/user-storage/index.js.map +1 -0
- package/dist/controllers/user-storage/index.mjs +38 -0
- package/dist/controllers/user-storage/index.mjs.map +1 -0
- package/dist/controllers/user-storage/schema.js +14 -0
- package/dist/controllers/user-storage/schema.js.map +1 -0
- package/dist/controllers/user-storage/schema.mjs +14 -0
- package/dist/controllers/user-storage/schema.mjs.map +1 -0
- package/dist/controllers/user-storage/services.js +31 -0
- package/dist/controllers/user-storage/services.js.map +1 -0
- package/dist/controllers/user-storage/services.mjs +31 -0
- package/dist/controllers/user-storage/services.mjs.map +1 -0
- package/dist/index.js +31 -62
- package/dist/index.mjs +32 -63
- package/dist/sdk/authentication-jwt-bearer/flow-siwe.js +7 -8
- package/dist/sdk/authentication-jwt-bearer/flow-siwe.mjs +6 -7
- package/dist/sdk/authentication-jwt-bearer/flow-srp.js +7 -8
- package/dist/sdk/authentication-jwt-bearer/flow-srp.mjs +6 -7
- package/dist/sdk/authentication-jwt-bearer/services.js +10 -6
- package/dist/sdk/authentication-jwt-bearer/services.mjs +11 -7
- package/dist/sdk/authentication-jwt-bearer/types.js +3 -3
- package/dist/sdk/authentication-jwt-bearer/types.mjs +2 -2
- package/dist/sdk/authentication.js +9 -10
- package/dist/sdk/authentication.mjs +8 -9
- package/dist/sdk/encryption.js +5 -3
- package/dist/sdk/encryption.mjs +4 -2
- package/dist/sdk/env.js +5 -3
- package/dist/sdk/env.mjs +4 -2
- package/dist/sdk/errors.js +5 -3
- package/dist/sdk/errors.mjs +4 -2
- package/dist/sdk/index.js +18 -13
- package/dist/sdk/index.mjs +17 -12
- package/dist/sdk/user-storage.js +6 -6
- package/dist/sdk/user-storage.mjs +5 -5
- package/dist/sdk/utils/eip-6963-metamask-provider.js +1 -1
- package/dist/sdk/utils/eip-6963-metamask-provider.mjs +1 -1
- package/dist/sdk/utils/messaging-signing-snap-requests.js +1 -1
- package/dist/sdk/utils/messaging-signing-snap-requests.mjs +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/controllers/authentication/AuthenticationController.d.ts +74 -0
- package/dist/types/controllers/authentication/AuthenticationController.d.ts.map +1 -0
- package/dist/types/controllers/authentication/__fixtures__/index.d.ts +2 -0
- package/dist/types/controllers/authentication/__fixtures__/index.d.ts.map +1 -0
- package/dist/types/controllers/authentication/__fixtures__/mockResponses.d.ts +23 -0
- package/dist/types/controllers/authentication/__fixtures__/mockResponses.d.ts.map +1 -0
- package/dist/types/controllers/authentication/__fixtures__/mockServices.d.ts +10 -0
- package/dist/types/controllers/authentication/__fixtures__/mockServices.d.ts.map +1 -0
- package/dist/types/controllers/authentication/auth-snap-requests.d.ts +17 -0
- package/dist/types/controllers/authentication/auth-snap-requests.d.ts.map +1 -0
- package/dist/types/controllers/authentication/index.d.ts +5 -0
- package/dist/types/controllers/authentication/index.d.ts.map +1 -0
- package/dist/types/controllers/authentication/services.d.ts +69 -0
- package/dist/types/controllers/authentication/services.d.ts.map +1 -0
- package/dist/types/controllers/index.d.ts +3 -0
- package/dist/types/controllers/index.d.ts.map +1 -0
- package/dist/types/controllers/user-storage/UserStorageController.d.ts +85 -0
- package/dist/types/controllers/user-storage/UserStorageController.d.ts.map +1 -0
- package/dist/types/controllers/user-storage/__fixtures__/index.d.ts +3 -0
- package/dist/types/controllers/user-storage/__fixtures__/index.d.ts.map +1 -0
- package/dist/types/controllers/user-storage/__fixtures__/mockResponses.d.ts +13 -0
- package/dist/types/controllers/user-storage/__fixtures__/mockResponses.d.ts.map +1 -0
- package/dist/types/controllers/user-storage/__fixtures__/mockServices.d.ts +9 -0
- package/dist/types/controllers/user-storage/__fixtures__/mockServices.d.ts.map +1 -0
- package/dist/types/controllers/user-storage/__fixtures__/mockStorage.d.ts +5 -0
- package/dist/types/controllers/user-storage/__fixtures__/mockStorage.d.ts.map +1 -0
- package/dist/types/controllers/user-storage/encryption/cache.d.ts +31 -0
- package/dist/types/controllers/user-storage/encryption/cache.d.ts.map +1 -0
- package/dist/types/controllers/user-storage/encryption/encryption.d.ts +26 -0
- package/dist/types/controllers/user-storage/encryption/encryption.d.ts.map +1 -0
- package/dist/types/controllers/user-storage/encryption/index.d.ts +5 -0
- package/dist/types/controllers/user-storage/encryption/index.d.ts.map +1 -0
- package/dist/types/controllers/user-storage/encryption/utils.d.ts +4 -0
- package/dist/types/controllers/user-storage/encryption/utils.d.ts.map +1 -0
- package/dist/types/controllers/user-storage/index.d.ts +6 -0
- package/dist/types/controllers/user-storage/index.d.ts.map +1 -0
- package/dist/types/controllers/user-storage/schema.d.ts +22 -0
- package/dist/types/controllers/user-storage/schema.d.ts.map +1 -0
- package/dist/types/controllers/user-storage/services.d.ts +30 -0
- package/dist/types/controllers/user-storage/services.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/sdk/__fixtures__/mock-auth.d.ts +3 -0
- package/dist/types/sdk/__fixtures__/mock-auth.d.ts.map +1 -1
- package/dist/types/sdk/__fixtures__/mock-userstorage.d.ts.map +1 -1
- package/dist/types/sdk/__fixtures__/test-utils.d.ts.map +1 -1
- package/dist/types/sdk/authentication-jwt-bearer/flow-siwe.d.ts.map +1 -1
- package/dist/types/sdk/authentication-jwt-bearer/flow-srp.d.ts.map +1 -1
- package/dist/types/sdk/authentication-jwt-bearer/services.d.ts +20 -2
- package/dist/types/sdk/authentication-jwt-bearer/services.d.ts.map +1 -1
- package/dist/types/sdk/authentication-jwt-bearer/types.d.ts +9 -2
- package/dist/types/sdk/authentication-jwt-bearer/types.d.ts.map +1 -1
- package/dist/types/sdk/authentication.d.ts +2 -1
- package/dist/types/sdk/authentication.d.ts.map +1 -1
- package/dist/types/sdk/encryption.d.ts +2 -2
- package/dist/types/sdk/encryption.d.ts.map +1 -1
- package/dist/types/sdk/env.d.ts +9 -2
- package/dist/types/sdk/env.d.ts.map +1 -1
- package/dist/types/sdk/errors.d.ts +3 -0
- package/dist/types/sdk/errors.d.ts.map +1 -1
- package/dist/types/sdk/user-storage.d.ts.map +1 -1
- package/package.json +15 -2
- package/dist/chunk-2FZSWVHT.mjs.map +0 -1
- package/dist/chunk-4NGEEDGV.mjs.map +0 -1
- package/dist/chunk-6X6I3HZU.js.map +0 -1
- package/dist/chunk-BARZBXO7.js +0 -7
- package/dist/chunk-BARZBXO7.js.map +0 -1
- package/dist/chunk-BHVT2QEA.mjs.map +0 -1
- package/dist/chunk-CFST6GWE.js.map +0 -1
- package/dist/chunk-CYGZ4WLJ.mjs.map +0 -1
- package/dist/chunk-DEATIRII.js +0 -1
- package/dist/chunk-GQLHSQGZ.js.map +0 -1
- package/dist/chunk-GVMIXMYB.mjs +0 -67
- package/dist/chunk-GVMIXMYB.mjs.map +0 -1
- package/dist/chunk-KHFPE566.js +0 -49
- package/dist/chunk-KHFPE566.js.map +0 -1
- package/dist/chunk-KKRIOEXD.mjs +0 -7
- package/dist/chunk-KKRIOEXD.mjs.map +0 -1
- package/dist/chunk-MKJYSWME.mjs +0 -1
- package/dist/chunk-NRH6O4QZ.js.map +0 -1
- package/dist/chunk-OF3TQWGX.js.map +0 -1
- package/dist/chunk-UMKBFFZ5.mjs.map +0 -1
- package/dist/chunk-UVJVONBF.js +0 -126
- package/dist/chunk-UVJVONBF.js.map +0 -1
- package/dist/chunk-VHUU4HEY.js +0 -67
- package/dist/chunk-VHUU4HEY.js.map +0 -1
- package/dist/chunk-VXPVURGH.mjs.map +0 -1
- package/dist/chunk-VZXD5DCQ.js.map +0 -1
- package/dist/chunk-WJRV2JCX.mjs +0 -49
- package/dist/chunk-WJRV2JCX.mjs.map +0 -1
- package/dist/sdk/authentication-jwt-bearer/constants.js +0 -8
- package/dist/sdk/authentication-jwt-bearer/constants.mjs +0 -8
- package/dist/types/sdk/authentication-jwt-bearer/constants.d.ts +0 -2
- package/dist/types/sdk/authentication-jwt-bearer/constants.d.ts.map +0 -1
- /package/dist/{chunk-DEATIRII.js.map → chunk-IGY2S5BC.js.map} +0 -0
- /package/dist/{chunk-MKJYSWME.mjs.map → chunk-U5UIDVOO.mjs.map} +0 -0
- /package/dist/{chunk-Z4BLTVTB.js.map → controllers/authentication/AuthenticationController.js.map} +0 -0
- /package/dist/{chunk-XUI43LEZ.mjs.map → controllers/authentication/AuthenticationController.mjs.map} +0 -0
- /package/dist/{sdk/authentication-jwt-bearer/constants.js.map → controllers/authentication/auth-snap-requests.js.map} +0 -0
- /package/dist/{sdk/authentication-jwt-bearer/constants.mjs.map → controllers/authentication/auth-snap-requests.mjs.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthenticationController.d.ts","sourceRoot":"","sources":["../../../../src/controllers/authentication/AuthenticationController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAE9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,uCAAuC,CAAC;AAcxG,QAAA,MAAM,cAAc,6BAA6B,CAAC;AAGlD,KAAK,cAAc,GAAG;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,OAAO,EAAE,cAAc,CAAC;IACxB,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,gBAAgB,EAAE,MAAM,MAAM,CAAC;IAC/B,KAAK,EAAE,WAAW,GAAG,QAAQ,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AACF,eAAO,MAAM,YAAY,EAAE,6BAE1B,CAAC;AAaF,KAAK,gBAAgB,CAAC,UAAU,SAAS,MAAM,wBAAwB,IAAI;KACxE,CAAC,IAAI,UAAU,GAAG;QACjB,IAAI,EAAE,GAAG,OAAO,cAAc,IAAI,CAAC,EAAE,CAAC;QACtC,OAAO,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC;KACtC;CACF,CAAC;AACF,KAAK,UAAU,GAAG,gBAAgB,CAC9B,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,mBAAmB,GACnB,YAAY,CACf,CAAC;AACF,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,UAAU,CAAC,CAAC;AACnD,MAAM,MAAM,qCAAqC,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;AAChF,MAAM,MAAM,sCAAsC,GAChD,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAC/B,MAAM,MAAM,sCAAsC,GAChD,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAC/B,MAAM,MAAM,yCAAyC,GACnD,UAAU,CAAC,mBAAmB,CAAC,CAAC;AAClC,MAAM,MAAM,kCAAkC,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;AAG1E,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,0CAA0C,CAAC;AAG/C,MAAM,MAAM,iCAAiC,GAAG,6BAA6B,CAC3E,OAAO,cAAc,EACrB,OAAO,GAAG,cAAc,EACxB,KAAK,EACL,cAAc,CAAC,MAAM,CAAC,EACtB,KAAK,CACN,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,cAAc,CAClE,OAAO,cAAc,EACrB,6BAA6B,EAC7B,iCAAiC,CAClC;;gBAGa,EACV,SAAS,EACT,KAAK,EACL,WAAW,GACZ,EAAE;QACD,SAAS,EAAE,iCAAiC,CAAC;QAC7C,KAAK,CAAC,EAAE,6BAA6B,CAAC;QACtC;;;WAGG;QACH,WAAW,EAAE,eAAe,CAAC;KAC9B;IA4CY,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAKtC,cAAc,IAAI,IAAI;IAShB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IAW9C;;;;;OAKG;IACU,iBAAiB,IAAI,OAAO,CAAC,cAAc,CAAC;IAWlD,UAAU,IAAI,OAAO;CAsH7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/controllers/authentication/__fixtures__/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LoginResponse, NonceResponse, OAuthTokenResponse } from '../services';
|
|
2
|
+
export declare const MOCK_NONCE = "4cbfqzoQpcNxVImGv";
|
|
3
|
+
export declare const MOCK_NONCE_RESPONSE: NonceResponse;
|
|
4
|
+
export declare const getMockAuthNonceResponse: () => {
|
|
5
|
+
url: string;
|
|
6
|
+
requestMethod: "GET";
|
|
7
|
+
response: NonceResponse;
|
|
8
|
+
};
|
|
9
|
+
export declare const MOCK_JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
|
|
10
|
+
export declare const MOCK_LOGIN_RESPONSE: LoginResponse;
|
|
11
|
+
export declare const getMockAuthLoginResponse: () => {
|
|
12
|
+
url: string;
|
|
13
|
+
requestMethod: "POST";
|
|
14
|
+
response: LoginResponse;
|
|
15
|
+
};
|
|
16
|
+
export declare const MOCK_ACCESS_TOKEN: string;
|
|
17
|
+
export declare const MOCK_OATH_TOKEN_RESPONSE: OAuthTokenResponse;
|
|
18
|
+
export declare const getMockAuthAccessTokenResponse: () => {
|
|
19
|
+
url: string;
|
|
20
|
+
requestMethod: "POST";
|
|
21
|
+
response: OAuthTokenResponse;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=mockResponses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockResponses.d.ts","sourceRoot":"","sources":["../../../../../src/controllers/authentication/__fixtures__/mockResponses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAarB,eAAO,MAAM,UAAU,sBAAsB,CAAC;AAC9C,eAAO,MAAM,mBAAmB,EAAE,aAEjC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;CAMpC,CAAC;AAEF,eAAO,MAAM,QAAQ,gKAC0I,CAAC;AAChK,eAAO,MAAM,mBAAmB,EAAE,aAUjC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;CAMpC,CAAC;AAEF,eAAO,MAAM,iBAAiB,QAAkC,CAAC;AACjE,eAAO,MAAM,wBAAwB,EAAE,kBAKtC,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;CAM1C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import nock from 'nock';
|
|
2
|
+
type MockReply = {
|
|
3
|
+
status: nock.StatusCode;
|
|
4
|
+
body?: nock.Body;
|
|
5
|
+
};
|
|
6
|
+
export declare const mockEndpointGetNonce: (mockReply?: MockReply) => nock.Scope;
|
|
7
|
+
export declare const mockEndpointLogin: (mockReply?: MockReply) => nock.Scope;
|
|
8
|
+
export declare const mockEndpointAccessToken: (mockReply?: MockReply) => nock.Scope;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=mockServices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockServices.d.ts","sourceRoot":"","sources":["../../../../../src/controllers/authentication/__fixtures__/mockServices.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAQxB,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,oBAAoB,eAAgB,SAAS,eASzD,CAAC;AAEF,eAAO,MAAM,iBAAiB,eAAgB,SAAS,eAQtD,CAAC;AAEF,eAAO,MAAM,uBAAuB,eAAgB,SAAS,eAQ5D,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HandleSnapRequest } from '@metamask/snaps-controllers';
|
|
2
|
+
type SnapRPCRequest = Parameters<HandleSnapRequest['handler']>[0];
|
|
3
|
+
/**
|
|
4
|
+
* Constructs Request to Message Signing Snap to get Public Key
|
|
5
|
+
*
|
|
6
|
+
* @returns Snap Public Key Request
|
|
7
|
+
*/
|
|
8
|
+
export declare function createSnapPublicKeyRequest(): SnapRPCRequest;
|
|
9
|
+
/**
|
|
10
|
+
* Constructs Request to get Message Signing Snap to sign a message.
|
|
11
|
+
*
|
|
12
|
+
* @param message - message to sign
|
|
13
|
+
* @returns Snap Sign Message Request
|
|
14
|
+
*/
|
|
15
|
+
export declare function createSnapSignMessageRequest(message: `metamask:${string}`): SnapRPCRequest;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=auth-snap-requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-snap-requests.d.ts","sourceRoot":"","sources":["../../../../src/controllers/authentication/auth-snap-requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAIrE,KAAK,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAIlE;;;;GAIG;AACH,wBAAgB,0BAA0B,IAAI,cAAc,CAS3D;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,YAAY,MAAM,EAAE,GAC5B,cAAc,CAUhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/controllers/authentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,cAAc,4BAA4B,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export declare const AUTH_NONCE_ENDPOINT: string;
|
|
2
|
+
export declare const AUTH_LOGIN_ENDPOINT: string;
|
|
3
|
+
export declare const OIDC_TOKENS_ENDPOINT: string;
|
|
4
|
+
export type NonceResponse = {
|
|
5
|
+
nonce: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Auth Service - Get Nonce. Used for the initial JWTBearer flow
|
|
9
|
+
*
|
|
10
|
+
* @param publicKey - public key to associate a nonce with
|
|
11
|
+
* @returns the nonce or null if failed
|
|
12
|
+
*/
|
|
13
|
+
export declare function getNonce(publicKey: string): Promise<string | null>;
|
|
14
|
+
/**
|
|
15
|
+
* The Login API Server Response Shape
|
|
16
|
+
*/
|
|
17
|
+
export type LoginResponse = {
|
|
18
|
+
token: string;
|
|
19
|
+
expires_in: string;
|
|
20
|
+
/**
|
|
21
|
+
* Contains anonymous information about the logged in profile.
|
|
22
|
+
*
|
|
23
|
+
* @property identifier_id - a deterministic unique identifier on the method used to sign in
|
|
24
|
+
* @property profile_id - a unique id for a given profile
|
|
25
|
+
* @property metametrics_id - an anonymous server id
|
|
26
|
+
*/
|
|
27
|
+
profile: {
|
|
28
|
+
identifier_id: string;
|
|
29
|
+
profile_id: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
type ClientMetaMetrics = {
|
|
33
|
+
metametricsId: string;
|
|
34
|
+
agent: 'extension' | 'mobile';
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Auth Service - Login. Will perform login with a given signature and will return a single use JWT Token.
|
|
38
|
+
*
|
|
39
|
+
* @param rawMessage - the original message before signing
|
|
40
|
+
* @param signature - the signed message
|
|
41
|
+
* @param clientMetaMetrics - optional client metametrics id (to associate on backend)
|
|
42
|
+
* @returns The Login Response
|
|
43
|
+
*/
|
|
44
|
+
export declare function login(rawMessage: string, signature: string, clientMetaMetrics: ClientMetaMetrics): Promise<LoginResponse | null>;
|
|
45
|
+
/**
|
|
46
|
+
* The Auth API Token Response Shape
|
|
47
|
+
*/
|
|
48
|
+
export type OAuthTokenResponse = {
|
|
49
|
+
access_token: string;
|
|
50
|
+
expires_in: number;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* OIDC Service - Access Token. Trades the Auth Token for an access token (to be used for other authenticated endpoints)
|
|
54
|
+
* NOTE - the access token is short lived, which means it is best practice to validate session before calling authenticated endpoints
|
|
55
|
+
*
|
|
56
|
+
* @param jwtToken - the JWT Auth Token, received from `/login`
|
|
57
|
+
* @returns JWT Access token to store and use on authorized endpoints.
|
|
58
|
+
*/
|
|
59
|
+
export declare function getAccessToken(jwtToken: string): Promise<string | null>;
|
|
60
|
+
/**
|
|
61
|
+
* Utility to create the raw login message for the JWT bearer flow (via SRP)
|
|
62
|
+
*
|
|
63
|
+
* @param nonce - nonce received from `/nonce` endpoint
|
|
64
|
+
* @param publicKey - public key used to retrieve nonce and for message signing
|
|
65
|
+
* @returns Raw Message which will be used for signing & logging in.
|
|
66
|
+
*/
|
|
67
|
+
export declare function createLoginRawMessage(nonce: string, publicKey: string): `metamask:${string}:${string}`;
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/controllers/authentication/services.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,QAAkC,CAAC;AACnE,eAAO,MAAM,mBAAmB,QAAsC,CAAC;AAGvE,eAAO,MAAM,oBAAoB,QAAkC,CAAC;AAIpE,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgBxE;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IAEd,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,OAAO,EAAE;QAEP,aAAa,EAAE,MAAM,CAAC;QAEtB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,WAAW,GAAG,QAAQ,CAAC;CAC/B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,KAAK,CACzB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,iBAAiB,GACnC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA6B/B;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAE/B,YAAY,EAAE,MAAM,CAAC;IAErB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA8B7E;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,YAAY,MAAM,IAAI,MAAM,EAAE,CAEhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/controllers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { RestrictedControllerMessenger } from '@metamask/base-controller';
|
|
2
|
+
import { BaseController } from '@metamask/base-controller';
|
|
3
|
+
import type { HandleSnapRequest } from '@metamask/snaps-controllers';
|
|
4
|
+
import type { AuthenticationControllerGetBearerToken, AuthenticationControllerGetSessionProfile, AuthenticationControllerIsSignedIn, AuthenticationControllerPerformSignIn, AuthenticationControllerPerformSignOut } from '../authentication/AuthenticationController';
|
|
5
|
+
import type { UserStorageEntryKeys } from './schema';
|
|
6
|
+
export declare type NotificationServicesControllerDisableNotificationServices = {
|
|
7
|
+
type: `NotificationServicesController:disableNotificationServices`;
|
|
8
|
+
handler: () => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
export declare type NotificationServicesControllerSelectIsNotificationServicesEnabled = {
|
|
11
|
+
type: `NotificationServicesController:selectIsNotificationServicesEnabled`;
|
|
12
|
+
handler: () => boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const controllerName = "UserStorageController";
|
|
15
|
+
export type UserStorageControllerState = {
|
|
16
|
+
/**
|
|
17
|
+
* Condition used by UI and to determine if we can use some of the User Storage methods.
|
|
18
|
+
*/
|
|
19
|
+
isProfileSyncingEnabled: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Loading state for the profile syncing update
|
|
22
|
+
*/
|
|
23
|
+
isProfileSyncingUpdateLoading: boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare const defaultState: UserStorageControllerState;
|
|
26
|
+
type CreateActionsObj<Controller extends keyof UserStorageController> = {
|
|
27
|
+
[K in Controller]: {
|
|
28
|
+
type: `${typeof controllerName}:${K}`;
|
|
29
|
+
handler: UserStorageController[K];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
type ActionsObj = CreateActionsObj<'performGetStorage' | 'performSetStorage' | 'getStorageKey' | 'enableProfileSyncing' | 'disableProfileSyncing'>;
|
|
33
|
+
export type Actions = ActionsObj[keyof ActionsObj];
|
|
34
|
+
export type UserStorageControllerPerformGetStorage = ActionsObj['performGetStorage'];
|
|
35
|
+
export type UserStorageControllerPerformSetStorage = ActionsObj['performSetStorage'];
|
|
36
|
+
export type UserStorageControllerGetStorageKey = ActionsObj['getStorageKey'];
|
|
37
|
+
export type UserStorageControllerEnableProfileSyncing = ActionsObj['enableProfileSyncing'];
|
|
38
|
+
export type UserStorageControllerDisableProfileSyncing = ActionsObj['disableProfileSyncing'];
|
|
39
|
+
export type AllowedActions = HandleSnapRequest | AuthenticationControllerGetBearerToken | AuthenticationControllerGetSessionProfile | AuthenticationControllerPerformSignIn | AuthenticationControllerIsSignedIn | AuthenticationControllerPerformSignOut | NotificationServicesControllerDisableNotificationServices | NotificationServicesControllerSelectIsNotificationServicesEnabled;
|
|
40
|
+
export type UserStorageControllerMessenger = RestrictedControllerMessenger<typeof controllerName, Actions | AllowedActions, never, AllowedActions['type'], never>;
|
|
41
|
+
/**
|
|
42
|
+
* Reusable controller that allows any team to store synchronized data for a given user.
|
|
43
|
+
* These can be settings shared cross MetaMask clients, or data we want to persist when uninstalling/reinstalling.
|
|
44
|
+
*
|
|
45
|
+
* NOTE:
|
|
46
|
+
* - data stored on UserStorage is FULLY encrypted, with the only keys stored/managed on the client.
|
|
47
|
+
* - No one can access this data unless they are have the SRP and are able to run the signing snap.
|
|
48
|
+
*/
|
|
49
|
+
export default class UserStorageController extends BaseController<typeof controllerName, UserStorageControllerState, UserStorageControllerMessenger> {
|
|
50
|
+
#private;
|
|
51
|
+
getMetaMetricsState: () => boolean;
|
|
52
|
+
constructor(params: {
|
|
53
|
+
messenger: UserStorageControllerMessenger;
|
|
54
|
+
state?: UserStorageControllerState;
|
|
55
|
+
getMetaMetricsState: () => boolean;
|
|
56
|
+
});
|
|
57
|
+
enableProfileSyncing(): Promise<void>;
|
|
58
|
+
setIsProfileSyncingEnabled(isProfileSyncingEnabled: boolean): Promise<void>;
|
|
59
|
+
disableProfileSyncing(): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Allows retrieval of stored data. Data stored is string formatted.
|
|
62
|
+
* Developers can extend the entry path and entry name through the `schema.ts` file.
|
|
63
|
+
*
|
|
64
|
+
* @param entryKey - entry key that matches schema
|
|
65
|
+
* @returns the decrypted string contents found from user storage (or null if not found)
|
|
66
|
+
*/
|
|
67
|
+
performGetStorage(entryKey: UserStorageEntryKeys): Promise<string | null>;
|
|
68
|
+
/**
|
|
69
|
+
* Allows storage of user data. Data stored must be string formatted.
|
|
70
|
+
* Developers can extend the entry path and entry name through the `schema.ts` file.
|
|
71
|
+
*
|
|
72
|
+
* @param entryKey - entry key that matches schema
|
|
73
|
+
* @param value - The string data you want to store.
|
|
74
|
+
* @returns nothing. NOTE that an error is thrown if fails to store data.
|
|
75
|
+
*/
|
|
76
|
+
performSetStorage(entryKey: UserStorageEntryKeys, value: string): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Retrieves the storage key, for internal use only!
|
|
79
|
+
*
|
|
80
|
+
* @returns the storage key
|
|
81
|
+
*/
|
|
82
|
+
getStorageKey(): Promise<string>;
|
|
83
|
+
}
|
|
84
|
+
export {};
|
|
85
|
+
//# sourceMappingURL=UserStorageController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserStorageController.d.ts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/UserStorageController.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/controllers/user-storage/__fixtures__/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GetUserStorageResponse } from '../services';
|
|
2
|
+
export declare const MOCK_USER_STORAGE_NOTIFICATIONS_ENDPOINT: string;
|
|
3
|
+
export declare const getMockUserStorageGetResponse: () => {
|
|
4
|
+
url: string;
|
|
5
|
+
requestMethod: "GET";
|
|
6
|
+
response: GetUserStorageResponse;
|
|
7
|
+
};
|
|
8
|
+
export declare const getMockUserStoragePutResponse: () => {
|
|
9
|
+
url: string;
|
|
10
|
+
requestMethod: "PUT";
|
|
11
|
+
response: null;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=mockResponses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockResponses.d.ts","sourceRoot":"","sources":["../../../../../src/controllers/user-storage/__fixtures__/mockResponses.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAU1D,eAAO,MAAM,wCAAwC,QAGlD,CAAC;AAOJ,eAAO,MAAM,6BAA6B;;;;CAMzC,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;CAMzC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import nock from 'nock';
|
|
2
|
+
type MockReply = {
|
|
3
|
+
status: nock.StatusCode;
|
|
4
|
+
body?: nock.Body;
|
|
5
|
+
};
|
|
6
|
+
export declare const mockEndpointGetUserStorage: (mockReply?: MockReply) => nock.Scope;
|
|
7
|
+
export declare const mockEndpointUpsertUserStorage: (mockReply?: Pick<MockReply, 'status'>) => nock.Scope;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=mockServices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockServices.d.ts","sourceRoot":"","sources":["../../../../../src/controllers/user-storage/__fixtures__/mockServices.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAOxB,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,0BAA0B,eAAgB,SAAS,eAY/D,CAAC;AAEF,eAAO,MAAM,6BAA6B,eAC5B,KAAK,SAAS,EAAE,QAAQ,CAAC,eAOtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockStorage.d.ts","sourceRoot":"","sources":["../../../../../src/controllers/user-storage/__fixtures__/mockStorage.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,mBAAmB,CAAC;AAC3D,eAAO,MAAM,gBAAgB,QAA+C,CAAC;AAC7E,eAAO,MAAM,iBAAiB,QAAqC,CAAC;AACpE,eAAO,MAAM,2BAA2B,QAGvC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
type CachedEntry = {
|
|
2
|
+
salt: Uint8Array;
|
|
3
|
+
base64Salt: string;
|
|
4
|
+
key: Uint8Array;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Returns a given cached derived key from a hashed password and salt
|
|
8
|
+
*
|
|
9
|
+
* @param hashedPassword - hashed password for cache lookup
|
|
10
|
+
* @param salt - provide salt to receive cached key
|
|
11
|
+
* @returns cached key
|
|
12
|
+
*/
|
|
13
|
+
export declare function getCachedKeyBySalt(hashedPassword: string, salt: Uint8Array): CachedEntry | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Gets any cached key for a given hashed password
|
|
16
|
+
*
|
|
17
|
+
* @param hashedPassword - hashed password for cache lookup
|
|
18
|
+
* @returns any (the first) cached key
|
|
19
|
+
*/
|
|
20
|
+
export declare function getAnyCachedKey(hashedPassword: string): CachedEntry | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Sets a key to the in memory cache.
|
|
23
|
+
* We have set an arbitrary size of 10 cached keys per hashed password.
|
|
24
|
+
*
|
|
25
|
+
* @param hashedPassword - hashed password for cache lookup
|
|
26
|
+
* @param salt - salt to set new derived key
|
|
27
|
+
* @param key - derived key we are setting
|
|
28
|
+
*/
|
|
29
|
+
export declare function setCachedKey(hashedPassword: string, salt: Uint8Array, key: Uint8Array): void;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../../src/controllers/user-storage/encryption/cache.ts"],"names":[],"mappings":"AAEA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,UAAU,CAAC;CACjB,CAAC;AAiBF;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,UAAU,GACf,WAAW,GAAG,SAAS,CAazB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,cAAc,EAAE,MAAM,GACrB,WAAW,GAAG,SAAS,CAmBzB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,UAAU,GACd,IAAI,CAeN"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type EncryptedPayload = {
|
|
2
|
+
v: '1';
|
|
3
|
+
t: 'scrypt';
|
|
4
|
+
d: string;
|
|
5
|
+
o: {
|
|
6
|
+
N: number;
|
|
7
|
+
r: number;
|
|
8
|
+
p: number;
|
|
9
|
+
dkLen: number;
|
|
10
|
+
};
|
|
11
|
+
saltLen: number;
|
|
12
|
+
};
|
|
13
|
+
declare class EncryptorDecryptor {
|
|
14
|
+
#private;
|
|
15
|
+
encryptString(plaintext: string, password: string): string;
|
|
16
|
+
decryptString(encryptedDataStr: string, password: string): string;
|
|
17
|
+
}
|
|
18
|
+
declare const encryption: EncryptorDecryptor;
|
|
19
|
+
export default encryption;
|
|
20
|
+
/**
|
|
21
|
+
* Receive a SHA256 hash from a given string
|
|
22
|
+
* @param data - input
|
|
23
|
+
* @returns sha256 hash
|
|
24
|
+
*/
|
|
25
|
+
export declare function createSHA256Hash(data: string): string;
|
|
26
|
+
//# sourceMappingURL=encryption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../../../../src/controllers/user-storage/encryption/encryption.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,gBAAgB,GAAG;IAE7B,CAAC,EAAE,GAAG,CAAC;IAGP,CAAC,EAAE,QAAQ,CAAC;IAGZ,CAAC,EAAE,MAAM,CAAC;IAGV,CAAC,EAAE;QAED,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAGF,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAeF,cAAM,kBAAkB;;IACtB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAS1D,aAAa,CAAC,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;CAsIlE;AAED,QAAA,MAAM,UAAU,oBAA2B,CAAC;AAC5C,eAAe,UAAU,CAAC;AAE1B;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/controllers/user-storage/encryption/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/controllers/user-storage/encryption/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,cAAe,UAAU,WAEtD,CAAC;AAEF,eAAO,MAAM,iBAAiB,WAAY,MAAM,eAE/C,CAAC;AAEF,eAAO,MAAM,WAAW,cAAe,UAAU,WAGhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The User Storage Endpoint requires a path and an entry name.
|
|
3
|
+
* Developers can provide additional paths by extending this variable below
|
|
4
|
+
*/
|
|
5
|
+
export declare const USER_STORAGE_ENTRIES: {
|
|
6
|
+
notificationSettings: {
|
|
7
|
+
path: string;
|
|
8
|
+
entryName: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type UserStorageEntryKeys = keyof typeof USER_STORAGE_ENTRIES;
|
|
12
|
+
/**
|
|
13
|
+
* Constructs a unique entry path for a user.
|
|
14
|
+
* This can be done due to the uniqueness of the storage key (no users will share the same storage key).
|
|
15
|
+
* The users entry is a unique hash that cannot be reversed.
|
|
16
|
+
*
|
|
17
|
+
* @param entryKey - storage schema entry key
|
|
18
|
+
* @param storageKey - users storage key
|
|
19
|
+
* @returns path to store entry
|
|
20
|
+
*/
|
|
21
|
+
export declare function createEntryPath(entryKey: UserStorageEntryKeys, storageKey: string): string;
|
|
22
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/schema.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;CAKW,CAAC;AAE7C,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,oBAAoB,CAAC;AAErE;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,oBAAoB,EAC9B,UAAU,EAAE,MAAM,GACjB,MAAM,CAQR"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { UserStorageEntryKeys } from './schema';
|
|
2
|
+
export declare const USER_STORAGE_API: string;
|
|
3
|
+
export declare const USER_STORAGE_ENDPOINT: string;
|
|
4
|
+
/**
|
|
5
|
+
* This is the Server Response shape
|
|
6
|
+
*/
|
|
7
|
+
export type GetUserStorageResponse = {
|
|
8
|
+
HashedKey: string;
|
|
9
|
+
Data: string;
|
|
10
|
+
};
|
|
11
|
+
export type UserStorageOptions = {
|
|
12
|
+
bearerToken: string;
|
|
13
|
+
entryKey: UserStorageEntryKeys;
|
|
14
|
+
storageKey: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* User Storage Service - Get Storage Entry.
|
|
18
|
+
*
|
|
19
|
+
* @param opts - User Storage Options
|
|
20
|
+
* @returns The storage entry, or null if fails to find entry
|
|
21
|
+
*/
|
|
22
|
+
export declare function getUserStorage(opts: UserStorageOptions): Promise<string | null>;
|
|
23
|
+
/**
|
|
24
|
+
* User Storage Service - Set Storage Entry.
|
|
25
|
+
*
|
|
26
|
+
* @param data - data to store
|
|
27
|
+
* @param opts - storage options
|
|
28
|
+
*/
|
|
29
|
+
export declare function upsertUserStorage(data: string, opts: UserStorageOptions): Promise<void>;
|
|
30
|
+
//# sourceMappingURL=services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/services.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAKrD,eAAO,MAAM,gBAAgB,EAAE,MAAmC,CAAC;AACnE,eAAO,MAAM,qBAAqB,QAA2C,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IAEnC,SAAS,EAAE,MAAM,CAAC;IAElB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAuCxB;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,wBAAwB,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAC"}
|
|
@@ -22,6 +22,7 @@ export declare const MOCK_OIDC_TOKEN_RESPONSE: {
|
|
|
22
22
|
};
|
|
23
23
|
export declare const handleMockNonce: (mockReply?: MockReply) => nock.Scope;
|
|
24
24
|
export declare const handleMockSiweLogin: (mockReply?: MockReply) => nock.Scope;
|
|
25
|
+
export declare const handleMockPairIdentifiers: (mockReply?: MockReply) => nock.Scope;
|
|
25
26
|
export declare const handleMockSrpLogin: (mockReply?: MockReply) => nock.Scope;
|
|
26
27
|
export declare const handleMockOAuth2Token: (mockReply?: MockReply) => nock.Scope;
|
|
27
28
|
export declare const arrangeAuthAPIs: (options?: {
|
|
@@ -29,11 +30,13 @@ export declare const arrangeAuthAPIs: (options?: {
|
|
|
29
30
|
mockOAuth2TokenUrl?: MockReply;
|
|
30
31
|
mockSrpLoginUrl?: MockReply;
|
|
31
32
|
mockSiweLoginUrl?: MockReply;
|
|
33
|
+
mockPairIdentifiers?: MockReply;
|
|
32
34
|
}) => {
|
|
33
35
|
mockNonceUrl: nock.Scope;
|
|
34
36
|
mockOAuth2TokenUrl: nock.Scope;
|
|
35
37
|
mockSrpLoginUrl: nock.Scope;
|
|
36
38
|
mockSiweLoginUrl: nock.Scope;
|
|
39
|
+
mockPairIdentifiersUrl: nock.Scope;
|
|
37
40
|
};
|
|
38
41
|
export {};
|
|
39
42
|
//# sourceMappingURL=mock-auth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-auth.d.ts","sourceRoot":"","sources":["../../../../src/sdk/__fixtures__/mock-auth.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"mock-auth.d.ts","sourceRoot":"","sources":["../../../../src/sdk/__fixtures__/mock-auth.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAWxB,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;CAClB,CAAC;AAQF,eAAO,MAAM,QAAQ,upBACioB,CAAC;AAEvpB,eAAO,MAAM,eAAe,gKACmI,CAAC;AAmChK,eAAO,MAAM,uBAAuB;;;;;;;;;;CAuBnC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;CAOpC,CAAC;AAEF,eAAO,MAAM,eAAe,eAAgB,SAAS,eAUpD,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAAgB,SAAS,eAQxD,CAAC;AAEF,eAAO,MAAM,yBAAyB,eAAgB,SAAS,eAQ9D,CAAC;AAEF,eAAO,MAAM,kBAAkB,eAAgB,SAAS,eAQvD,CAAC;AAEF,eAAO,MAAM,qBAAqB,eAAgB,SAAS,eAQ1D,CAAC;AAEF,eAAO,MAAM,eAAe,aAAc;IACxC,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,mBAAmB,CAAC,EAAE,SAAS,CAAC;CACjC;;;;;;CAgBA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-userstorage.d.ts","sourceRoot":"","sources":["../../../../src/sdk/__fixtures__/mock-userstorage.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAMxB,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;CAClB,CAAC;AAKF,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"mock-userstorage.d.ts","sourceRoot":"","sources":["../../../../src/sdk/__fixtures__/mock-userstorage.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAMxB,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;CAClB,CAAC;AAKF,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAGnD,eAAO,MAAM,uBAAuB;;CAAwB,CAAC;AAC7D,eAAO,MAAM,iCAAiC,QAG7C,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;CAGjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,SAAS,eAQ7D,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,SAAS,eAQ7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../../src/sdk/__fixtures__/test-utils.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EACV,kBAAkB,EAEnB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAK9D,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../../src/sdk/__fixtures__/test-utils.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EACV,kBAAkB,EAEnB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAK9D,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC;AAK/B,eAAO,MAAM,WAAW,wBAAyB,GAAG,EAAE,KAAK,GAAG,gDACnB,CAAC;AAqB5C;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,GAAG,QAAQ,EAAE,EACnB,aAAa,EAAE,MAAM,EACrB,mBAAmB,CAAC,EAAE;IACpB,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;;;;;;EAqDF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-siwe.d.ts","sourceRoot":"","sources":["../../../../src/sdk/authentication-jwt-bearer/flow-siwe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow-siwe.d.ts","sourceRoot":"","sources":["../../../../src/sdk/authentication-jwt-bearer/flow-siwe.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,QAAQ,EACR,SAAS,EAET,WAAW,EACZ,MAAM,SAAS,CAAC;AAIjB,KAAK,0BAA0B,GAAG;IAChC,OAAO,EAAE,kBAAkB,CAAC;CAC7B,CAAC;AAIF,KAAK,yBAAyB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,qBAAa,iBAAkB,YAAW,SAAS;;gBAQ/C,MAAM,EAAE,UAAU,GAAG;QAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAA;KAAE,EAC5C,OAAO,EAAE,0BAA0B;IAM/B,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IAUjC,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;IAUtC,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAKhC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKnD,OAAO,CAAC,MAAM,EAAE,yBAAyB;CA6E1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-srp.d.ts","sourceRoot":"","sources":["../../../../src/sdk/authentication-jwt-bearer/flow-srp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow-srp.d.ts","sourceRoot":"","sources":["../../../../src/sdk/authentication-jwt-bearer/flow-srp.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,QAAQ,EACR,SAAS,EAET,WAAW,EACZ,MAAM,SAAS,CAAC;AAIjB,KAAK,yBAAyB,GAAG;IAC/B,OAAO,EAAE,kBAAkB,CAAC;IAC5B,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B,CAAC;AAuBF,qBAAa,gBAAiB,YAAW,SAAS;;gBAM9C,MAAM,EAAE,UAAU,GAAG;QAAE,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAA;KAAE,EAC3C,OAAO,EAAE,yBAAyB;IAS9B,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IAUjC,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;IAUtC,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAIhC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAgEpD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { Env } from '../env';
|
|
1
|
+
import type { Env, Platform } from '../env';
|
|
2
2
|
import type { AccessToken, UserProfile } from './types';
|
|
3
3
|
import { AuthType } from './types';
|
|
4
4
|
export declare const NONCE_URL: (env: Env) => string;
|
|
5
|
+
export declare const PAIR_IDENTIFIERS: (env: Env) => string;
|
|
5
6
|
export declare const OIDC_TOKEN_URL: (env: Env) => string;
|
|
6
7
|
export declare const SRP_LOGIN_URL: (env: Env) => string;
|
|
7
8
|
export declare const SIWE_LOGIN_URL: (env: Env) => string;
|
|
@@ -10,6 +11,22 @@ type NonceResponse = {
|
|
|
10
11
|
identifier: string;
|
|
11
12
|
expiresIn: number;
|
|
12
13
|
};
|
|
14
|
+
type PairRequest = {
|
|
15
|
+
signature: string;
|
|
16
|
+
raw_message: string;
|
|
17
|
+
encrypted_storage_key: string;
|
|
18
|
+
identifier_type: 'SIWE' | 'SRP';
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Pair multiple identifiers under a single profile
|
|
22
|
+
*
|
|
23
|
+
* @param nonce - session nonce
|
|
24
|
+
* @param logins - pairing request payload
|
|
25
|
+
* @param accessToken - JWT access token used to access protected resources
|
|
26
|
+
* @param env - server environment
|
|
27
|
+
* @returns void.
|
|
28
|
+
*/
|
|
29
|
+
export declare function pairIdentifiers(nonce: string, logins: PairRequest[], accessToken: string, env: Env): Promise<void>;
|
|
13
30
|
/**
|
|
14
31
|
* Service to Get Nonce for JWT Bearer Flow
|
|
15
32
|
*
|
|
@@ -23,9 +40,10 @@ export declare function getNonce(id: string, env: Env): Promise<NonceResponse>;
|
|
|
23
40
|
*
|
|
24
41
|
* @param jwtToken - The original token received from Authentication. This is traded for the Access Token. (the authentication token is single-use)
|
|
25
42
|
* @param env - server environment
|
|
43
|
+
* @param platform - SDK platform
|
|
26
44
|
* @returns Access Token from Authorization server
|
|
27
45
|
*/
|
|
28
|
-
export declare function authorizeOIDC(jwtToken: string, env: Env): Promise<AccessToken>;
|
|
46
|
+
export declare function authorizeOIDC(jwtToken: string, env: Env, platform: Platform): Promise<AccessToken>;
|
|
29
47
|
type Authentication = {
|
|
30
48
|
token: string;
|
|
31
49
|
expiresIn: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/sdk/authentication-jwt-bearer/services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/sdk/authentication-jwt-bearer/services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAQ5C,OAAO,KAAK,EAAE,WAAW,EAAgB,WAAW,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,eAAO,MAAM,SAAS,QAAS,GAAG,WACY,CAAC;AAE/C,eAAO,MAAM,gBAAgB,QAAS,GAAG,WACgB,CAAC;AAE1D,eAAO,MAAM,cAAc,QAAS,GAAG,WACO,CAAC;AAE/C,eAAO,MAAM,aAAa,QAAS,GAAG,WACY,CAAC;AAEnD,eAAO,MAAM,cAAc,QAAS,GAAG,WACY,CAAC;AAgBpD,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,EAAE,MAAM,CAAC;IAGpB,qBAAqB,EAAE,MAAM,CAAC;IAG9B,eAAe,EAAE,MAAM,GAAG,KAAK,CAAC;CACjC,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,WAAW,EAAE,EACrB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,GAAG,GACP,OAAO,CAAC,IAAI,CAAC,CA4Bf;AAED;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,CAyB3E;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,WAAW,CAAC,CA0CtB;AAED,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AACF;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,GACP,OAAO,CAAC,cAAc,CAAC,CAwCzB"}
|