Skip to content

Commit

Permalink
fix: mark push-create-02 as deprecated (#1147)
Browse files Browse the repository at this point in the history
* fix: mark push-create-02 as deprecated

* fix: hook deprecated but still allow calling
  • Loading branch information
Aman035 authored Mar 6, 2024
1 parent 5717b1d commit 46e119e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
14 changes: 0 additions & 14 deletions packages/restapi/src/lib/helpers/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,20 +476,6 @@ export const preparePGPPublicKey = async (
case Constants.ENC_TYPE_V3:
case Constants.ENC_TYPE_V4: {
const verificationProof = 'DEPRECATED';

/**
* @deprecated
* PUSH CHAT PROFILE CREATION DOES NOT SIGN PGP PUBLIC KEY
* VERIFICATION PROOF SIGNATURE SHOULD BE USED FOR VERIFICATION OF PUSH PROFILE KEYS
*/

// const createProfileMessage =
// 'Create Push Profile \n' + generateHash(publicKey);
// const { verificationProof } = await getEip191Signature(
// wallet,
// createProfileMessage
// );

// TODO - Change JSON Structure to string ie equivalent to ENC_TYPE_V1 ( would be done after PUSH Node changes )
chatPublicKey = JSON.stringify({
key: publicKey,
Expand Down
3 changes: 3 additions & 0 deletions packages/restapi/src/lib/progressHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const PROGRESSHOOK: Record<
'This step is only done for first time users and might take a few seconds. PGP keys are getting generated to provide you with secure yet seamless web3 communication',
level: 'INFO',
},
/**
* @deprecated
*/
'PUSH-CREATE-02': {
progressId: 'PUSH-CREATE-02',
progressTitle: 'Signing Generated Profile',
Expand Down
21 changes: 12 additions & 9 deletions packages/restapi/src/lib/user/createUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,23 @@ export type CreateUserProps = {
};
};
progressHook?: (progress: ProgressHookType) => void;
origin? : string | null
origin?: string | null;
};

interface ICreateUser extends IUser {
decryptedPrivateKey?: string;
}

export const create = async (
options: CreateUserProps
): Promise<ICreateUser> => {
return await createUserCore(options, PGPHelper);
};

export const create = async (options:CreateUserProps):Promise<ICreateUser>=>{
return await createUserCore(options, PGPHelper)
}

export const createUserCore = async ( options: CreateUserProps,
pgpHelper: IPGPHelper): Promise<ICreateUser> => {
export const createUserCore = async (
options: CreateUserProps,
pgpHelper: IPGPHelper
): Promise<ICreateUser> => {
const passPrefix = '$0Pc'; //password prefix to ensure password validation
const {
env = Constants.ENV.PROD,
Expand All @@ -62,7 +65,7 @@ export const createUserCore = async ( options: CreateUserProps,
},
},
progressHook,
origin
origin,
} = options || {};

try {
Expand Down Expand Up @@ -129,7 +132,7 @@ export const createUserCore = async ( options: CreateUserProps,
publicKey: publicKey,
encryptedPrivateKey: JSON.stringify(encryptedPrivateKey),
env,
origin: origin
origin: origin,
};
const createdUser: ICreateUser = await createUserService(body);

Expand Down

0 comments on commit 46e119e

Please sign in to comment.