-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #305 from logion-network/feature/recoverable-secrets
Add recoverable secrets
- Loading branch information
Showing
32 changed files
with
891 additions
and
456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
| logion notification - Recoverable secret added | ||
| Dear #{walletUser.firstName} #{walletUser.lastName}, | ||
| | ||
| You receive this message because you just added a recoverable secret with name #{secretName} to your Identity LOC #{loc.id}. | ||
| | ||
| Please note, you can't answer this email. The logion network will never ask you to provide any kind of information or access to a web address through its email notifications. | ||
| | ||
| As a reminder, find below all details of the Legal Officer you'll have to contact in order to recover the secret's value: | ||
| | ||
include /legal-officer-details.pug | ||
| | ||
include /footer.pug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class AddSecrets1715669632901 implements MigrationInterface { | ||
name = 'AddSecrets1715669632901' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`CREATE TABLE "loc_secret" ("request_id" uuid NOT NULL, "name" character varying(255) NOT NULL, "value" character varying(4096) NOT NULL, CONSTRAINT "UQ_loc_secret_request_id_name" UNIQUE ("request_id", "name"), CONSTRAINT "PK_loc_secret" PRIMARY KEY ("request_id", "name"))`); | ||
await queryRunner.query(`ALTER TABLE "loc_secret" ADD CONSTRAINT "FK_loc_secret_request_id" FOREIGN KEY ("request_id") REFERENCES "loc_request"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "loc_secret" DROP CONSTRAINT "FK_loc_secret_request_id"`); | ||
await queryRunner.query(`DROP TABLE "loc_secret"`); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Column } from "typeorm"; | ||
|
||
import { IdenfyVerificationStatus } from "../services/idenfy/idenfy.types"; | ||
|
||
export type EmbeddableIdenfyVerificationStatus = 'PENDING' | IdenfyVerificationStatus; | ||
|
||
export class EmbeddableIdenfyVerification { | ||
|
||
@Column("varchar", { name: "idenfy_auth_token", length: 40, nullable: true }) | ||
authToken?: string | null; | ||
|
||
@Column("varchar", { name: "idenfy_scan_ref", length: 40, nullable: true }) | ||
scanRef?: string | null; | ||
|
||
@Column("varchar", { name: "idenfy_status", length: 255, nullable: true }) | ||
status?: EmbeddableIdenfyVerificationStatus | null; | ||
|
||
@Column("text", { name: "idenfy_callback_payload", nullable: true }) | ||
callbackPayload?: string | null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Column } from "typeorm"; | ||
|
||
import { AMOUNT_PRECISION } from "./fees.js"; | ||
import { toBigInt } from "../lib/convert.js"; | ||
|
||
export interface LocFees { | ||
readonly valueFee?: bigint; | ||
readonly legalFee?: bigint; | ||
readonly collectionItemFee?: bigint; | ||
readonly tokensRecordFee?: bigint; | ||
} | ||
|
||
export class EmbeddableLocFees { | ||
|
||
@Column("numeric", { name: "value_fee", precision: AMOUNT_PRECISION, nullable: true }) | ||
valueFee?: string | null; | ||
|
||
@Column("numeric", { name: "legal_fee", precision: AMOUNT_PRECISION, nullable: true }) | ||
legalFee?: string | null; | ||
|
||
@Column("numeric", { name: "collection_item_fee", precision: AMOUNT_PRECISION, nullable: true }) | ||
collectionItemFee?: string | null; | ||
|
||
@Column("numeric", { name: "tokens_record_fee", precision: AMOUNT_PRECISION, nullable: true }) | ||
tokensRecordFee?: string | null; | ||
|
||
static from(fees: LocFees | undefined): EmbeddableLocFees | undefined { | ||
if(fees) { | ||
const embeddable = new EmbeddableLocFees(); | ||
embeddable.valueFee = fees.valueFee?.toString(); | ||
embeddable.legalFee = fees.legalFee?.toString(); | ||
embeddable.collectionItemFee = fees.collectionItemFee?.toString(); | ||
embeddable.tokensRecordFee = fees.tokensRecordFee?.toString(); | ||
return embeddable; | ||
} else { | ||
return undefined; | ||
} | ||
} | ||
|
||
to(): LocFees { | ||
return { | ||
valueFee: toBigInt(this.valueFee), | ||
legalFee: toBigInt(this.legalFee), | ||
collectionItemFee: toBigInt(this.collectionItemFee), | ||
tokensRecordFee: toBigInt(this.tokensRecordFee), | ||
} | ||
} | ||
} |
Oops, something went wrong.