Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ helm/*/Chart.lock
helm/*/charts/

.DS_Store
coverage/
build/
127 changes: 70 additions & 57 deletions esignet-service/data/flows/flow-esignet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,49 @@ prompt_password: &prompt_password
required: true
resourceType: ELEMENT

# Anchor for Captcha component
captcha_box: &captcha_box
id: CAPTCHA_BOX
ref: captcha
type: CUSTOM
category: MISCELLANEOUS
resourceType: ELEMENT
required: true
captcha:
provider: google-recaptcha
siteKey: ${MOSIP_ESIGNET_CAPTCHA_SITE_KEY}
theme: light
size: normal

# Anchor for otp's required inputs
otp_inputs: &otp_inputs
- ref: username_input
identifier: username
type: TEXT_INPUT
required: true
- ref: CAPTCHA_BOX
identifier: captcha
type: CUSTOM
required: true

# Anchor for password's required inputs
password_inputs: &password_inputs
- ref: username_input
identifier: username
type: TEXT_INPUT
required: true
- ref: password_input
identifier: password
type: PASSWORD_INPUT
required: true
- ref: CAPTCHA_BOX
identifier: captcha
type: CUSTOM
required: true

# Anchor for Submit button
# default id is submit_uin, it can be changed
# default label is COntinue, that also can be changed
# default label is Continue, that also can be changed
submit_button: &submit_button
id: submit_uin
label: Continue
Expand Down Expand Up @@ -317,15 +357,12 @@ nodes:
- *page_title_with_back
- *login_id_uin
- *prompt_uin
- *captcha_box
- <<: *submit_button
id: submit_uin
label: Get OTP
prompts:
- inputs:
- ref: username_input
identifier: username
type: TEXT_INPUT
required: true
- inputs: *otp_inputs
action:
ref: submit_uin
nextNode: send_mosip_otp
Expand Down Expand Up @@ -353,15 +390,12 @@ nodes:
- *page_title_with_back
- *login_id_mobile
- *prompt_mobile
- *captcha_box
- <<: *submit_button
id: submit_uin
label: Get OTP
prompts:
- inputs:
- ref: username_input
identifier: username
type: PHONE_INPUT
required: true
- inputs: *otp_inputs
action:
ref: submit_uin
nextNode: send_mosip_otp
Expand Down Expand Up @@ -389,15 +423,12 @@ nodes:
- *page_title_with_back
- *login_id_email
- *prompt_email
- *captcha_box
- <<: *submit_button
id: submit_uin
label: Get OTP
prompts:
- inputs:
- ref: username_input
identifier: username
type: EMAIL_INPUT
required: true
- inputs: *otp_inputs
action:
ref: submit_uin
nextNode: send_mosip_otp
Expand Down Expand Up @@ -425,15 +456,12 @@ nodes:
- *page_title_with_back
- *login_id_nrc
- *prompt_nrc
- *captcha_box
- <<: *submit_button
id: submit_uin
label: Get OTP
prompts:
- inputs:
- ref: username_input
identifier: username
type: TEXT_INPUT
required: true
- inputs: *otp_inputs
action:
ref: submit_uin
nextNode: send_mosip_otp
Expand Down Expand Up @@ -532,19 +560,12 @@ nodes:
- *login_id_uin
- *prompt_uin
- *prompt_password
- *captcha_box
- <<: *submit_button
id: password_authenticate
label: Login
prompts:
- inputs:
- ref: username_input
identifier: username
type: TEXT_INPUT
required: true
- ref: password_input
identifier: password
type: PASSWORD_INPUT
required: true
- inputs: *password_inputs
action:
ref: password_authenticate
nextNode: basic_cred_auth
Expand Down Expand Up @@ -575,19 +596,12 @@ nodes:
- *login_id_mobile
- *prompt_mobile
- *prompt_password
- *captcha_box
- <<: *submit_button
id: password_authenticate
label: Login
prompts:
- inputs:
- ref: username_input
identifier: username
type: TEXT_INPUT
required: true
- ref: password_input
identifier: password
type: PASSWORD_INPUT
required: true
- inputs: *password_inputs
action:
ref: password_authenticate
nextNode: basic_cred_auth
Expand Down Expand Up @@ -618,19 +632,12 @@ nodes:
- *login_id_email
- *prompt_email
- *prompt_password
- *captcha_box
- <<: *submit_button
id: password_authenticate
label: Login
prompts:
- inputs:
- ref: username_input
identifier: username
type: TEXT_INPUT
required: true
- ref: password_input
identifier: password
type: PASSWORD_INPUT
required: true
- inputs: *password_inputs
action:
ref: password_authenticate
nextNode: basic_cred_auth
Expand Down Expand Up @@ -661,19 +668,12 @@ nodes:
- *login_id_nrc
- *prompt_nrc
- *prompt_password
- *captcha_box
- <<: *submit_button
id: password_authenticate
label: Login
prompts:
- inputs:
- ref: username_input
identifier: username
type: TEXT_INPUT
required: true
- ref: password_input
identifier: password
type: PASSWORD_INPUT
required: true
- inputs: *password_inputs
action:
ref: password_authenticate
nextNode: basic_cred_auth
Expand Down Expand Up @@ -703,6 +703,10 @@ nodes:
identifier: password
type: PASSWORD_INPUT
required: true
- ref: CAPTCHA_BOX
identifier: captcha
type: PASSWORD_INPUT
required: true
onSuccess: authorization_check

- id: prompt_uin_bio
Expand Down Expand Up @@ -905,6 +909,7 @@ nodes:
required: true
placeholder: Select your date of birth
dateFormat: "yyyy-MM-dd"
- *captcha_box
- <<: *submit_button
id: submit_kbi_details
label: Login
Expand All @@ -922,6 +927,10 @@ nodes:
identifier: dob
type: DATE_INPUT
required: true
- ref: CAPTCHA_BOX
identifier: captcha
type: CUSTOM
required: true
action:
ref: submit_kbi_details
nextNode: basic_kbi_auth
Expand All @@ -946,6 +955,10 @@ nodes:
identifier: dob
type: PASSWORD_INPUT
required: true
- ref: CAPTCHA_BOX
identifier: captcha
type: PASSWORD_INPUT
required: true
onSuccess: authorization_check

- id: authorization_check
Expand Down
3 changes: 2 additions & 1 deletion esignet-service/internal/engine/flow_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ func (p *flowProvider) parseFlowDefinition() (*providers.CompleteFlowDefinition,
return nil, shared.FileNotFoundError
}
var flowDef providers.CompleteFlowDefinition
err = yaml.Unmarshal(data, &flowDef)
expanded := os.ExpandEnv(string(data))
err = yaml.Unmarshal([]byte(expanded), &flowDef)
Comment thread
anushasunkada marked this conversation as resolved.
if err != nil {
applog.GetLogger().Warn("failed to parse flow definition file", applog.String("flowId", p.cfg.AuthFlowID), applog.Error(err))
return nil, shared.FileUnmarshallError
Expand Down
Loading
Loading