Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3371523
D11106.id37445.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D11106.id37445.diff
View Options
diff --git a/lib/types/crypto-types.js b/lib/types/crypto-types.js
--- a/lib/types/crypto-types.js
+++ b/lib/types/crypto-types.js
@@ -21,10 +21,30 @@
},
};
+export type SignedPrekeys = {
+ +contentPrekey: string,
+ +contentPrekeySignature: string,
+ +notifPrekey: string,
+ +notifPrekeySignature: string,
+};
+
+export const signedPrekeysValidator: TInterface<SignedPrekeys> =
+ tShape<SignedPrekeys>({
+ contentPrekey: t.String,
+ contentPrekeySignature: t.String,
+ notifPrekey: t.String,
+ notifPrekeySignature: t.String,
+ });
+
export type OLMOneTimeKeys = {
+curve25519: { +[string]: string },
};
+export type OneTimeKeysResult = {
+ +contentOneTimeKeys: OLMOneTimeKeys,
+ +notificationsOneTimeKeys: OLMOneTimeKeys,
+};
+
export type PickledOLMAccount = {
+picklingKey: string,
+pickledAccount: string,
diff --git a/lib/types/identity-service-types.js b/lib/types/identity-service-types.js
--- a/lib/types/identity-service-types.js
+++ b/lib/types/identity-service-types.js
@@ -5,6 +5,8 @@
import {
identityKeysBlobValidator,
type IdentityKeysBlob,
+ signedPrekeysValidator,
+ type SignedPrekeys,
} from './crypto-types.js';
import {
type OlmSessionInitializationInfo,
@@ -31,6 +33,20 @@
+oneTimeNotifPrekey: ?string,
};
+// This type should not be altered without also updating
+// InboundKeyInfoResponse in native/native_rust_library/src/lib.rs
+export type InboundKeyInfoResponse = {
+ +payload: string,
+ +payloadSignature: string,
+ +socialProof?: ?string,
+ +contentPrekey: string,
+ +contentPrekeySignature: string,
+ +notifPrekey: string,
+ +notifPrekeySignature: string,
+ +username?: ?string,
+ +walletAddress?: ?string,
+};
+
export type DeviceOlmOutboundKeys = {
+identityKeysBlob: IdentityKeysBlob,
+contentInitializationInfo: OlmSessionInitializationInfo,
@@ -52,6 +68,33 @@
+keys: ?DeviceOlmOutboundKeys,
};
+export type DeviceOlmInboundKeys = {
+ +identityKeysBlob: IdentityKeysBlob,
+ +signedPrekeys: SignedPrekeys,
+ +payloadSignature: string,
+};
+export const deviceOlmInboundKeysValidator: TInterface<DeviceOlmInboundKeys> =
+ tShape<DeviceOlmInboundKeys>({
+ identityKeysBlob: identityKeysBlobValidator,
+ signedPrekeys: signedPrekeysValidator,
+ payloadSignature: t.String,
+ });
+
+export type UserDevicesOlmInboundKeys = {
+ +keys: {
+ +[deviceID: string]: ?DeviceOlmInboundKeys,
+ },
+ +username?: ?string,
+ +walletAddress?: ?string,
+};
+
+export const userDeviceOlmInboundKeysValidator: TInterface<UserDevicesOlmInboundKeys> =
+ tShape<UserDevicesOlmInboundKeys>({
+ keys: t.dict(t.String, t.maybe(deviceOlmInboundKeysValidator)),
+ username: t.maybe(t.String),
+ walletAddress: t.maybe(t.String),
+ });
+
export interface IdentityServiceClient {
+deleteUser: () => Promise<void>;
+getKeyserverKeys: string => Promise<DeviceOlmOutboundKeys>;
@@ -85,20 +128,6 @@
+commServicesAccessToken: string,
};
-// This type should not be altered without also updating
-// InboundKeyInfoResponse in native/native_rust_library/src/lib.rs
-export type InboundKeyInfoResponse = {
- +payload: string,
- +payloadSignature: string,
- +socialProof?: ?string,
- +contentPrekey: string,
- +contentPrekeySignature: string,
- +notifPrekey: string,
- +notifPrekeySignature: string,
- +username?: ?string,
- +walletAddress?: ?string,
-};
-
export type IdentityAuthResult = {
+userID: string,
+accessToken: string,
diff --git a/native/schema/CommCoreModuleSchema.js b/native/schema/CommCoreModuleSchema.js
--- a/native/schema/CommCoreModuleSchema.js
+++ b/native/schema/CommCoreModuleSchema.js
@@ -10,7 +10,7 @@
import type { ClientDBReportStoreOperation } from 'lib/ops/report-store-ops.js';
import type { ClientDBThreadStoreOperation } from 'lib/ops/thread-store-ops.js';
import type { ClientDBUserStoreOperation } from 'lib/ops/user-store-ops';
-import type { OLMOneTimeKeys } from 'lib/types/crypto-types';
+import type { OneTimeKeysResult, SignedPrekeys } from 'lib/types/crypto-types';
import type { ClientDBDraftStoreOperation } from 'lib/types/draft-types.js';
import type { ClientDBMessageInfo } from 'lib/types/message-types.js';
import type { ClientDBStore } from 'lib/types/store-ops-types';
@@ -29,24 +29,12 @@
+signature: string,
};
-type SignedPrekeys = {
- +contentPrekey: string,
- +contentPrekeySignature: string,
- +notifPrekey: string,
- +notifPrekeySignature: string,
-};
-
type CommServicesAuthMetadata = {
+userID?: ?string,
+deviceID?: ?string,
+accessToken?: ?string,
};
-type OneTimeKeysResult = {
- contentOneTimeKeys: OLMOneTimeKeys,
- notificationsOneTimeKeys: OLMOneTimeKeys,
-};
-
interface Spec extends TurboModule {
+getDraft: (key: string) => Promise<string>;
+updateDraft: (key: string, text: string) => Promise<boolean>;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 27, 4:55 AM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2588367
Default Alt Text
D11106.id37445.diff (4 KB)
Attached To
Mode
D11106: [crypto] unify key types and introduce type for Inbound Keys
Attached
Detach File
Event Timeline
Log In to Comment