Skip to content

Commit

Permalink
fix: include more test accounts for sfa in assertions.js
Browse files Browse the repository at this point in the history
  • Loading branch information
tianchi-wang-tw committed Aug 28, 2024
1 parent 733ee0d commit f66b02d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ const oidc = {
{ nric: 'F1612358R', uuid: '45669f5c-e9ac-43c6-bcd2-9c3757f1fa1c' },
{ nric: 'F1612354N', uuid: 'c38ddb2d-9e5d-45c2-bb70-8ccb54fc8320' },
{ nric: 'F1612357U', uuid: 'f904a2b1-4b61-47e2-bdad-e2d606325e20' },
{ nric: 'Y4581892I', uuid: 'acf8edda-bfdf-45fc-b140-a6ec6955d857' },
{ nric: 'Y7654321K', uuid: '9916f054-488e-4894-8299-412e46d89e67' },
{ nric: 'Y1234567P', uuid: '0fdcc18f-840b-4b35-80ee-44094a6cc66f' },
...Object.keys(myinfo.v3.personas).map((nric) => ({
nric,
uuid: myinfo.v3.personas[nric].uuid.value,
Expand Down Expand Up @@ -136,8 +139,16 @@ const oidc = {
accessToken = crypto.randomBytes(15).toString('hex'),
) => {
let sub
const sfa = {
Y4581892I: { fid: 'G730Z-H5P96', coi: 'DE', RP: 'CORPPASS' },
Y7654321K: { fid: '123456789', coi: 'CN', RP: 'IRAS' },
Y1234567P: { fid: 'G730Z-H5P96', coi: 'MY', RP: 'CORPPASS' },
}
if (nric.startsWith('Y')) {
sub = `s=${nric},fid='G730Z-H5P96',coi='DE',u=${uuid}`
const sfaAccount = sfa[nric]
? sfa[nric]
: { fid: 'G730Z-H5P96', coi: 'DE', RP: 'CORPPASS' }
sub = `s=${nric},fid=${sfaAccount.fid},coi=${sfaAccount.coi},u=${uuid}`
} else {
sub = `s=${nric},u=${uuid}`
}
Expand Down

0 comments on commit f66b02d

Please sign in to comment.