From 78cf8e7cbb47142f0e68999db35ec5ed0e31c8da Mon Sep 17 00:00:00 2001 From: Abubeker Yasin Date: Wed, 27 May 2026 11:31:44 +0300 Subject: [PATCH] feat: ( fayda ) add the fayda variables --- apps/edr-passenger-api/.env.example | 18 ++++++++++++++---- .../migration.sql | 12 ------------ .../migration.sql | 3 +++ apps/edr-passenger-api/prisma/schema.prisma | 1 + 4 files changed, 18 insertions(+), 16 deletions(-) delete mode 100644 apps/edr-passenger-api/prisma/migrations/20260526110803_add_fayda_login_authcode_and_platform/migration.sql create mode 100644 apps/edr-passenger-api/prisma/migrations/20260527080312_add_platform_and_authcode/migration.sql diff --git a/apps/edr-passenger-api/.env.example b/apps/edr-passenger-api/.env.example index 75d2df681..295d6ab40 100644 --- a/apps/edr-passenger-api/.env.example +++ b/apps/edr-passenger-api/.env.example @@ -88,9 +88,19 @@ IAM_ENABLED=false IAM_API_URL=https://iam.tria-plc.com/api IAM_API_KEY= -# Verifayda 2.0 Configuration (Ethiopian National ID Verification) -VERIFAYDA_ENABLED=false -VERIFAYDA_API_URL=https://api.verifayda.gov.et/v2 -VERIFAYDA_API_KEY= +# --- VeriFayda 2.0 (eSignet) OIDC integration --- +FAYDA_ENABLED=true +FAYDA_CLIENT_ID= +FAYDA_AUTHORIZATION_ENDPOINT= +FAYDA_TOKEN_ENDPOINT= +FAYDA_USERINFO_ENDPOINT= +# Base64 of the RSA private JWK (JSON). Secret — never commit a real value. +FAYDA_PRIVATE_KEY_BASE64= +FAYDA_REDIRECT_URI= +# Optional (defaults shown) +FAYDA_SCOPE=openid profile email +FAYDA_ACR_VALUES=mosip:idp:acr:generated-code +FAYDA_CLAIMS_LOCALES=en am +FAYDA_SESSION_TTL_MINUTES=10 GITHUB_PACKAGE_TOKEN= \ No newline at end of file diff --git a/apps/edr-passenger-api/prisma/migrations/20260526110803_add_fayda_login_authcode_and_platform/migration.sql b/apps/edr-passenger-api/prisma/migrations/20260526110803_add_fayda_login_authcode_and_platform/migration.sql deleted file mode 100644 index 661ddbe85..000000000 --- a/apps/edr-passenger-api/prisma/migrations/20260526110803_add_fayda_login_authcode_and_platform/migration.sql +++ /dev/null @@ -1,12 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[authCode]` on the table `FaydaVerificationSession` will be added. If there are existing duplicate values, this will fail. - -*/ --- AlterTable -ALTER TABLE "FaydaVerificationSession" ADD COLUMN "authCode" TEXT, -ADD COLUMN "platform" TEXT NOT NULL DEFAULT 'WEB'; - --- CreateIndex -CREATE UNIQUE INDEX "FaydaVerificationSession_authCode_key" ON "FaydaVerificationSession"("authCode"); diff --git a/apps/edr-passenger-api/prisma/migrations/20260527080312_add_platform_and_authcode/migration.sql b/apps/edr-passenger-api/prisma/migrations/20260527080312_add_platform_and_authcode/migration.sql new file mode 100644 index 000000000..64c577ff5 --- /dev/null +++ b/apps/edr-passenger-api/prisma/migrations/20260527080312_add_platform_and_authcode/migration.sql @@ -0,0 +1,3 @@ +-- AlterTable +ALTER TABLE "FaydaVerificationSession" ADD COLUMN "authCode" TEXT, +ADD COLUMN "platform" TEXT NOT NULL DEFAULT 'WEB'; diff --git a/apps/edr-passenger-api/prisma/schema.prisma b/apps/edr-passenger-api/prisma/schema.prisma index 24ff8a192..e0a9f80e5 100644 --- a/apps/edr-passenger-api/prisma/schema.prisma +++ b/apps/edr-passenger-api/prisma/schema.prisma @@ -1266,6 +1266,7 @@ model FaydaVerificationSession { status String @default("PENDING") errorCode String? errorDescription String? + authCode String? createdAt DateTime @default(now()) expiresAt DateTime completedAt DateTime?