@oxyhq/services 5.16.35 → 5.16.37
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/README.md +8 -26
- package/lib/commonjs/core/OxyServices.base.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.user.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.utility.js.map +1 -1
- package/lib/commonjs/crypto/README.md +142 -0
- package/lib/commonjs/crypto/core.js +147 -0
- package/lib/commonjs/crypto/core.js.map +1 -0
- package/lib/commonjs/crypto/index.js +16 -0
- package/lib/commonjs/crypto/index.js.map +1 -1
- package/lib/commonjs/crypto/keyManager.js +19 -22
- package/lib/commonjs/crypto/keyManager.js.map +1 -1
- package/lib/commonjs/crypto/signatureService.js +116 -28
- package/lib/commonjs/crypto/signatureService.js.map +1 -1
- package/lib/commonjs/index.js +0 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/interfaces.js +10 -11
- package/lib/commonjs/models/interfaces.js.map +1 -1
- package/lib/commonjs/node/index.js +10 -1
- package/lib/commonjs/node/index.js.map +1 -1
- package/lib/commonjs/node/signatureService.js +107 -0
- package/lib/commonjs/node/signatureService.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +23 -0
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +29 -2
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useLanguageManagement.js.map +1 -1
- package/lib/commonjs/ui/hooks/useLanguageManagement.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/index.js +0 -2
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +11 -2
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/module/core/OxyServices.base.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.user.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.utility.js.map +1 -1
- package/lib/module/crypto/README.md +142 -0
- package/lib/module/crypto/core.js +133 -0
- package/lib/module/crypto/core.js.map +1 -0
- package/lib/module/crypto/index.js +3 -9
- package/lib/module/crypto/index.js.map +1 -1
- package/lib/module/crypto/keyManager.js +19 -22
- package/lib/module/crypto/keyManager.js.map +1 -1
- package/lib/module/crypto/signatureService.js +113 -23
- package/lib/module/crypto/signatureService.js.map +1 -1
- package/lib/module/index.js +0 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/interfaces.js +10 -11
- package/lib/module/models/interfaces.js.map +1 -1
- package/lib/module/node/index.js +3 -0
- package/lib/module/node/index.js.map +1 -1
- package/lib/module/node/signatureService.js +101 -0
- package/lib/module/node/signatureService.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +23 -0
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +29 -2
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/context/hooks/useLanguageManagement.js.map +1 -1
- package/lib/module/ui/hooks/useLanguageManagement.js.map +1 -1
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/index.js +0 -1
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +11 -2
- package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/typescript/core/OxyServices.base.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.analytics.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.assets.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.auth.d.ts +1 -1
- package/lib/typescript/core/mixins/OxyServices.auth.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.developer.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.devices.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.karma.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.language.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.location.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.payment.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.privacy.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.security.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.user.d.ts +1 -2
- package/lib/typescript/core/mixins/OxyServices.user.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.utility.d.ts.map +1 -1
- package/lib/typescript/core/mixins/index.d.ts +13 -13
- package/lib/typescript/core/mixins/index.d.ts.map +1 -1
- package/lib/typescript/core/services/SessionService.d.ts +1 -1
- package/lib/typescript/core/services/SessionService.d.ts.map +1 -1
- package/lib/typescript/crypto/core.d.ts +56 -0
- package/lib/typescript/crypto/core.d.ts.map +1 -0
- package/lib/typescript/crypto/index.d.ts +1 -9
- package/lib/typescript/crypto/index.d.ts.map +1 -1
- package/lib/typescript/crypto/keyManager.d.ts +13 -1
- package/lib/typescript/crypto/keyManager.d.ts.map +1 -1
- package/lib/typescript/crypto/signatureService.d.ts +15 -9
- package/lib/typescript/crypto/signatureService.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +68 -15
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/node/index.d.ts +1 -0
- package/lib/typescript/node/index.d.ts.map +1 -1
- package/lib/typescript/node/signatureService.d.ts +55 -0
- package/lib/typescript/node/signatureService.d.ts.map +1 -0
- package/lib/typescript/ui/context/OxyContext.d.ts +1 -2
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +1 -2
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts +1 -2
- package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts +1 -1
- package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts +1 -1
- package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useLanguageManagement.d.ts +1 -2
- package/lib/typescript/ui/hooks/useLanguageManagement.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSessionManagement.d.ts +1 -2
- package/lib/typescript/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/ui/index.d.ts +1 -1
- package/lib/typescript/ui/index.d.ts.map +1 -1
- package/lib/typescript/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/ui/utils/avatarUtils.d.ts +1 -1
- package/lib/typescript/ui/utils/avatarUtils.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/core/OxyServices.base.ts +1 -2
- package/src/core/mixins/OxyServices.auth.ts +1 -1
- package/src/core/mixins/OxyServices.user.ts +1 -2
- package/src/core/mixins/OxyServices.utility.ts +1 -2
- package/src/core/services/SessionService.ts +1 -1
- package/src/crypto/README.md +142 -0
- package/src/crypto/__tests__/core.test.ts +203 -0
- package/src/crypto/core.ts +142 -0
- package/src/crypto/index.ts +3 -10
- package/src/crypto/keyManager.ts +25 -21
- package/src/crypto/signatureService.ts +137 -36
- package/src/index.ts +2 -3
- package/src/models/interfaces.ts +73 -21
- package/src/node/index.ts +3 -0
- package/src/node/signatureService.ts +126 -0
- package/src/ui/context/OxyContext.tsx +26 -2
- package/src/ui/context/hooks/useAuthOperations.ts +33 -4
- package/src/ui/context/hooks/useLanguageManagement.ts +1 -2
- package/src/ui/hooks/auth/index.ts +2 -0
- package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
- package/src/ui/hooks/mutations/useServicesMutations.ts +1 -1
- package/src/ui/hooks/queries/useAccountQueries.ts +1 -1
- package/src/ui/hooks/useLanguageManagement.ts +1 -2
- package/src/ui/hooks/useSessionManagement.ts +1 -2
- package/src/ui/index.ts +1 -2
- package/src/ui/screens/AccountSettingsScreen.tsx +6 -6
- package/src/ui/screens/AccountSwitcherScreen.tsx +1 -1
- package/src/ui/screens/OxyAuthScreen.tsx +11 -2
- package/src/ui/screens/ProfileScreen.tsx +1 -1
- package/src/ui/stores/authStore.ts +1 -1
- package/src/ui/types/navigation.ts +1 -1
- package/src/ui/utils/avatarUtils.ts +1 -1
- package/lib/commonjs/core/services/AuthService.js +0 -156
- package/lib/commonjs/core/services/AuthService.js.map +0 -1
- package/lib/commonjs/core/services/SessionTransportService.js +0 -64
- package/lib/commonjs/core/services/SessionTransportService.js.map +0 -1
- package/lib/commonjs/core/services/UserService.js +0 -123
- package/lib/commonjs/core/services/UserService.js.map +0 -1
- package/lib/commonjs/core/services/index.js +0 -34
- package/lib/commonjs/core/services/index.js.map +0 -1
- package/lib/commonjs/shared/crypto/messageBuilders.js +0 -79
- package/lib/commonjs/shared/crypto/messageBuilders.js.map +0 -1
- package/lib/commonjs/shared/crypto/platform.js +0 -118
- package/lib/commonjs/shared/crypto/platform.js.map +0 -1
- package/lib/commonjs/shared/crypto/signature.js +0 -191
- package/lib/commonjs/shared/crypto/signature.js.map +0 -1
- package/lib/commonjs/shared/index.js +0 -94
- package/lib/commonjs/shared/index.js.map +0 -1
- package/lib/commonjs/shared/models/index.js +0 -2
- package/lib/commonjs/shared/models/index.js.map +0 -1
- package/lib/commonjs/shared/transport/index.js +0 -260
- package/lib/commonjs/shared/transport/index.js.map +0 -1
- package/lib/commonjs/shared/utils/index.js +0 -82
- package/lib/commonjs/shared/utils/index.js.map +0 -1
- package/lib/module/core/services/AuthService.js +0 -151
- package/lib/module/core/services/AuthService.js.map +0 -1
- package/lib/module/core/services/SessionTransportService.js +0 -59
- package/lib/module/core/services/SessionTransportService.js.map +0 -1
- package/lib/module/core/services/UserService.js +0 -118
- package/lib/module/core/services/UserService.js.map +0 -1
- package/lib/module/core/services/index.js +0 -16
- package/lib/module/core/services/index.js.map +0 -1
- package/lib/module/shared/crypto/messageBuilders.js +0 -70
- package/lib/module/shared/crypto/messageBuilders.js.map +0 -1
- package/lib/module/shared/crypto/platform.js +0 -112
- package/lib/module/shared/crypto/platform.js.map +0 -1
- package/lib/module/shared/crypto/signature.js +0 -186
- package/lib/module/shared/crypto/signature.js.map +0 -1
- package/lib/module/shared/index.js +0 -30
- package/lib/module/shared/index.js.map +0 -1
- package/lib/module/shared/models/index.js +0 -2
- package/lib/module/shared/models/index.js.map +0 -1
- package/lib/module/shared/transport/index.js +0 -254
- package/lib/module/shared/transport/index.js.map +0 -1
- package/lib/module/shared/utils/index.js +0 -74
- package/lib/module/shared/utils/index.js.map +0 -1
- package/lib/typescript/core/services/AuthService.d.ts +0 -50
- package/lib/typescript/core/services/AuthService.d.ts.map +0 -1
- package/lib/typescript/core/services/SessionTransportService.d.ts +0 -31
- package/lib/typescript/core/services/SessionTransportService.d.ts.map +0 -1
- package/lib/typescript/core/services/UserService.d.ts +0 -39
- package/lib/typescript/core/services/UserService.d.ts.map +0 -1
- package/lib/typescript/core/services/index.d.ts +0 -13
- package/lib/typescript/core/services/index.d.ts.map +0 -1
- package/lib/typescript/shared/crypto/messageBuilders.d.ts +0 -38
- package/lib/typescript/shared/crypto/messageBuilders.d.ts.map +0 -1
- package/lib/typescript/shared/crypto/platform.d.ts +0 -54
- package/lib/typescript/shared/crypto/platform.d.ts.map +0 -1
- package/lib/typescript/shared/crypto/signature.d.ts +0 -72
- package/lib/typescript/shared/crypto/signature.d.ts.map +0 -1
- package/lib/typescript/shared/index.d.ts +0 -20
- package/lib/typescript/shared/index.d.ts.map +0 -1
- package/lib/typescript/shared/models/index.d.ts +0 -163
- package/lib/typescript/shared/models/index.d.ts.map +0 -1
- package/lib/typescript/shared/transport/index.d.ts +0 -73
- package/lib/typescript/shared/transport/index.d.ts.map +0 -1
- package/lib/typescript/shared/utils/index.d.ts +0 -28
- package/lib/typescript/shared/utils/index.d.ts.map +0 -1
- package/src/core/services/AuthService.ts +0 -153
- package/src/core/services/SessionTransportService.ts +0 -69
- package/src/core/services/UserService.ts +0 -125
- package/src/core/services/index.ts +0 -14
- package/src/shared/crypto/messageBuilders.ts +0 -89
- package/src/shared/crypto/platform.ts +0 -140
- package/src/shared/crypto/signature.ts +0 -235
- package/src/shared/index.ts +0 -28
- package/src/shared/models/index.ts +0 -173
- package/src/shared/transport/index.ts +0 -349
- package/src/shared/utils/index.ts +0 -73
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OxyContext.d.ts","sourceRoot":"","sources":["../../../../src/ui/context/OxyContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"OxyContext.d.ts","sourceRoot":"","sources":["../../../../src/ui/context/OxyContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,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ED,QAAA,MAAM,UAAU,uCAA8C,CAAC;AAE/D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;CACrC;AAgCD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA6hCzD,CAAC;AAEF,eAAO,MAAM,kBAAkB,mCAAc,CAAC;AAE9C,eAAO,MAAM,MAAM,QAAO,eAMzB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ApiError } from '../../../models/interfaces';
|
|
2
|
-
import type { User } from '../../../shared';
|
|
1
|
+
import type { ApiError, User } from '../../../models/interfaces';
|
|
3
2
|
import type { AuthState } from '../../stores/authStore';
|
|
4
3
|
import type { ClientSession } from '../../../models/session';
|
|
5
4
|
import type { StorageInterface } from '../../utils/storageHelpers';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAuthOperations.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/hooks/useAuthOperations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"useAuthOperations.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/hooks/useAuthOperations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,yBA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../models/interfaces';
|
|
2
|
-
import type { User } from '../../../shared';
|
|
1
|
+
import type { ApiError, User } from '../../../models/interfaces';
|
|
3
2
|
import { type LanguageMetadata } from '../../../utils/languageUtils';
|
|
4
3
|
import type { StorageInterface } from '../../utils/storageHelpers';
|
|
5
4
|
export interface UseLanguageManagementOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLanguageManagement.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/hooks/useLanguageManagement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"useLanguageManagement.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/hooks/useLanguageManagement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,uBAAuB,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAID;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,4CAKnC,4BAA4B,KAAG,2BA4GjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAOvD;;GAEG;AACH,eAAO,MAAM,gBAAgB;;EAgH5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;SAKQ,MAAM;WAAS,MAAM;WAAS,MAAM;WAAS,MAAM;;;EA2GtF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB;;EA2CpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB;cAKoB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;aAAW,MAAM;;;;cAmI5F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;UAUd,IAAI;iBACG,SAAS,GAAG,QAAQ,GAAG,UAAU;eACnC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;iBACjB,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI;WAoD5C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc;;0BAa1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB;;0BAa7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccountQueries.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/queries/useAccountQueries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useAccountQueries.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/queries/useAccountQueries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAKvD;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,GAAG,IAAI,EAAE,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,gEAevF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,YAAY,MAAM,EAAE,EAAE,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,yEAepF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,gEAe7D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,GAAG,IAAI,EAAE,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,gEAejF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,GAAG,IAAI,EAAE,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,gEAezF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,YAAY,MAAM,EAAE,EAAE,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE;;;WAevF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,EAAE,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,+DAkElF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,iGAY9D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,oGAYjE,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ApiError } from '../../models/interfaces';
|
|
2
|
-
import type { User } from '../../shared';
|
|
1
|
+
import type { ApiError, User } from '../../models/interfaces';
|
|
3
2
|
import { type LanguageMetadata } from '../../utils/languageUtils';
|
|
4
3
|
import type { StorageInterface } from '../utils/storageHelpers';
|
|
5
4
|
export interface UseLanguageManagementOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLanguageManagement.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useLanguageManagement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"useLanguageManagement.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useLanguageManagement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,uBAAuB,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAID;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,4CAKnC,4BAA4B,KAAG,2BA4GjC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ApiError } from '../../models/interfaces';
|
|
2
|
-
import type { User } from '../../shared';
|
|
1
|
+
import type { ApiError, User } from '../../models/interfaces';
|
|
3
2
|
import type { ClientSession } from '../../models/session';
|
|
4
3
|
import { getStorageKeys, type StorageInterface } from '../utils/storageHelpers';
|
|
5
4
|
import type { OxyServices } from '../../core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSessionManagement.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useSessionManagement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"useSessionManagement.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useSessionManagement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;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,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,WAAW,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC/C,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAKD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,+KAalC,2BAA2B,KAAG,0BAiVhC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare let OxyProvider: any, OxySignInButton: any, OxyLogo: any, Avatar: any, FollowButton: any, OxyPayButton: any, FontLoader: any, setupFonts: any, OxyIcon: any, useOxy: any, OxyContextProvider: any, OxyContextState: any, OxyContextProviderProps: any, useFollow: any, ProfileScreen: any, useAuthStore: any, useAccountStore: any, fontFamilies: any, fontStyles: any, toast: any;
|
|
2
2
|
export { OxyProvider, OxySignInButton, OxyLogo, Avatar, FollowButton, OxyPayButton, FontLoader, setupFonts, OxyIcon, useOxy, OxyContextProvider, OxyContextState, OxyContextProviderProps, useFollow, ProfileScreen, useAuthStore, useAccountStore, fontFamilies, fontStyles, toast };
|
|
3
3
|
export { OxyServices } from '../core';
|
|
4
|
-
export type { ApiError } from '../models/interfaces';
|
|
4
|
+
export type { User, LoginResponse, ApiError } from '../models/interfaces';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/index.ts"],"names":[],"mappings":"AASA,QAAA,IAAI,WAAW,KAAA,EAAE,eAAe,KAAA,EAAE,OAAO,KAAA,EAAE,MAAM,KAAA,EAAE,YAAY,KAAA,EAAE,YAAY,KAAA,EAAE,UAAU,KAAA,EAAE,UAAU,KAAA,EAAE,OAAO,KAAA,EAAE,MAAM,KAAA,EAAmH,kBAAkB,KAAA,EAAE,eAAe,KAAA,EAAE,uBAAuB,KAAA,EAAE,SAAS,KA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,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OxyAuthScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/screens/OxyAuthScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"OxyAuthScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/screens/OxyAuthScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AA6B3D,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA2W5C,CAAC;AA2GF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authStore.d.ts","sourceRoot":"","sources":["../../../../src/ui/stores/authStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"authStore.d.ts","sourceRoot":"","sources":["../../../../src/ui/stores/authStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IAEnB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,EAAE,CAAC,WAAW,EAAE;QAAE,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3G,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAG9B,iBAAiB,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,YAAY,wEA0DtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatarUtils.d.ts","sourceRoot":"","sources":["../../../../src/ui/utils/avatarUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"avatarUtils.d.ts","sourceRoot":"","sources":["../../../../src/ui/utils/avatarUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,WAAW,EAAE,WAAW,EACxB,WAAW,GAAE,MAAsB,GAClC,OAAO,CAAC,IAAI,CAAC,CAcf;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,EACtB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,MAAM,GAAG,IAAI,EAC9B,WAAW,EAAE,WAAW,EACxB,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC,CAoEf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "5.16.
|
|
3
|
+
"version": "5.16.37",
|
|
4
4
|
"description": "Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -29,6 +29,11 @@
|
|
|
29
29
|
"require": "./lib/commonjs/core/index.js",
|
|
30
30
|
"types": "./lib/typescript/core/index.d.ts"
|
|
31
31
|
},
|
|
32
|
+
"./node": {
|
|
33
|
+
"import": "./lib/module/node/index.js",
|
|
34
|
+
"require": "./lib/commonjs/node/index.js",
|
|
35
|
+
"types": "./lib/typescript/node/index.d.ts"
|
|
36
|
+
},
|
|
32
37
|
"./ui": {
|
|
33
38
|
"react-native": "./src/ui/index.ts",
|
|
34
39
|
"import": "./lib/module/ui/index.js",
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Contains core infrastructure, HTTP client, request management, and error handling
|
|
5
5
|
*/
|
|
6
|
-
import type { OxyConfig as OxyConfigBase, ApiError } from '../models/interfaces';
|
|
7
|
-
import type { User } from '../shared';
|
|
6
|
+
import type { OxyConfig as OxyConfigBase, ApiError, User } from '../models/interfaces';
|
|
8
7
|
import { handleHttpError } from '../utils/errorUtils';
|
|
9
8
|
import { HttpService, type RequestOptions } from './HttpService';
|
|
10
9
|
import { OxyAuthenticationError, OxyAuthenticationTimeoutError } from './OxyServices.errors';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Public key authentication using ECDSA signatures.
|
|
5
5
|
* No passwords required - authentication is done via challenge-response.
|
|
6
6
|
*/
|
|
7
|
-
import type { User } from '../../
|
|
7
|
+
import type { User } from '../../models/interfaces';
|
|
8
8
|
import type { SessionLoginResponse } from '../../models/session';
|
|
9
9
|
import type { OxyServicesBase } from '../OxyServices.base';
|
|
10
10
|
import { OxyAuthenticationError } from '../OxyServices.errors';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* User Management Methods Mixin
|
|
3
3
|
*/
|
|
4
|
-
import type { Notification } from '../../models/interfaces';
|
|
5
|
-
import type { User, SearchProfilesResponse, PaginationInfo } from '../../shared';
|
|
4
|
+
import type { User, Notification, SearchProfilesResponse, PaginationInfo } from '../../models/interfaces';
|
|
6
5
|
import type { OxyServicesBase } from '../OxyServices.base';
|
|
7
6
|
import { buildSearchParams, buildPaginationParams, type PaginationParams } from '../../utils/apiUtils';
|
|
8
7
|
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* and Express.js authentication middleware
|
|
6
6
|
*/
|
|
7
7
|
import { jwtDecode } from 'jwt-decode';
|
|
8
|
-
import type { ApiError } from '../../models/interfaces';
|
|
9
|
-
import type { User } from '../../shared';
|
|
8
|
+
import type { ApiError, User } from '../../models/interfaces';
|
|
10
9
|
import type { OxyServicesBase } from '../OxyServices.base';
|
|
11
10
|
import { CACHE_TIMES } from './mixinHelpers';
|
|
12
11
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import type { OxyServices } from '../OxyServices';
|
|
15
15
|
import { tokenService } from './TokenService';
|
|
16
16
|
import type { ClientSession, SessionLoginResponse } from '../../models/session';
|
|
17
|
-
import type { User } from '../../
|
|
17
|
+
import type { User } from '../../models/interfaces';
|
|
18
18
|
|
|
19
19
|
export interface Session {
|
|
20
20
|
sessionId: string;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Oxy Crypto Module
|
|
2
|
+
|
|
3
|
+
This module provides cryptographic operations for the Oxy ecosystem, supporting both React Native and Node.js environments.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
The crypto module is organized into several layers:
|
|
8
|
+
|
|
9
|
+
### Core Layer (`core.ts`)
|
|
10
|
+
Platform-agnostic cryptographic functions that work everywhere:
|
|
11
|
+
- Signature verification using elliptic curve cryptography
|
|
12
|
+
- Public/private key validation
|
|
13
|
+
- Message formatting (auth, registration, requests)
|
|
14
|
+
- Utility functions (shortenPublicKey, derivePublicKey, etc.)
|
|
15
|
+
|
|
16
|
+
### Platform-Specific Implementations
|
|
17
|
+
|
|
18
|
+
#### React Native (`signatureService.ts`, `keyManager.ts`)
|
|
19
|
+
- **KeyManager**: Manages ECDSA key pairs with secure storage via Expo SecureStore
|
|
20
|
+
- ⚠️ **For Oxy Accounts app only** - Not intended for third-party apps
|
|
21
|
+
- Handles key generation, import, backup, and secure retrieval
|
|
22
|
+
- Private keys never leave the device
|
|
23
|
+
|
|
24
|
+
- **SignatureService**: Provides async signing and verification
|
|
25
|
+
- Uses `expo-crypto` for hashing in React Native
|
|
26
|
+
- Falls back to Node.js crypto when available
|
|
27
|
+
- Suitable for both React Native and Node.js environments
|
|
28
|
+
|
|
29
|
+
#### Node.js (`node/signatureService.ts`)
|
|
30
|
+
- Optimized synchronous signature operations for backend
|
|
31
|
+
- Uses Node's `crypto` module directly for better performance
|
|
32
|
+
- Exports same API as React Native version for consistency
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
### In React Native / Accounts App
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { KeyManager, SignatureService } from '@oxyhq/services/crypto';
|
|
40
|
+
|
|
41
|
+
// Create identity (Accounts app only)
|
|
42
|
+
const publicKey = await KeyManager.createIdentity();
|
|
43
|
+
|
|
44
|
+
// Sign a challenge
|
|
45
|
+
const signature = await SignatureService.sign(message);
|
|
46
|
+
|
|
47
|
+
// Verify a signature
|
|
48
|
+
const isValid = await SignatureService.verify(message, signature, publicKey);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### In Node.js Backend
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import { SignatureService } from '@oxyhq/services/node';
|
|
55
|
+
|
|
56
|
+
// Generate challenge
|
|
57
|
+
const challenge = SignatureService.generateChallenge();
|
|
58
|
+
|
|
59
|
+
// Verify signature (synchronous)
|
|
60
|
+
const isValid = SignatureService.verifyChallengeResponse(
|
|
61
|
+
publicKey,
|
|
62
|
+
challenge,
|
|
63
|
+
signature,
|
|
64
|
+
timestamp
|
|
65
|
+
);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### In Third-Party Apps (Services SDK)
|
|
69
|
+
|
|
70
|
+
Third-party apps should **not** use KeyManager directly. Instead, use the authentication flows provided by the OxyServices class:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import { OxyServices } from '@oxyhq/services';
|
|
74
|
+
|
|
75
|
+
const oxy = new OxyServices({ baseURL: 'https://api.oxy.so' });
|
|
76
|
+
|
|
77
|
+
// Request authentication (shows QR code / deep link)
|
|
78
|
+
// User approves in Oxy Accounts app
|
|
79
|
+
// Returns session when approved
|
|
80
|
+
const session = await oxy.requestAuth({ appId: 'my-app' });
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Security Considerations
|
|
84
|
+
|
|
85
|
+
### Message Formats
|
|
86
|
+
All signed messages follow specific formats to prevent replay attacks:
|
|
87
|
+
|
|
88
|
+
- **Authentication**: `auth:{publicKey}:{challenge}:{timestamp}`
|
|
89
|
+
- **Registration**: `oxy:register:{publicKey}:{timestamp}`
|
|
90
|
+
- **API Requests**: `request:{publicKey}:{timestamp}:{canonicalData}`
|
|
91
|
+
|
|
92
|
+
Timestamps must be within 5 minutes to be valid.
|
|
93
|
+
|
|
94
|
+
### Key Storage
|
|
95
|
+
- Private keys are stored in device secure storage (iOS Keychain, Android Keystore)
|
|
96
|
+
- Never transmitted or exposed outside the device
|
|
97
|
+
- Only the Oxy Accounts app has access to private keys
|
|
98
|
+
|
|
99
|
+
### Backup Encryption
|
|
100
|
+
⚠️ **Current Implementation**: The backup encryption currently uses a custom XOR scheme with key stretching. This is functional but not optimal.
|
|
101
|
+
|
|
102
|
+
📋 **Planned Improvement**: Migrate to standard AES-256-GCM encryption for better security and interoperability.
|
|
103
|
+
|
|
104
|
+
## Separation of Concerns
|
|
105
|
+
|
|
106
|
+
### Oxy Accounts App
|
|
107
|
+
- Owns and manages the user's private key
|
|
108
|
+
- Handles identity creation, backup, and recovery
|
|
109
|
+
- Signs authentication challenges
|
|
110
|
+
- Uses `KeyManager` and `SignatureService`
|
|
111
|
+
|
|
112
|
+
### Services SDK / Third-Party Apps
|
|
113
|
+
- Does NOT generate or store private keys
|
|
114
|
+
- Displays QR codes and deep links for authentication
|
|
115
|
+
- Polls server for authentication status
|
|
116
|
+
- Uses `OxyServices` class for API communication
|
|
117
|
+
|
|
118
|
+
### API Backend
|
|
119
|
+
- Generates challenges
|
|
120
|
+
- Verifies signatures using public keys
|
|
121
|
+
- Manages sessions and user data
|
|
122
|
+
- Uses `SignatureService` from `@oxyhq/services/node`
|
|
123
|
+
|
|
124
|
+
## Migration from Old Signature Service
|
|
125
|
+
|
|
126
|
+
The API previously had a duplicate `signature.service.ts` file. This has been replaced with a re-export from `@oxyhq/services/node` to ensure consistency and eliminate duplication.
|
|
127
|
+
|
|
128
|
+
If you're maintaining code that imports from the old location, it will continue to work as the file now re-exports from the shared module.
|
|
129
|
+
|
|
130
|
+
## Testing
|
|
131
|
+
|
|
132
|
+
When making changes to crypto code:
|
|
133
|
+
1. Test in both React Native and Node.js environments
|
|
134
|
+
2. Verify signatures created in one environment can be verified in another
|
|
135
|
+
3. Check that timestamps are properly validated
|
|
136
|
+
4. Ensure message formats match exactly between client and server
|
|
137
|
+
|
|
138
|
+
## Further Reading
|
|
139
|
+
|
|
140
|
+
- [Public Key Authentication Guide](../docs/PUBLIC_KEY_AUTHENTICATION.md)
|
|
141
|
+
- [ECDSA on secp256k1](https://en.bitcoin.it/wiki/Secp256k1)
|
|
142
|
+
- [Expo SecureStore Documentation](https://docs.expo.dev/versions/latest/sdk/securestore/)
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for the shared crypto core module
|
|
3
|
+
* These tests verify that signature verification is consistent across platforms
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
verifySignatureCore,
|
|
8
|
+
isValidPublicKey,
|
|
9
|
+
isValidPrivateKey,
|
|
10
|
+
isTimestampFresh,
|
|
11
|
+
buildAuthMessage,
|
|
12
|
+
buildRegistrationMessage,
|
|
13
|
+
buildRequestMessage,
|
|
14
|
+
shortenPublicKey,
|
|
15
|
+
derivePublicKey,
|
|
16
|
+
getEllipticCurve,
|
|
17
|
+
CHALLENGE_TTL_MS,
|
|
18
|
+
MAX_SIGNATURE_AGE_MS,
|
|
19
|
+
} from '../core';
|
|
20
|
+
|
|
21
|
+
describe('Crypto Core Module', () => {
|
|
22
|
+
// Test key pair (for testing only - never use in production)
|
|
23
|
+
const testPrivateKey = '1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef';
|
|
24
|
+
// Public key derived from the private key above
|
|
25
|
+
const testPublicKey = '04bb50e2d89a4ed70663d080659fe0ad4b9bc3e06c17a227433966cb59ceee020decddbf6e00192011648d13b1c00af770c0c1bb609d4d3a5c98a43772e0e18ef4';
|
|
26
|
+
|
|
27
|
+
describe('Public/Private Key Validation', () => {
|
|
28
|
+
it('should validate correct public keys', () => {
|
|
29
|
+
expect(isValidPublicKey(testPublicKey)).toBe(true);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should reject invalid public keys', () => {
|
|
33
|
+
expect(isValidPublicKey('invalid')).toBe(false);
|
|
34
|
+
expect(isValidPublicKey('')).toBe(false);
|
|
35
|
+
expect(isValidPublicKey('1234')).toBe(false);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should validate correct private keys', () => {
|
|
39
|
+
expect(isValidPrivateKey(testPrivateKey)).toBe(true);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should reject invalid private keys', () => {
|
|
43
|
+
expect(isValidPrivateKey('invalid')).toBe(false);
|
|
44
|
+
expect(isValidPrivateKey('')).toBe(false);
|
|
45
|
+
expect(isValidPrivateKey('1234')).toBe(false);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('should derive public key from private key', () => {
|
|
49
|
+
const derived = derivePublicKey(testPrivateKey);
|
|
50
|
+
expect(derived).toBe(testPublicKey);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
describe('Utility Functions', () => {
|
|
55
|
+
it('should shorten public keys correctly', () => {
|
|
56
|
+
const shortened = shortenPublicKey(testPublicKey);
|
|
57
|
+
expect(shortened).toBe('04bb50e2...e0e18ef4');
|
|
58
|
+
expect(shortened.length).toBeLessThan(testPublicKey.length);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('should not shorten already short keys', () => {
|
|
62
|
+
const shortKey = '1234567890';
|
|
63
|
+
expect(shortenPublicKey(shortKey)).toBe(shortKey);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
describe('Timestamp Validation', () => {
|
|
68
|
+
it('should accept fresh timestamps', () => {
|
|
69
|
+
const now = Date.now();
|
|
70
|
+
expect(isTimestampFresh(now)).toBe(true);
|
|
71
|
+
expect(isTimestampFresh(now - 1000)).toBe(true); // 1 second ago
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('should reject old timestamps', () => {
|
|
75
|
+
const old = Date.now() - (MAX_SIGNATURE_AGE_MS + 1000);
|
|
76
|
+
expect(isTimestampFresh(old)).toBe(false);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('should respect custom max age', () => {
|
|
80
|
+
const timestamp = Date.now() - 10000; // 10 seconds ago
|
|
81
|
+
expect(isTimestampFresh(timestamp, 5000)).toBe(false); // max 5 seconds
|
|
82
|
+
expect(isTimestampFresh(timestamp, 15000)).toBe(true); // max 15 seconds
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
describe('Message Building', () => {
|
|
87
|
+
it('should build auth messages correctly', () => {
|
|
88
|
+
const publicKey = 'abc123';
|
|
89
|
+
const challenge = 'challenge456';
|
|
90
|
+
const timestamp = 1234567890;
|
|
91
|
+
|
|
92
|
+
const message = buildAuthMessage(publicKey, challenge, timestamp);
|
|
93
|
+
expect(message).toBe('auth:abc123:challenge456:1234567890');
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('should build registration messages correctly', () => {
|
|
97
|
+
const publicKey = 'abc123';
|
|
98
|
+
const timestamp = 1234567890;
|
|
99
|
+
|
|
100
|
+
const message = buildRegistrationMessage(publicKey, timestamp);
|
|
101
|
+
expect(message).toBe('oxy:register:abc123:1234567890');
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('should build request messages with canonical data', () => {
|
|
105
|
+
const publicKey = 'abc123';
|
|
106
|
+
const timestamp = 1234567890;
|
|
107
|
+
const data = {
|
|
108
|
+
username: 'testuser',
|
|
109
|
+
action: 'update',
|
|
110
|
+
id: 42,
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const message = buildRequestMessage(publicKey, timestamp, data);
|
|
114
|
+
|
|
115
|
+
// Keys should be sorted alphabetically
|
|
116
|
+
expect(message).toContain('action:"update"');
|
|
117
|
+
expect(message).toContain('id:42');
|
|
118
|
+
expect(message).toContain('username:"testuser"');
|
|
119
|
+
expect(message).toContain('request:abc123:1234567890:');
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('should produce consistent canonical strings', () => {
|
|
123
|
+
const publicKey = 'key';
|
|
124
|
+
const timestamp = 1000;
|
|
125
|
+
|
|
126
|
+
// Same data, different order
|
|
127
|
+
const data1 = { b: 2, a: 1, c: 3 };
|
|
128
|
+
const data2 = { c: 3, a: 1, b: 2 };
|
|
129
|
+
|
|
130
|
+
const message1 = buildRequestMessage(publicKey, timestamp, data1);
|
|
131
|
+
const message2 = buildRequestMessage(publicKey, timestamp, data2);
|
|
132
|
+
|
|
133
|
+
expect(message1).toBe(message2);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
describe('Signature Verification Core', () => {
|
|
138
|
+
it('should verify valid signatures', () => {
|
|
139
|
+
const ec = getEllipticCurve();
|
|
140
|
+
const keyPair = ec.keyFromPrivate(testPrivateKey);
|
|
141
|
+
|
|
142
|
+
// Create a test message hash
|
|
143
|
+
const messageHash = 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890';
|
|
144
|
+
|
|
145
|
+
// Sign it
|
|
146
|
+
const signature = keyPair.sign(messageHash);
|
|
147
|
+
const signatureHex = signature.toDER('hex');
|
|
148
|
+
|
|
149
|
+
// Verify it
|
|
150
|
+
const isValid = verifySignatureCore(messageHash, signatureHex, testPublicKey);
|
|
151
|
+
expect(isValid).toBe(true);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('should reject invalid signatures', () => {
|
|
155
|
+
const messageHash = 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890';
|
|
156
|
+
const invalidSignature = '1234567890abcdef';
|
|
157
|
+
|
|
158
|
+
const isValid = verifySignatureCore(messageHash, invalidSignature, testPublicKey);
|
|
159
|
+
expect(isValid).toBe(false);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it('should reject signatures with wrong public key', () => {
|
|
163
|
+
const ec = getEllipticCurve();
|
|
164
|
+
const keyPair = ec.keyFromPrivate(testPrivateKey);
|
|
165
|
+
|
|
166
|
+
const messageHash = 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890';
|
|
167
|
+
const signature = keyPair.sign(messageHash);
|
|
168
|
+
const signatureHex = signature.toDER('hex');
|
|
169
|
+
|
|
170
|
+
// Use a different public key
|
|
171
|
+
const wrongPublicKey = '04' + 'a'.repeat(128);
|
|
172
|
+
|
|
173
|
+
const isValid = verifySignatureCore(messageHash, signatureHex, wrongPublicKey);
|
|
174
|
+
expect(isValid).toBe(false);
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
describe('Constants', () => {
|
|
179
|
+
it('should export correct TTL constants', () => {
|
|
180
|
+
expect(CHALLENGE_TTL_MS).toBe(5 * 60 * 1000); // 5 minutes
|
|
181
|
+
expect(MAX_SIGNATURE_AGE_MS).toBe(5 * 60 * 1000); // 5 minutes
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
describe('Elliptic Curve', () => {
|
|
186
|
+
it('should provide secp256k1 curve', () => {
|
|
187
|
+
const ec = getEllipticCurve();
|
|
188
|
+
expect(ec).toBeDefined();
|
|
189
|
+
expect(ec.curve.type).toBe('short');
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it('should generate valid key pairs', () => {
|
|
193
|
+
const ec = getEllipticCurve();
|
|
194
|
+
const keyPair = ec.genKeyPair();
|
|
195
|
+
|
|
196
|
+
const privateKey = keyPair.getPrivate('hex');
|
|
197
|
+
const publicKey = keyPair.getPublic('hex');
|
|
198
|
+
|
|
199
|
+
expect(isValidPrivateKey(privateKey)).toBe(true);
|
|
200
|
+
expect(isValidPublicKey(publicKey)).toBe(true);
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
});
|