@burgan-tech/morph-idm-runtime 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/burgan-tech-morph-idm-runtime-0.0.2.tgz +0 -0
- package/morph-idm/Schemas/{user → person}/person-master-1.0.0.json +1 -1
- package/morph-idm/Schemas/token/token-start-1.0.0.json +6 -19
- package/morph-idm/Schemas/user/user-master-1.0.0.json +46 -1
- package/morph-idm/Schemas/user-login/retry-login-1.0.0.json +39 -0
- package/morph-idm/Tasks/call-device-start-1.0.0.json +1 -1
- package/morph-idm/Tasks/call-device-update-1.0.0.json +1 -1
- package/morph-idm/Tasks/consent/consent-auto-select-script.json +16 -0
- package/morph-idm/Tasks/device/search-device-task.json +22 -0
- package/morph-idm/Tasks/get-device-1.0.0.json +1 -1
- package/morph-idm/Tasks/person/get-person-by-task.json +19 -0
- package/morph-idm/Tasks/person/person-update-direct-transition.json +23 -0
- package/morph-idm/Tasks/token/token-create-jwt.json +0 -1
- package/morph-idm/Tasks/token/token-redeem-trigger.json +22 -0
- package/morph-idm/Tasks/token/user-login-get-as-filterable.json +22 -0
- package/morph-idm/Tasks/user/evaluate-failed-login-script.json +18 -0
- package/morph-idm/Tasks/user/get-phone-from-person-task.json +20 -0
- package/morph-idm/Tasks/user/otp-code-generator.json +15 -0
- package/morph-idm/Tasks/user/send-otp-sms-task.json +26 -0
- package/morph-idm/Tasks/user/send-push-task.json +4 -1
- package/morph-idm/Tasks/user/user-update-password-fail-count.json +24 -0
- package/morph-idm/Tasks/user-login/auth-code-generator.json +17 -0
- package/morph-idm/Tasks/user-login/increment-local-fail-count.json +17 -0
- package/morph-idm/Tasks/user-login/password-verify.json +26 -0
- package/morph-idm/TestCases/test-123/.httpyac.json +15 -0
- package/morph-idm/TestCases/test-123/01-person.http +95 -0
- package/morph-idm/TestCases/test-123/02-user.http +83 -0
- package/morph-idm/TestCases/test-123/03-scope.http +65 -0
- package/morph-idm/TestCases/test-123/04-consent.http +66 -0
- package/morph-idm/TestCases/test-123/05-device.http +86 -0
- package/morph-idm/TestCases/test-123/06-user-login.http +206 -0
- package/morph-idm/TestCases/test-123/README.md +112 -0
- package/morph-idm/TestCases/test-123/cleanup.js +49 -0
- package/morph-idm/TestCases/test-123/cleanup.sh +20 -0
- package/morph-idm/TestCases/test-123/cleanup.sql +45 -0
- package/morph-idm/TestCases/test-123/http-client.env.json +13 -0
- package/morph-idm/TestCases/test-123/run-setup.sh +42 -0
- package/morph-idm/TestCases/test-auto-consent/.httpyac.json +14 -0
- package/morph-idm/TestCases/test-auto-consent/01-person.http +72 -0
- package/morph-idm/TestCases/test-auto-consent/02-user.http +74 -0
- package/morph-idm/TestCases/test-auto-consent/03-scope.http +66 -0
- package/morph-idm/TestCases/test-auto-consent/04-device.http +56 -0
- package/morph-idm/TestCases/test-auto-consent/05-user-login.http +132 -0
- package/morph-idm/TestCases/test-auto-consent/README.md +36 -0
- package/morph-idm/TestCases/test-auto-consent/cleanup.js +47 -0
- package/morph-idm/TestCases/test-auto-consent/run-setup.sh +50 -0
- package/morph-idm/TestCases/test-multiple-consent/.httpyac.json +17 -0
- package/morph-idm/TestCases/test-multiple-consent/01-person.http +103 -0
- package/morph-idm/TestCases/test-multiple-consent/02-user.http +83 -0
- package/morph-idm/TestCases/test-multiple-consent/03-scope-2.http +66 -0
- package/morph-idm/TestCases/test-multiple-consent/03-scope.http +66 -0
- package/morph-idm/TestCases/test-multiple-consent/04-consent-1.http +67 -0
- package/morph-idm/TestCases/test-multiple-consent/04-consent-2.http +66 -0
- package/morph-idm/TestCases/test-multiple-consent/05-device.http +87 -0
- package/morph-idm/TestCases/test-multiple-consent/06-user-login.http +183 -0
- package/morph-idm/TestCases/test-multiple-consent/README.md +37 -0
- package/morph-idm/TestCases/test-multiple-consent/cleanup.js +46 -0
- package/morph-idm/TestCases/test-multiple-consent/cleanup.sh +20 -0
- package/morph-idm/TestCases/test-multiple-consent/run-setup.sh +53 -0
- package/morph-idm/Views/user-login/push-waiting.json +28 -0
- package/morph-idm/Views/user-login/start.json +28 -0
- package/morph-idm/Workflows/client/client-1.0.0.json +1 -1
- package/morph-idm/Workflows/client/execute/client.http +1 -1
- package/morph-idm/Workflows/client/src/PasswordGeneratorMapping.csx +0 -1
- package/morph-idm/Workflows/consent-selection/consent-selection-1.0.0.json +37 -6
- package/morph-idm/Workflows/consent-selection/execute/multi-consent-selection.http +209 -0
- package/morph-idm/Workflows/consent-selection/src/ConsentSelectedMapping.csx +18 -22
- package/morph-idm/Workflows/consent-selection/src/CreateAutoConsentMapping.csx +45 -45
- package/morph-idm/Workflows/consent-selection/src/MultipleConsentsRule.csx +12 -8
- package/morph-idm/Workflows/consent-selection/src/NoConsentEligibleRule.csx +6 -22
- package/morph-idm/Workflows/consent-selection/src/SingleConsentAutoSelectMapping.csx +63 -0
- package/morph-idm/Workflows/consent-selection/src/SingleConsentRule.csx +11 -22
- package/morph-idm/Workflows/device/execute/device-ios.http +0 -6
- package/morph-idm/Workflows/device/execute/search.http +32 -0
- package/morph-idm/Workflows/person/execute/person-123.http +191 -0
- package/morph-idm/Workflows/person/execute/person.http +196 -0
- package/morph-idm/Workflows/{user → person}/person-1.0.0.json +24 -1
- package/morph-idm/Workflows/token/execute/token.http +14 -3
- package/morph-idm/Workflows/token/password-subflow.json +1 -1
- package/morph-idm/Workflows/token/src/AuthCodeRedeemMapping.csx +114 -0
- package/morph-idm/Workflows/token/src/AuthCodeValidationRule.csx +27 -0
- package/morph-idm/Workflows/token/src/CreateRsaJwtMapping.csx +28 -16
- package/morph-idm/Workflows/token/src/StatusSuccessRule.csx +27 -0
- package/morph-idm/Workflows/token/src/TokenCreatedRule.csx +32 -0
- package/morph-idm/Workflows/token/src/UserLoginGetAsFilterableMapping.csx +204 -0
- package/morph-idm/Workflows/token/token-1.0.0.json +109 -41
- package/morph-idm/Workflows/user/execute/create-user-1234567890.http +16 -4
- package/morph-idm/Workflows/user/execute/create-user-migration.http +179 -0
- package/morph-idm/Workflows/user/execute/create-user-person-password.http +78 -32
- package/morph-idm/Workflows/user/src/EvaluateFailedLoginMapping.csx +75 -0
- package/morph-idm/Workflows/user/src/FailCountMaxRule.csx +33 -0
- package/morph-idm/Workflows/user/src/GetPhoneFromPersonMapping.csx +139 -0
- package/morph-idm/Workflows/user/src/HasPasswordsRule.csx +43 -0
- package/morph-idm/Workflows/user/src/OtpSentSuccessRule.csx +46 -0
- package/morph-idm/Workflows/user/src/PasswordGeneratedSuccessRule.csx +73 -0
- package/morph-idm/Workflows/user/src/PhoneFetchedSuccessRule.csx +35 -0
- package/morph-idm/Workflows/user/src/ResetPasswordFailCountMapping.csx +88 -0
- package/morph-idm/Workflows/user/src/SendOtpSmsMapping.csx +356 -0
- package/morph-idm/Workflows/user/src/UserPasswordGeneratorMapping.csx +33 -6
- package/morph-idm/Workflows/user/user-1.0.0.json +365 -5
- package/morph-idm/Workflows/{user → user-login}/execute/user-login.http +155 -32
- package/morph-idm/Workflows/user-login/src/AuthCodeGeneratorMapping.csx +44 -0
- package/morph-idm/Workflows/{user/src/GetClientMapping.csx → user-login/src/ClientGetMapping.csx} +6 -4
- package/morph-idm/Workflows/{user/src/TriggerConsentSelectionAsSubFlowMapping.csx → user-login/src/ConsentSelectionSubFlowMapping.csx} +19 -20
- package/morph-idm/Workflows/user-login/src/DeviceSearchMapping.csx +120 -0
- package/morph-idm/Workflows/{user → user-login}/src/GrantValidationRule.csx +5 -1
- package/morph-idm/Workflows/user-login/src/HasFailCountRule.csx +32 -0
- package/morph-idm/Workflows/user-login/src/MaxRetriesReachedRule.csx +32 -0
- package/morph-idm/Workflows/user-login/src/NoSecurityImageRule.csx +33 -0
- package/morph-idm/Workflows/user-login/src/NoSecurityQuestionRule.csx +65 -0
- package/morph-idm/Workflows/user-login/src/OtpCodeGenerateMapping.csx +37 -0
- package/morph-idm/Workflows/{user/src/SendOtpMapping.csx → user-login/src/OtpSendMapping.csx} +13 -7
- package/morph-idm/Workflows/user-login/src/OtpVerifiedRule.csx +35 -0
- package/morph-idm/Workflows/user-login/src/PasswordFailCountResetMapping.csx +77 -0
- package/morph-idm/Workflows/user-login/src/PasswordFailCountUpdateMapping.csx +80 -0
- package/morph-idm/Workflows/user-login/src/PasswordVerifyMapping.csx +169 -0
- package/morph-idm/Workflows/user-login/src/PersonFetchedRule.csx +32 -0
- package/morph-idm/Workflows/user-login/src/PersonGetMapping.csx +61 -0
- package/morph-idm/Workflows/user-login/src/PersonUpdateMapping.csx +105 -0
- package/morph-idm/Workflows/user-login/src/PersonUpdatedRule.csx +32 -0
- package/morph-idm/Workflows/user-login/src/PushVerifiedRule.csx +31 -0
- package/morph-idm/Workflows/{user/src/GetScopesByUserMapping.csx → user-login/src/ScopesByUserGetMapping.csx} +17 -17
- package/morph-idm/Workflows/user-login/src/TokenGenerationSuccessRule.csx +33 -0
- package/morph-idm/Workflows/{user/src/TriggerTokenWorkflowAsSubFlowMapping.csx → user-login/src/TokenSubFlowMapping.csx} +7 -13
- package/morph-idm/Workflows/user-login/src/UserFoundRule.csx +19 -0
- package/morph-idm/Workflows/{user/src/GetUserMapping.csx → user-login/src/UserGetMapping.csx} +5 -3
- package/morph-idm/Workflows/user-login/src/UserStatusActiveRule.csx +34 -0
- package/morph-idm/Workflows/user-login/src/UserValidHasFailCountRule.csx +39 -0
- package/morph-idm/Workflows/user-login/src/UserValidNoFailCountRule.csx +39 -0
- package/morph-idm/Workflows/user-login/user-login.1.0.0.json +1827 -0
- package/package.json +1 -1
- package/vnext.config.json +3 -3
- package/burgan-tech-morph-idm-runtime-0.0.1.tgz +0 -0
- package/morph-idm/Workflows/user/src/ApproveRule.csx +0 -16
- package/morph-idm/Workflows/user/src/AutoConsentCreatedRule.csx +0 -20
- package/morph-idm/Workflows/user/src/AutoConsentRequiredRule.csx +0 -77
- package/morph-idm/Workflows/user/src/CheckDeviceByUserReferenceMapping.csx +0 -66
- package/morph-idm/Workflows/user/src/ClientValidationFailRule.csx +0 -28
- package/morph-idm/Workflows/user/src/ConsentValidationRule.csx +0 -36
- package/morph-idm/Workflows/user/src/CreateAutoConsentMapping.csx +0 -171
- package/morph-idm/Workflows/user/src/DeviceFoundForLoginRule.csx +0 -32
- package/morph-idm/Workflows/user/src/DeviceNotFoundForLoginRule.csx +0 -31
- package/morph-idm/Workflows/user/src/GetConsentMapping.csx +0 -27
- package/morph-idm/Workflows/user/src/GetDeviceMapping.csx +0 -52
- package/morph-idm/Workflows/user/src/GetScopeMapping.csx +0 -139
- package/morph-idm/Workflows/user/src/GrantValidationFailRule.csx +0 -48
- package/morph-idm/Workflows/user/src/OtpVerifiedRule.csx +0 -31
- package/morph-idm/Workflows/user/src/PushVerifiedRule.csx +0 -31
- package/morph-idm/Workflows/user/src/RejectRule.csx +0 -16
- package/morph-idm/Workflows/user/src/ScopeValidationFailRule.csx +0 -67
- package/morph-idm/Workflows/user/src/ScopeValidationRule.csx +0 -67
- package/morph-idm/Workflows/user/src/SendPushMapping.csx +0 -90
- package/morph-idm/Workflows/user/src/TokenGenerationSuccessRule.csx +0 -28
- package/morph-idm/Workflows/user/src/UserValidationFailRule.csx +0 -36
- package/morph-idm/Workflows/user/src/VerifyOtpMapping.csx +0 -65
- package/morph-idm/Workflows/user/src/VerifyPushMapping.csx +0 -65
- package/morph-idm/Workflows/user/user-login.1.0.0.json +0 -1144
- /package/morph-idm/Workflows/{user → person}/person-cdc-worker.1.0.0.json +0 -0
- /package/morph-idm/Workflows/{user → person}/person-upsert-1.0.0.json +0 -0
- /package/morph-idm/Workflows/scope/execute/{scope-individual.http → scope-individual-1234567890-1234567890.http} +0 -0
- /package/morph-idm/Workflows/{user → user-login}/execute/README-LOGIN.md +0 -0
- /package/morph-idm/Workflows/{user → user-login}/src/ClientValidationRule.csx +0 -0
- /package/morph-idm/Workflows/{user → user-login}/src/ConsentSelectedRule.csx +0 -0
- /package/morph-idm/Workflows/{user → user-login}/src/IsIbWebClientWithDeviceRule.csx +0 -0
- /package/morph-idm/Workflows/{user → user-login}/src/NonIbWebClientWithDeviceRule.csx +0 -0
- /package/morph-idm/Workflows/{user → user-login}/src/OtpSentRule.csx +0 -0
- /package/morph-idm/Workflows/{user → user-login}/src/PushSentRule.csx +0 -0
- /package/morph-idm/Workflows/{user → user-login}/src/ScopeFetchedRule.csx +0 -0
- /package/morph-idm/Workflows/{user → user-login}/src/UserValidationRule.csx +0 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
###############################################################################
|
|
2
|
+
# STEP 2: User 123 - Person 123'e bağlı
|
|
3
|
+
###############################################################################
|
|
4
|
+
|
|
5
|
+
### Start User - Person 123'e bağlı
|
|
6
|
+
# @name createUser
|
|
7
|
+
POST {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user/instances/start?sync=true
|
|
8
|
+
Accept-Language: tr-TR
|
|
9
|
+
X-Request-Id: {{$guid}}
|
|
10
|
+
X-Device-Id: admin-portal
|
|
11
|
+
X-Token-Id: {{$guid}}
|
|
12
|
+
X-Device-Info: Test Suite/1.0
|
|
13
|
+
X-Forwarded-For: 192.168.1.100
|
|
14
|
+
user_reference: test-admin
|
|
15
|
+
Content-Type: application/json
|
|
16
|
+
|
|
17
|
+
{
|
|
18
|
+
"key": "{{userKey}}",
|
|
19
|
+
"tags": ["test", "user", "security-test"],
|
|
20
|
+
"attributes": {
|
|
21
|
+
"person": {
|
|
22
|
+
"key": "{{personKey}}"
|
|
23
|
+
},
|
|
24
|
+
"status": "active",
|
|
25
|
+
"username": "testuser123",
|
|
26
|
+
"password": "$argon2id$v=19$m=65536,t=3,p=4$c29tZXNhbHQ$hashedPassword123",
|
|
27
|
+
"passwords": [
|
|
28
|
+
{
|
|
29
|
+
"type": "Password",
|
|
30
|
+
"source": {
|
|
31
|
+
"password": "$argon2id$v=19$m=65536,t=3,p=4$c29tZXNhbHQ$RdescudvJCsgt3ub+b+dWRWJTmaaJObG",
|
|
32
|
+
"algorithm": "argon2",
|
|
33
|
+
"lastUpdatedDate": "2025-11-26T10:30:00Z"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"loginAttempts": 0,
|
|
38
|
+
"maxLoginAttempts": 5,
|
|
39
|
+
"isLocked": false,
|
|
40
|
+
"mustChangePassword": false,
|
|
41
|
+
"permissions": [
|
|
42
|
+
"login",
|
|
43
|
+
"view-profile"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
### Publish User (draft -> active)
|
|
49
|
+
# @name publishUser
|
|
50
|
+
PATCH {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user/instances/{{userKey}}/transitions/publish?sync=true
|
|
51
|
+
Accept-Language: tr-TR
|
|
52
|
+
X-Request-Id: {{$guid}}
|
|
53
|
+
X-Device-Id: admin-portal
|
|
54
|
+
X-Token-Id: {{$guid}}
|
|
55
|
+
X-Device-Info: Test Suite/1.0
|
|
56
|
+
X-Forwarded-For: 192.168.1.100
|
|
57
|
+
user_reference: test-admin
|
|
58
|
+
Content-Type: application/json
|
|
59
|
+
|
|
60
|
+
{
|
|
61
|
+
"attributes": {
|
|
62
|
+
"publishedBy": "test-admin",
|
|
63
|
+
"publishedAt": "{{$datetime iso8601}}"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
### Get User Data
|
|
68
|
+
# @name getUserData
|
|
69
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user/instances/{{userKey}}/functions/data
|
|
70
|
+
Accept-Language: tr-TR
|
|
71
|
+
X-Request-Id: {{$guid}}
|
|
72
|
+
X-Device-Id: admin-portal
|
|
73
|
+
X-Token-Id: {{$guid}}
|
|
74
|
+
user_reference: test-admin
|
|
75
|
+
|
|
76
|
+
### Get User State
|
|
77
|
+
# @name getUserState
|
|
78
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user/instances/{{userKey}}/functions/state
|
|
79
|
+
Accept-Language: tr-TR
|
|
80
|
+
X-Request-Id: {{$guid}}
|
|
81
|
+
X-Device-Id: admin-portal
|
|
82
|
+
X-Token-Id: {{$guid}}
|
|
83
|
+
user_reference: test-admin
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
###############################################################################
|
|
2
|
+
# STEP 3: Scope - User 123 için IbWeb client scope
|
|
3
|
+
###############################################################################
|
|
4
|
+
|
|
5
|
+
### Start Scope
|
|
6
|
+
# @name createScope
|
|
7
|
+
POST {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/scope/instances/start?sync=true
|
|
8
|
+
Accept-Language: tr-TR
|
|
9
|
+
X-Request-Id: {{$guid}}
|
|
10
|
+
X-Device-Id: admin-portal
|
|
11
|
+
X-Token-Id: {{$guid}}
|
|
12
|
+
X-Device-Info: Test Suite/1.0
|
|
13
|
+
X-Forwarded-For: 192.168.1.100
|
|
14
|
+
user_reference: test-admin
|
|
15
|
+
Content-Type: application/json
|
|
16
|
+
|
|
17
|
+
{
|
|
18
|
+
"key": "{{scopeKey}}",
|
|
19
|
+
"tags": ["test", "scope", "security-test"],
|
|
20
|
+
"attributes": {
|
|
21
|
+
"group": {
|
|
22
|
+
"domain": "morph-idm",
|
|
23
|
+
"workflow": "scope-group",
|
|
24
|
+
"key": "retail-customers"
|
|
25
|
+
},
|
|
26
|
+
"searchKey": "{{userKey}}"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
### Publish Scope (draft -> active)
|
|
31
|
+
# @name publishScope
|
|
32
|
+
PATCH {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/scope/instances/{{scopeKey}}/transitions/publish?sync=true
|
|
33
|
+
Accept-Language: tr-TR
|
|
34
|
+
X-Request-Id: {{$guid}}
|
|
35
|
+
X-Device-Id: admin-portal
|
|
36
|
+
X-Token-Id: {{$guid}}
|
|
37
|
+
X-Device-Info: Test Suite/1.0
|
|
38
|
+
X-Forwarded-For: 192.168.1.100
|
|
39
|
+
user_reference: test-admin
|
|
40
|
+
Content-Type: application/json
|
|
41
|
+
|
|
42
|
+
{
|
|
43
|
+
"attributes": {
|
|
44
|
+
"publishedBy": "test-admin",
|
|
45
|
+
"publishedAt": "{{$datetime iso8601}}"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
### Get Scope Data
|
|
50
|
+
# @name getScopeData
|
|
51
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/scope/instances/{{scopeKey}}/functions/data
|
|
52
|
+
Accept-Language: tr-TR
|
|
53
|
+
X-Request-Id: {{$guid}}
|
|
54
|
+
X-Device-Id: admin-portal
|
|
55
|
+
X-Token-Id: {{$guid}}
|
|
56
|
+
user_reference: test-admin
|
|
57
|
+
|
|
58
|
+
### Get Scope State
|
|
59
|
+
# @name getScopeState
|
|
60
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/scope/instances/{{scopeKey}}/functions/state
|
|
61
|
+
Accept-Language: tr-TR
|
|
62
|
+
X-Request-Id: {{$guid}}
|
|
63
|
+
X-Device-Id: admin-portal
|
|
64
|
+
X-Token-Id: {{$guid}}
|
|
65
|
+
user_reference: test-admin
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
###############################################################################
|
|
2
|
+
# STEP 4: Consent for User 123 + Client IbWeb
|
|
3
|
+
###############################################################################
|
|
4
|
+
|
|
5
|
+
### Create Consent
|
|
6
|
+
# @name createConsent
|
|
7
|
+
POST {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/consent/instances/start?sync=true
|
|
8
|
+
Accept-Language: tr-TR
|
|
9
|
+
X-Request-Id: {{$guid}}
|
|
10
|
+
X-Device-Id: admin-portal
|
|
11
|
+
X-Token-Id: {{$guid}}
|
|
12
|
+
X-Device-Info: Test Suite/1.0
|
|
13
|
+
X-Forwarded-For: 192.168.1.100
|
|
14
|
+
user_reference: test-admin
|
|
15
|
+
Content-Type: application/json
|
|
16
|
+
|
|
17
|
+
{
|
|
18
|
+
"key": "{{consentKey}}",
|
|
19
|
+
"tags": ["test", "consent", "auto-consent"],
|
|
20
|
+
"attributes": {
|
|
21
|
+
"user": {
|
|
22
|
+
"domain": "morph-idm",
|
|
23
|
+
"workflow": "user",
|
|
24
|
+
"key": "{{userKey}}",
|
|
25
|
+
"version": "1.0.0"
|
|
26
|
+
},
|
|
27
|
+
"client": {
|
|
28
|
+
"domain": "morph-idm",
|
|
29
|
+
"workflow": "client",
|
|
30
|
+
"key": "{{clientKey}}",
|
|
31
|
+
"version": "1.0.0"
|
|
32
|
+
},
|
|
33
|
+
"scope": {
|
|
34
|
+
"domain": "morph-idm",
|
|
35
|
+
"workflow": "scope",
|
|
36
|
+
"key": "{{scopeKey}}",
|
|
37
|
+
"version": "1.0.0"
|
|
38
|
+
},
|
|
39
|
+
"roles": [
|
|
40
|
+
{
|
|
41
|
+
"role": "idm.full-authorized",
|
|
42
|
+
"allowance": "allow"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"grantedAt": "{{$datetime iso8601}}",
|
|
46
|
+
"expiresAt": "2027-01-01T00:00:00Z"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
### Get Consent Data
|
|
51
|
+
# @name getConsentData
|
|
52
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/consent/instances/{{consentKey}}/functions/data
|
|
53
|
+
Accept-Language: tr-TR
|
|
54
|
+
X-Request-Id: {{$guid}}
|
|
55
|
+
X-Device-Id: admin-portal
|
|
56
|
+
X-Token-Id: {{$guid}}
|
|
57
|
+
user_reference: test-admin
|
|
58
|
+
|
|
59
|
+
### Get Consent State
|
|
60
|
+
# @name getConsentState
|
|
61
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/consent/instances/{{consentKey}}/functions/state
|
|
62
|
+
Accept-Language: tr-TR
|
|
63
|
+
X-Request-Id: {{$guid}}
|
|
64
|
+
X-Device-Id: admin-portal
|
|
65
|
+
X-Token-Id: {{$guid}}
|
|
66
|
+
user_reference: test-admin
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
###############################################################################
|
|
2
|
+
# STEP 5: Device for User 123 (OPSIYONEL - Push notification için gerekli)
|
|
3
|
+
###############################################################################
|
|
4
|
+
|
|
5
|
+
### Create Device - Web Browser
|
|
6
|
+
# @name createDevice
|
|
7
|
+
POST {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/device/instances/start?sync=true
|
|
8
|
+
Accept-Language: tr-TR
|
|
9
|
+
X-Request-Id: {{$guid}}
|
|
10
|
+
X-Device-Id: {{deviceId}}
|
|
11
|
+
X-Token-Id: {{$guid}}
|
|
12
|
+
X-Device-Info: Test Browser/1.0
|
|
13
|
+
X-Forwarded-For: 192.168.1.100
|
|
14
|
+
user_reference: anonymous
|
|
15
|
+
Content-Type: application/json
|
|
16
|
+
|
|
17
|
+
{
|
|
18
|
+
"key": "{{deviceId}}",
|
|
19
|
+
"tags": ["test", "web", "browser"],
|
|
20
|
+
"attributes": {
|
|
21
|
+
"deviceId": "{{deviceId}}",
|
|
22
|
+
"installationId": "{{$guid}}",
|
|
23
|
+
"deviceInfo": {
|
|
24
|
+
"osName": "Windows",
|
|
25
|
+
"osVersion": "11",
|
|
26
|
+
"deviceModel": "Desktop",
|
|
27
|
+
"manufacturer": "Generic",
|
|
28
|
+
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0",
|
|
29
|
+
"screenResolution": "1920x1080",
|
|
30
|
+
"language": "tr-TR",
|
|
31
|
+
"timezone": "Europe/Istanbul"
|
|
32
|
+
},
|
|
33
|
+
"deviceCertificatePublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Z3VS5JJcds3xfn/ygWy\nR7TZZXe1zE8bF9U3Q2m5yM7qKk0W5X3YZ8vN4V2rK1L8mM3C7H4aP2b6D5F1nE0i\nK9J2Y3L4N5M6O7P8Q9R0S1T2U3V4W5X6Y7Z8A9B0C1D2E3F4G5H6I7J8K9L0M1N2\n-----END PUBLIC KEY-----",
|
|
34
|
+
"appVersion": "3.0.0",
|
|
35
|
+
"pushToken": {
|
|
36
|
+
"platform": "apns",
|
|
37
|
+
"token": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456",
|
|
38
|
+
"environment": "production",
|
|
39
|
+
"bundleId": "com.bank.mobilebanking",
|
|
40
|
+
"updatedAt": "{{$datetime iso8601}}"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
### Assign User to Device (saved -> registered)
|
|
46
|
+
# @name assignUser
|
|
47
|
+
PATCH {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/device/instances/{{deviceId}}/transitions/assign-user?sync=true
|
|
48
|
+
Accept-Language: tr-TR
|
|
49
|
+
X-Request-Id: {{$guid}}
|
|
50
|
+
X-Device-Id: {{deviceId}}
|
|
51
|
+
X-Token-Id: {{$guid}}
|
|
52
|
+
X-Device-Info: Test Browser/1.0
|
|
53
|
+
X-Forwarded-For: 192.168.1.100
|
|
54
|
+
user_reference: {{userKey}}
|
|
55
|
+
Content-Type: application/json
|
|
56
|
+
|
|
57
|
+
{
|
|
58
|
+
"attributes": {
|
|
59
|
+
"user": {
|
|
60
|
+
"domain": "morph-idm",
|
|
61
|
+
"workflow": "user",
|
|
62
|
+
"key": "{{userKey}}",
|
|
63
|
+
"version": "1.0.0"
|
|
64
|
+
},
|
|
65
|
+
"certificates": [],
|
|
66
|
+
"lastSeenAt": "{{$datetime iso8601}}"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
### Get Device Data
|
|
71
|
+
# @name getDeviceData
|
|
72
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/device/instances/{{deviceId}}/functions/data
|
|
73
|
+
Accept-Language: tr-TR
|
|
74
|
+
X-Request-Id: {{$guid}}
|
|
75
|
+
X-Device-Id: {{deviceId}}
|
|
76
|
+
X-Token-Id: {{$guid}}
|
|
77
|
+
user_reference: {{userKey}}
|
|
78
|
+
|
|
79
|
+
### Get Device State
|
|
80
|
+
# @name getDeviceState
|
|
81
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/device/instances/{{deviceId}}/functions/state
|
|
82
|
+
Accept-Language: tr-TR
|
|
83
|
+
X-Request-Id: {{$guid}}
|
|
84
|
+
X-Device-Id: {{deviceId}}
|
|
85
|
+
X-Token-Id: {{$guid}}
|
|
86
|
+
user_reference: {{userKey}}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
###############################################################################
|
|
2
|
+
# STEP 6: User Login - Security Question Empty Test
|
|
3
|
+
###############################################################################
|
|
4
|
+
# Bu test, securityQuestion boş olan Person 123 ile login yapar.
|
|
5
|
+
# Beklenen: security-question-change state'ine yönlendirilmeli
|
|
6
|
+
###############################################################################
|
|
7
|
+
|
|
8
|
+
@loginKey = login-123-{{$timestamp}}
|
|
9
|
+
|
|
10
|
+
### Start Login
|
|
11
|
+
# @name startLogin
|
|
12
|
+
POST {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/start?sync=true
|
|
13
|
+
Accept-Language: tr-TR
|
|
14
|
+
X-Request-Id: {{$guid}}
|
|
15
|
+
X-Device-Id: {{deviceId}}
|
|
16
|
+
X-Token-Id: {{$guid}}
|
|
17
|
+
X-Device-Info: Test Browser/1.0
|
|
18
|
+
X-Forwarded-For: 192.168.1.100
|
|
19
|
+
user_reference: {{userKey}}
|
|
20
|
+
Content-Type: application/json
|
|
21
|
+
|
|
22
|
+
{
|
|
23
|
+
"key": "{{loginKey}}",
|
|
24
|
+
"tags": ["test", "login", "security-question-test"],
|
|
25
|
+
"attributes": {
|
|
26
|
+
"clientId": "{{clientKey}}",
|
|
27
|
+
"grantType": "authorization_code",
|
|
28
|
+
"scopes": ["{{scopeKey}}"],
|
|
29
|
+
"userName": "{{userKey}}",
|
|
30
|
+
"password": "$argon2id$v=19$m=65536,t=3,p=4$c29tZXNhbHQ$RdescudvJCsgt3ub+b+dWRWJTmaaJObG",
|
|
31
|
+
"deviceId": "{{deviceId}}",
|
|
32
|
+
"loginMethod": "password",
|
|
33
|
+
"ipAddress": "192.168.1.100",
|
|
34
|
+
"userAgent": "Test Browser/1.0",
|
|
35
|
+
"loginTimestamp": "{{$datetime iso8601}}"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
### Get Instance ID
|
|
40
|
+
@instanceId = {{startLogin.response.body.id}}
|
|
41
|
+
|
|
42
|
+
### Get Login State - Beklenen: security-question-change
|
|
43
|
+
# @name getLoginState
|
|
44
|
+
# NOT: loginKey yukarıda $timestamp ile oluşturuldu, aynı oturumda çalışır
|
|
45
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{instanceId}}/functions/state
|
|
46
|
+
Accept-Language: tr-TR
|
|
47
|
+
X-Request-Id: {{$guid}}
|
|
48
|
+
X-Device-Id: {{deviceId}}
|
|
49
|
+
X-Token-Id: {{$guid}}
|
|
50
|
+
user_reference: {{userKey}}
|
|
51
|
+
|
|
52
|
+
### Get Login Data
|
|
53
|
+
# @name getLoginData
|
|
54
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{instanceId}}/functions/data
|
|
55
|
+
Accept-Language: tr-TR
|
|
56
|
+
X-Request-Id: {{$guid}}
|
|
57
|
+
X-Device-Id: {{deviceId}}
|
|
58
|
+
X-Token-Id: {{$guid}}
|
|
59
|
+
user_reference: {{userKey}}
|
|
60
|
+
|
|
61
|
+
###############################################################################
|
|
62
|
+
# Security Question Flow
|
|
63
|
+
###############################################################################
|
|
64
|
+
|
|
65
|
+
### Set Security Question - Submit new security question
|
|
66
|
+
# @name setSecurityQuestion
|
|
67
|
+
PATCH {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{instanceId}}/transitions/set-security-question?sync=true
|
|
68
|
+
Accept-Language: tr-TR
|
|
69
|
+
X-Request-Id: {{$guid}}
|
|
70
|
+
X-Device-Id: {{deviceId}}
|
|
71
|
+
X-Token-Id: {{$guid}}
|
|
72
|
+
X-Device-Info: Test Browser/1.0
|
|
73
|
+
X-Forwarded-For: 192.168.1.100
|
|
74
|
+
user_reference: {{userKey}}
|
|
75
|
+
Content-Type: application/json
|
|
76
|
+
|
|
77
|
+
{
|
|
78
|
+
"attributes": {
|
|
79
|
+
"securityQuestion": [
|
|
80
|
+
{
|
|
81
|
+
"question": "İlk evcil hayvanınızın adı nedir?",
|
|
82
|
+
"answer": "$argon2id$v=19$m=65536,t=3,p=4$c29tZXNhbHQ$hashedAnswerHere",
|
|
83
|
+
"algorithm": "argon2",
|
|
84
|
+
"lastUpdatedDate": "{{$datetime iso8601}}"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
### Get State After Security Question
|
|
91
|
+
# @name getStateAfterQuestion
|
|
92
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{instanceId}}/functions/state
|
|
93
|
+
Accept-Language: tr-TR
|
|
94
|
+
X-Request-Id: {{$guid}}
|
|
95
|
+
X-Device-Id: {{deviceId}}
|
|
96
|
+
X-Token-Id: {{$guid}}
|
|
97
|
+
user_reference: {{userKey}}
|
|
98
|
+
|
|
99
|
+
###############################################################################
|
|
100
|
+
# Security Image Flow (if needed)
|
|
101
|
+
###############################################################################
|
|
102
|
+
|
|
103
|
+
### Set Security Image
|
|
104
|
+
# @name setSecurityImage
|
|
105
|
+
PATCH {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{instanceId}}/transitions/set-security-image?sync=true
|
|
106
|
+
Accept-Language: tr-TR
|
|
107
|
+
X-Request-Id: {{$guid}}
|
|
108
|
+
X-Device-Id: {{deviceId}}
|
|
109
|
+
X-Token-Id: {{$guid}}
|
|
110
|
+
X-Device-Info: Test Browser/1.0
|
|
111
|
+
X-Forwarded-For: 192.168.1.100
|
|
112
|
+
user_reference: {{userKey}}
|
|
113
|
+
Content-Type: application/json
|
|
114
|
+
|
|
115
|
+
{
|
|
116
|
+
"attributes": {
|
|
117
|
+
"securityImage": "sunset-beach-palm"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
### Get State After Security Image
|
|
122
|
+
# @name getStateAfterImage
|
|
123
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{instanceId}}/functions/state
|
|
124
|
+
Accept-Language: tr-TR
|
|
125
|
+
X-Request-Id: {{$guid}}
|
|
126
|
+
X-Device-Id: {{deviceId}}
|
|
127
|
+
X-Token-Id: {{$guid}}
|
|
128
|
+
user_reference: {{userKey}}
|
|
129
|
+
|
|
130
|
+
###############################################################################
|
|
131
|
+
# OTP Flow (if device not registered)
|
|
132
|
+
###############################################################################
|
|
133
|
+
|
|
134
|
+
### Verify OTP
|
|
135
|
+
# @name verifyOtp
|
|
136
|
+
PATCH {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{instanceId}}/transitions/verify-otp?sync=true
|
|
137
|
+
Accept-Language: tr-TR
|
|
138
|
+
X-Request-Id: {{$guid}}
|
|
139
|
+
X-Device-Id: {{deviceId}}
|
|
140
|
+
X-Token-Id: {{$guid}}
|
|
141
|
+
X-Device-Info: Test Browser/1.0
|
|
142
|
+
X-Forwarded-For: 192.168.1.100
|
|
143
|
+
user_reference: {{userKey}}
|
|
144
|
+
Content-Type: application/json
|
|
145
|
+
|
|
146
|
+
{
|
|
147
|
+
"attributes": {
|
|
148
|
+
"otpReference": 745952
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
### Send Push
|
|
153
|
+
# @name approvePush
|
|
154
|
+
PATCH {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{instanceId}}/transitions/approve-push?sync=true
|
|
155
|
+
Accept-Language: tr-TR
|
|
156
|
+
X-Request-Id: {{$guid}}
|
|
157
|
+
X-Device-Id: {{deviceId}}
|
|
158
|
+
X-Token-Id: {{$guid}}
|
|
159
|
+
user_reference: {{userKey}}
|
|
160
|
+
Content-Type: application/json
|
|
161
|
+
|
|
162
|
+
{
|
|
163
|
+
"attributes": {
|
|
164
|
+
"pushReference": "test-reference"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
###############################################################################
|
|
169
|
+
# Consent Selection Flow
|
|
170
|
+
###############################################################################
|
|
171
|
+
|
|
172
|
+
### Select Consent
|
|
173
|
+
# @name selectConsent
|
|
174
|
+
PATCH {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{instanceId}}/transitions/select-consent?sync=true
|
|
175
|
+
Accept-Language: tr-TR
|
|
176
|
+
X-Request-Id: {{$guid}}
|
|
177
|
+
X-Device-Id: {{deviceId}}
|
|
178
|
+
X-Token-Id: {{$guid}}
|
|
179
|
+
X-Device-Info: Test Browser/1.0
|
|
180
|
+
X-Forwarded-For: 192.168.1.100
|
|
181
|
+
user_reference: {{userKey}}
|
|
182
|
+
Content-Type: application/json
|
|
183
|
+
|
|
184
|
+
{
|
|
185
|
+
"attributes": {
|
|
186
|
+
"selectedConsent": "{{consentKey}}"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
### Get Final State
|
|
191
|
+
# @name getFinalState
|
|
192
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{instanceId}}/functions/state
|
|
193
|
+
Accept-Language: tr-TR
|
|
194
|
+
X-Request-Id: {{$guid}}
|
|
195
|
+
X-Device-Id: {{deviceId}}
|
|
196
|
+
X-Token-Id: {{$guid}}
|
|
197
|
+
user_reference: {{userKey}}
|
|
198
|
+
|
|
199
|
+
### Get Final Data
|
|
200
|
+
# @name getFinalData
|
|
201
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{instanceId}}/functions/data
|
|
202
|
+
Accept-Language: tr-TR
|
|
203
|
+
X-Request-Id: {{$guid}}
|
|
204
|
+
X-Device-Id: {{deviceId}}
|
|
205
|
+
X-Token-Id: {{$guid}}
|
|
206
|
+
user_reference: {{userKey}}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Test 123 - Login Flow Test Suite
|
|
2
|
+
|
|
3
|
+
Bu klasör, `securityQuestion` boş olan Person 123 için login flow testini içerir.
|
|
4
|
+
|
|
5
|
+
## 📋 Test Senaryosu
|
|
6
|
+
|
|
7
|
+
Person 123 ile login yapıldığında:
|
|
8
|
+
1. `securityQuestion` array boş olduğu için `security-question-change` state'ine yönlendirilmeli
|
|
9
|
+
2. Kullanıcı security question'ı set ettikten sonra flow devam etmeli
|
|
10
|
+
|
|
11
|
+
## 🚀 Hızlı Başlangıç
|
|
12
|
+
|
|
13
|
+
### Otomatik Setup (Önerilen)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# 1. httpyac kurulumu (ilk seferlik)
|
|
17
|
+
npm install -g httpyac
|
|
18
|
+
|
|
19
|
+
# 2. Setup script'ini çalıştır
|
|
20
|
+
./run-setup.sh
|
|
21
|
+
|
|
22
|
+
# 3. Login testini manuel çalıştır
|
|
23
|
+
# VS Code'da 06-user-login.http dosyasını aç
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Database Cleanup
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Test verilerini sil (tekrar test için)
|
|
30
|
+
./cleanup.sh
|
|
31
|
+
|
|
32
|
+
# Veya direkt SQL ile
|
|
33
|
+
psql -h localhost -U postgres -d vnext -f cleanup.sql
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 🔄 Manuel Çalıştırma Sırası
|
|
37
|
+
|
|
38
|
+
Dosyaları **sırayla** çalıştırın:
|
|
39
|
+
|
|
40
|
+
| # | Dosya | Açıklama | Workflow |
|
|
41
|
+
|---|-------|----------|----------|
|
|
42
|
+
| 1 | `01-person.http` | Person 123 oluştur (securityQuestion boş) | person |
|
|
43
|
+
| 2 | `02-user.http` | Person 123 için User oluştur | user |
|
|
44
|
+
| 3 | `03-scope.http` | User için Scope oluştur | scope |
|
|
45
|
+
| 4 | `04-consent.http` | User+Client için Consent oluştur | consent |
|
|
46
|
+
| 5 | `05-device.http` | (Opsiyonel) Device kaydı | device |
|
|
47
|
+
| 6 | `06-user-login.http` | Login testi - Ana senaryo | user-login |
|
|
48
|
+
|
|
49
|
+
## 📂 Dosya Yapısı
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
test-123/
|
|
53
|
+
├── README.md # Bu dosya
|
|
54
|
+
├── run-setup.sh # Otomatik setup script
|
|
55
|
+
├── cleanup.sh # Database cleanup script
|
|
56
|
+
├── cleanup.sql # SQL cleanup queries
|
|
57
|
+
├── 01-person.http # Person oluşturma
|
|
58
|
+
├── 02-user.http # User oluşturma
|
|
59
|
+
├── 03-scope.http # Scope oluşturma
|
|
60
|
+
├── 04-consent.http # Consent oluşturma
|
|
61
|
+
├── 05-device.http # Device oluşturma
|
|
62
|
+
└── 06-user-login.http # Login testi
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 🗂️ Workflow Bağımlılıkları
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
user-login
|
|
69
|
+
├── client (IbWeb - önceden mevcut olmalı)
|
|
70
|
+
├── user
|
|
71
|
+
│ └── person (securityQuestion, antiPishingImage)
|
|
72
|
+
├── scope
|
|
73
|
+
├── consent (user + client + scope)
|
|
74
|
+
└── device (opsiyonel - push notification için)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## ⚠️ Ön Koşullar
|
|
78
|
+
|
|
79
|
+
1. **Client** `IbWeb` mevcut olmalı (genellikle seed data ile gelir)
|
|
80
|
+
2. **Scope Group** `retail-customers` mevcut olmalı
|
|
81
|
+
3. Runtime çalışıyor olmalı: `http://localhost:4201`
|
|
82
|
+
4. **httpyac** kurulu olmalı: `npm install -g httpyac`
|
|
83
|
+
|
|
84
|
+
## 🧪 Test Edilecek Senaryolar
|
|
85
|
+
|
|
86
|
+
### Senaryo 1: Security Question Boş
|
|
87
|
+
- Person 123'ün `securityQuestion: []` (boş array)
|
|
88
|
+
- Login flow `security-question-change` state'ine gitmeli
|
|
89
|
+
- `set-security-question` transition ile güvenlik sorusu set edilmeli
|
|
90
|
+
- `person-refetch` state'i ile güncel person verisi çekilmeli
|
|
91
|
+
|
|
92
|
+
### Senaryo 2: Security Image Boş (sonraki adım)
|
|
93
|
+
- `antiPishingImage` yoksa `security-image-change` state'ine gitmeli
|
|
94
|
+
|
|
95
|
+
## 🛠️ Environment Variables
|
|
96
|
+
|
|
97
|
+
Cleanup script için database bağlantı ayarları:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
export DB_HOST=localhost # default: localhost
|
|
101
|
+
export DB_PORT=5432 # default: 5432
|
|
102
|
+
export DB_NAME=vnext # default: vnext
|
|
103
|
+
export DB_USER=postgres # default: postgres
|
|
104
|
+
export DB_PASSWORD=secret # optional
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## 📝 Notlar
|
|
108
|
+
|
|
109
|
+
- Her dosyada `@name` ile işaretli request'ler variable'ları set eder
|
|
110
|
+
- `?sync=true` ile senkron çalıştırma yapılır
|
|
111
|
+
- Instance ID'ler otomatik olarak response'dan alınır
|
|
112
|
+
- `run-setup.sh` her isteğin HTTP status'unu kontrol eder
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const { Client } = require('pg');
|
|
2
|
+
|
|
3
|
+
const config = {
|
|
4
|
+
host: process.env.DB_HOST || 'localhost',
|
|
5
|
+
port: process.env.DB_PORT || 5432,
|
|
6
|
+
database: process.env.DB_NAME || 'Aether_WorkflowDb',
|
|
7
|
+
user: process.env.DB_USER || 'postgres',
|
|
8
|
+
password: process.env.DB_PASSWORD || 'postgres',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const queries = [
|
|
12
|
+
{ name: 'person', sql: `DELETE FROM person."Instances" WHERE "Key" = '123'` },
|
|
13
|
+
{ name: 'user', sql: `DELETE FROM "user"."Instances" WHERE "Key" = '123'` },
|
|
14
|
+
{ name: 'scope', sql: `DELETE FROM scope."Instances" WHERE "Key" LIKE '123-%'` },
|
|
15
|
+
{ name: 'consent', sql: `DELETE FROM consent."Instances" WHERE "Key" LIKE '123-%'` },
|
|
16
|
+
{ name: 'device', sql: `DELETE FROM device."Instances" WHERE "Key" = 'test-device-123'` },
|
|
17
|
+
//{ name: 'user-login', sql: `DELETE FROM user_login."Instances" WHERE "Key" LIKE 'login-123-%'` },
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
async function cleanup() {
|
|
21
|
+
const client = new Client(config);
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
await client.connect();
|
|
25
|
+
console.log('Connected to database\n');
|
|
26
|
+
|
|
27
|
+
let total = 0;
|
|
28
|
+
for (const q of queries) {
|
|
29
|
+
try {
|
|
30
|
+
const result = await client.query(q.sql);
|
|
31
|
+
const count = result.rowCount;
|
|
32
|
+
total += count;
|
|
33
|
+
console.log(`${q.name}: ${count > 0 ? count + ' deleted' : 'nothing to delete'}`);
|
|
34
|
+
} catch (err) {
|
|
35
|
+
console.log(`${q.name}: ERROR - ${err.message}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
console.log(`\nTotal: ${total} rows deleted`);
|
|
40
|
+
} catch (err) {
|
|
41
|
+
console.error('Connection failed:', err.message);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
} finally {
|
|
44
|
+
await client.end();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
cleanup();
|
|
49
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Test 123 - Database Cleanup (Node.js version)
|
|
3
|
+
|
|
4
|
+
cd "$(dirname "$0")"
|
|
5
|
+
|
|
6
|
+
# Database settings (edit here or use environment variables)
|
|
7
|
+
export DB_HOST="${DB_HOST:-localhost}"
|
|
8
|
+
export DB_PORT="${DB_PORT:-5432}"
|
|
9
|
+
export DB_NAME="${DB_NAME:-Aether_WorkflowDb}"
|
|
10
|
+
export DB_USER="${DB_USER:-postgres}"
|
|
11
|
+
export DB_PASSWORD="${DB_PASSWORD:-postgres}"
|
|
12
|
+
|
|
13
|
+
# Check if pg is installed
|
|
14
|
+
if ! node -e "require('pg')" 2>/dev/null; then
|
|
15
|
+
echo "Installing pg package..."
|
|
16
|
+
npm install pg --no-save --silent
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
# Run cleanup
|
|
20
|
+
node cleanup.js
|