@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,45 @@
|
|
|
1
|
+
-- Test 123 Cleanup Script
|
|
2
|
+
-- Deletes test instances with key '123' from all related workflow schemas
|
|
3
|
+
--
|
|
4
|
+
-- Usage: psql -h localhost -U postgres -d vnext -f cleanup.sql
|
|
5
|
+
-- Or: ./cleanup.sh (wrapper script)
|
|
6
|
+
|
|
7
|
+
BEGIN;
|
|
8
|
+
|
|
9
|
+
-- Person schema
|
|
10
|
+
DELETE FROM "person".instances WHERE key = '123';
|
|
11
|
+
|
|
12
|
+
-- User schema
|
|
13
|
+
DELETE FROM "user".instances WHERE key = '123';
|
|
14
|
+
|
|
15
|
+
-- Scope schema (key format: {userKey}-{scopeId})
|
|
16
|
+
DELETE FROM "scope".instances WHERE key LIKE '123-%';
|
|
17
|
+
|
|
18
|
+
-- Consent schema (key format: {userKey}-{clientKey}-{scopeKey})
|
|
19
|
+
DELETE FROM "consent".instances WHERE key LIKE '123-%';
|
|
20
|
+
|
|
21
|
+
-- Device schema
|
|
22
|
+
DELETE FROM "device".instances WHERE key = 'test-device-123';
|
|
23
|
+
|
|
24
|
+
-- User-login schema (test instances)
|
|
25
|
+
DELETE FROM "user-login".instances WHERE key LIKE 'login-123-%';
|
|
26
|
+
|
|
27
|
+
COMMIT;
|
|
28
|
+
|
|
29
|
+
-- Verify cleanup - show remaining counts
|
|
30
|
+
SELECT 'Cleanup verification:' as info;
|
|
31
|
+
SELECT
|
|
32
|
+
'person' as schema_name,
|
|
33
|
+
count(*) as remaining
|
|
34
|
+
FROM "person".instances WHERE key = '123'
|
|
35
|
+
UNION ALL
|
|
36
|
+
SELECT 'user', count(*) FROM "user".instances WHERE key = '123'
|
|
37
|
+
UNION ALL
|
|
38
|
+
SELECT 'scope', count(*) FROM "scope".instances WHERE key LIKE '123-%'
|
|
39
|
+
UNION ALL
|
|
40
|
+
SELECT 'consent', count(*) FROM "consent".instances WHERE key LIKE '123-%'
|
|
41
|
+
UNION ALL
|
|
42
|
+
SELECT 'device', count(*) FROM "device".instances WHERE key = 'test-device-123'
|
|
43
|
+
UNION ALL
|
|
44
|
+
SELECT 'user-login', count(*) FROM "user-login".instances WHERE key LIKE 'login-123-%';
|
|
45
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dev": {
|
|
3
|
+
"baseUrl": "http://localhost:4201",
|
|
4
|
+
"apiVersion": "v1",
|
|
5
|
+
"domain": "morph-idm",
|
|
6
|
+
"personKey": "123",
|
|
7
|
+
"userKey": "123",
|
|
8
|
+
"scopeKey": "123-123",
|
|
9
|
+
"clientKey": "IbWeb",
|
|
10
|
+
"consentKey": "123-IbWeb-123-123",
|
|
11
|
+
"deviceId": "test-device-123"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Test 123 - Run setup requests
|
|
3
|
+
|
|
4
|
+
cd "$(dirname "$0")"
|
|
5
|
+
|
|
6
|
+
run_request() {
|
|
7
|
+
local file=$1
|
|
8
|
+
local name=$2
|
|
9
|
+
|
|
10
|
+
echo -n "$file ($name): "
|
|
11
|
+
|
|
12
|
+
output=$(npx httpyac "$file" -n "$name" -e dev -o short 2>&1)
|
|
13
|
+
if [ $? -eq 0 ]; then
|
|
14
|
+
echo "OK"
|
|
15
|
+
else
|
|
16
|
+
echo "FAILED"
|
|
17
|
+
echo "$output"
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
echo "Running Test 123 Setup..."
|
|
23
|
+
echo ""
|
|
24
|
+
|
|
25
|
+
# Create instances
|
|
26
|
+
run_request "01-person.http" "startPerson"
|
|
27
|
+
run_request "02-user.http" "createUser"
|
|
28
|
+
run_request "03-scope.http" "createScope"
|
|
29
|
+
run_request "04-consent.http" "createConsent"
|
|
30
|
+
run_request "05-device.http" "createDevice"
|
|
31
|
+
|
|
32
|
+
echo ""
|
|
33
|
+
echo "Publishing..."
|
|
34
|
+
echo ""
|
|
35
|
+
|
|
36
|
+
# Publish instances (draft -> active)
|
|
37
|
+
run_request "01-person.http" "publishPerson"
|
|
38
|
+
run_request "02-user.http" "publishUser"
|
|
39
|
+
run_request "03-scope.http" "publishScope"
|
|
40
|
+
|
|
41
|
+
echo ""
|
|
42
|
+
echo "Setup complete. Run 06-user-login.http manually."
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"environments": {
|
|
3
|
+
"dev": {
|
|
4
|
+
"baseUrl": "http://localhost:4201",
|
|
5
|
+
"apiVersion": "v1",
|
|
6
|
+
"domain": "morph-idm",
|
|
7
|
+
"personKey": "12345",
|
|
8
|
+
"userKey": "12345",
|
|
9
|
+
"scopeKey": "12345-auto",
|
|
10
|
+
"clientKey": "IbWeb",
|
|
11
|
+
"deviceId": "test-device-12345"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
###############################################################################
|
|
2
|
+
# STEP 1: Person - Create person with security question (key: 12345)
|
|
3
|
+
###############################################################################
|
|
4
|
+
|
|
5
|
+
### Start Person
|
|
6
|
+
# @name startPerson
|
|
7
|
+
POST {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/person/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": "{{personKey}}",
|
|
19
|
+
"tags": ["test", "person", "auto-consent-test"],
|
|
20
|
+
"attributes": {
|
|
21
|
+
"firstName": "AutoConsent",
|
|
22
|
+
"lastName": "TestUser",
|
|
23
|
+
"email": "autoconsent@test.com",
|
|
24
|
+
"phone": "+905551112345",
|
|
25
|
+
"tckn": "12345678912",
|
|
26
|
+
"birthDate": "1990-05-15",
|
|
27
|
+
"securityQuestion": [
|
|
28
|
+
{
|
|
29
|
+
"question": "İlk evcil hayvanınızın adı?",
|
|
30
|
+
"answer": "Boncuk"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"antiPishingImage": "secure-image-12345.png"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
### Publish Person (draft -> active)
|
|
38
|
+
# @name publishPerson
|
|
39
|
+
PATCH {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/person/instances/{{personKey}}/transitions/publish?sync=true
|
|
40
|
+
Accept-Language: tr-TR
|
|
41
|
+
X-Request-Id: {{$guid}}
|
|
42
|
+
X-Device-Id: admin-portal
|
|
43
|
+
X-Token-Id: {{$guid}}
|
|
44
|
+
X-Device-Info: Test Suite/1.0
|
|
45
|
+
X-Forwarded-For: 192.168.1.100
|
|
46
|
+
user_reference: test-admin
|
|
47
|
+
Content-Type: application/json
|
|
48
|
+
|
|
49
|
+
{
|
|
50
|
+
"attributes": {
|
|
51
|
+
"publishedBy": "test-admin",
|
|
52
|
+
"publishedAt": "{{$datetime iso8601}}"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
### Get Person Data
|
|
57
|
+
# @name getPersonData
|
|
58
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/person/instances/{{personKey}}/functions/data
|
|
59
|
+
Accept-Language: tr-TR
|
|
60
|
+
X-Request-Id: {{$guid}}
|
|
61
|
+
X-Device-Id: admin-portal
|
|
62
|
+
X-Token-Id: {{$guid}}
|
|
63
|
+
user_reference: test-admin
|
|
64
|
+
|
|
65
|
+
### Get Person State
|
|
66
|
+
# @name getPersonState
|
|
67
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/person/instances/{{personKey}}/functions/state
|
|
68
|
+
Accept-Language: tr-TR
|
|
69
|
+
X-Request-Id: {{$guid}}
|
|
70
|
+
X-Device-Id: admin-portal
|
|
71
|
+
X-Token-Id: {{$guid}}
|
|
72
|
+
user_reference: test-admin
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
###############################################################################
|
|
2
|
+
# STEP 2: User - Create user linked to person (key: 12345)
|
|
3
|
+
###############################################################################
|
|
4
|
+
|
|
5
|
+
### Create User
|
|
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", "auto-consent-test"],
|
|
20
|
+
"attributes": {
|
|
21
|
+
"person": {
|
|
22
|
+
"domain": "morph-idm",
|
|
23
|
+
"workflow": "person",
|
|
24
|
+
"key": "{{personKey}}",
|
|
25
|
+
"version": "1.0.0"
|
|
26
|
+
},
|
|
27
|
+
"userName": "autoconsent-user",
|
|
28
|
+
"status": "active",
|
|
29
|
+
"password": {
|
|
30
|
+
"hash": "hashed-password-12345",
|
|
31
|
+
"salt": "salt-12345",
|
|
32
|
+
"algorithm": "SHA256"
|
|
33
|
+
},
|
|
34
|
+
"failedLoginAttempts": 0,
|
|
35
|
+
"lastLoginAt": null
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
### Publish User (draft -> active)
|
|
40
|
+
# @name publishUser
|
|
41
|
+
PATCH {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user/instances/{{userKey}}/transitions/publish?sync=true
|
|
42
|
+
Accept-Language: tr-TR
|
|
43
|
+
X-Request-Id: {{$guid}}
|
|
44
|
+
X-Device-Id: admin-portal
|
|
45
|
+
X-Token-Id: {{$guid}}
|
|
46
|
+
X-Device-Info: Test Suite/1.0
|
|
47
|
+
X-Forwarded-For: 192.168.1.100
|
|
48
|
+
user_reference: test-admin
|
|
49
|
+
Content-Type: application/json
|
|
50
|
+
|
|
51
|
+
{
|
|
52
|
+
"attributes": {
|
|
53
|
+
"publishedBy": "test-admin",
|
|
54
|
+
"publishedAt": "{{$datetime iso8601}}"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
### Get User Data
|
|
59
|
+
# @name getUserData
|
|
60
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user/instances/{{userKey}}/functions/data
|
|
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
|
|
66
|
+
|
|
67
|
+
### Get User State
|
|
68
|
+
# @name getUserState
|
|
69
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user/instances/{{userKey}}/functions/state
|
|
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
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
###############################################################################
|
|
2
|
+
# STEP 3: Scope - Auto-consent eligible scope (key: 12345-auto)
|
|
3
|
+
# This scope has autoConsent: true which allows auto-consent creation
|
|
4
|
+
###############################################################################
|
|
5
|
+
|
|
6
|
+
### Create Scope with auto-consent enabled
|
|
7
|
+
# @name createScope
|
|
8
|
+
POST {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/scope/instances/start?sync=true
|
|
9
|
+
Accept-Language: tr-TR
|
|
10
|
+
X-Request-Id: {{$guid}}
|
|
11
|
+
X-Device-Id: admin-portal
|
|
12
|
+
X-Token-Id: {{$guid}}
|
|
13
|
+
X-Device-Info: Test Suite/1.0
|
|
14
|
+
X-Forwarded-For: 192.168.1.100
|
|
15
|
+
user_reference: test-admin
|
|
16
|
+
Content-Type: application/json
|
|
17
|
+
|
|
18
|
+
{
|
|
19
|
+
"key": "{{scopeKey}}",
|
|
20
|
+
"tags": ["test", "scope", "auto-consent-eligible", "auto-consent-test"],
|
|
21
|
+
"attributes": {
|
|
22
|
+
"group": {
|
|
23
|
+
"domain": "morph-idm",
|
|
24
|
+
"workflow": "scope-group",
|
|
25
|
+
"key": "retail-customers"
|
|
26
|
+
},
|
|
27
|
+
"searchKey": "{{userKey}}"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
### Publish Scope (draft -> active)
|
|
32
|
+
# @name publishScope
|
|
33
|
+
PATCH {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/scope/instances/{{scopeKey}}/transitions/publish?sync=true
|
|
34
|
+
Accept-Language: tr-TR
|
|
35
|
+
X-Request-Id: {{$guid}}
|
|
36
|
+
X-Device-Id: admin-portal
|
|
37
|
+
X-Token-Id: {{$guid}}
|
|
38
|
+
X-Device-Info: Test Suite/1.0
|
|
39
|
+
X-Forwarded-For: 192.168.1.100
|
|
40
|
+
user_reference: test-admin
|
|
41
|
+
Content-Type: application/json
|
|
42
|
+
|
|
43
|
+
{
|
|
44
|
+
"attributes": {
|
|
45
|
+
"publishedBy": "test-admin",
|
|
46
|
+
"publishedAt": "{{$datetime iso8601}}"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
### Get Scope Data
|
|
51
|
+
# @name getScopeData
|
|
52
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/scope/instances/{{scopeKey}}/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 Scope State
|
|
60
|
+
# @name getScopeState
|
|
61
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/scope/instances/{{scopeKey}}/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,56 @@
|
|
|
1
|
+
###############################################################################
|
|
2
|
+
# STEP 4: Device - Create device for login (key: test-device-12345)
|
|
3
|
+
# NOTE: No consent is created - the flow should create auto-consent
|
|
4
|
+
###############################################################################
|
|
5
|
+
|
|
6
|
+
### Create Device
|
|
7
|
+
# @name createDevice
|
|
8
|
+
POST {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/device/instances/start?sync=true
|
|
9
|
+
Accept-Language: tr-TR
|
|
10
|
+
X-Request-Id: {{$guid}}
|
|
11
|
+
X-Device-Id: {{deviceId}}
|
|
12
|
+
X-Token-Id: {{$guid}}
|
|
13
|
+
X-Device-Info: Test Device/1.0
|
|
14
|
+
X-Forwarded-For: 192.168.1.100
|
|
15
|
+
user_reference: test-admin
|
|
16
|
+
Content-Type: application/json
|
|
17
|
+
|
|
18
|
+
{
|
|
19
|
+
"key": "{{deviceId}}",
|
|
20
|
+
"tags": ["test", "device", "auto-consent-test"],
|
|
21
|
+
"attributes": {
|
|
22
|
+
"user": {
|
|
23
|
+
"domain": "morph-idm",
|
|
24
|
+
"workflow": "user",
|
|
25
|
+
"key": "{{userKey}}",
|
|
26
|
+
"version": "1.0.0"
|
|
27
|
+
},
|
|
28
|
+
"deviceInfo": {
|
|
29
|
+
"platform": "iOS",
|
|
30
|
+
"osVersion": "17.0",
|
|
31
|
+
"appVersion": "1.0.0",
|
|
32
|
+
"deviceModel": "iPhone 15"
|
|
33
|
+
},
|
|
34
|
+
"status": "active",
|
|
35
|
+
"registeredAt": "{{$datetime iso8601}}",
|
|
36
|
+
"pushToken": "mock-push-token-12345"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
### Get Device Data
|
|
41
|
+
# @name getDeviceData
|
|
42
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/device/instances/{{deviceId}}/functions/data
|
|
43
|
+
Accept-Language: tr-TR
|
|
44
|
+
X-Request-Id: {{$guid}}
|
|
45
|
+
X-Device-Id: {{deviceId}}
|
|
46
|
+
X-Token-Id: {{$guid}}
|
|
47
|
+
user_reference: test-admin
|
|
48
|
+
|
|
49
|
+
### Get Device State
|
|
50
|
+
# @name getDeviceState
|
|
51
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/device/instances/{{deviceId}}/functions/state
|
|
52
|
+
Accept-Language: tr-TR
|
|
53
|
+
X-Request-Id: {{$guid}}
|
|
54
|
+
X-Device-Id: {{deviceId}}
|
|
55
|
+
X-Token-Id: {{$guid}}
|
|
56
|
+
user_reference: test-admin
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
###############################################################################
|
|
2
|
+
# STEP 5: User Login - Test auto-consent flow
|
|
3
|
+
#
|
|
4
|
+
# Expected Flow:
|
|
5
|
+
# 1. Start login → user-validation
|
|
6
|
+
# 2. User valid → person-fetch → check-device → security-check → waiting-password
|
|
7
|
+
# 3. Submit password → password-verified → consent-selection (subflow)
|
|
8
|
+
# 4. In consent-selection: No consent found + autoConsent eligible → auto-consent-creation
|
|
9
|
+
# 5. Auto-consent created → consent-selected → back to main flow
|
|
10
|
+
# 6. Continue with OTP verification → complete
|
|
11
|
+
###############################################################################
|
|
12
|
+
|
|
13
|
+
### Start Login
|
|
14
|
+
# @name startLogin
|
|
15
|
+
POST {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/start
|
|
16
|
+
Accept-Language: tr-TR
|
|
17
|
+
X-Request-Id: {{$guid}}
|
|
18
|
+
X-Device-Id: {{deviceId}}
|
|
19
|
+
X-Token-Id: {{$guid}}
|
|
20
|
+
X-Device-Info: Test Device/1.0
|
|
21
|
+
X-Forwarded-For: 192.168.1.100
|
|
22
|
+
user_reference: {{userKey}}
|
|
23
|
+
Content-Type: application/json
|
|
24
|
+
|
|
25
|
+
{
|
|
26
|
+
"key": "login-auto-{{$timestamp}}",
|
|
27
|
+
"tags": ["test", "login", "auto-consent-test"],
|
|
28
|
+
"attributes": {
|
|
29
|
+
"clientId": "IbWeb",
|
|
30
|
+
"grantType": "authorization_code",
|
|
31
|
+
"scopes": ["{{scopeKey}}"],
|
|
32
|
+
"userName": "{{userKey}}",
|
|
33
|
+
"password": "$argon2id$v=19$m=65536,t=3,p=4$c29tZXNhbHQ$RdescudvJCsgt3ub+b+dWRWJTmaaJObG",
|
|
34
|
+
"deviceId": "{{deviceId}}",
|
|
35
|
+
"loginMethod": "password",
|
|
36
|
+
"ipAddress": "192.168.1.100",
|
|
37
|
+
"userAgent": "Test Browser/1.0",
|
|
38
|
+
"loginTimestamp": "{{$datetime iso8601}}"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
###
|
|
43
|
+
|
|
44
|
+
### Get Login State
|
|
45
|
+
# @name getLoginState
|
|
46
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{startLogin.response.body.key}}/functions/state
|
|
47
|
+
Accept-Language: tr-TR
|
|
48
|
+
X-Request-Id: {{$guid}}
|
|
49
|
+
X-Device-Id: {{deviceId}}
|
|
50
|
+
X-Token-Id: {{$guid}}
|
|
51
|
+
user_reference: {{userKey}}
|
|
52
|
+
|
|
53
|
+
### Get Login Data
|
|
54
|
+
# @name getLoginData
|
|
55
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{startLogin.response.body.key}}/functions/data
|
|
56
|
+
Accept-Language: tr-TR
|
|
57
|
+
X-Request-Id: {{$guid}}
|
|
58
|
+
X-Device-Id: {{deviceId}}
|
|
59
|
+
X-Token-Id: {{$guid}}
|
|
60
|
+
user_reference: {{userKey}}
|
|
61
|
+
|
|
62
|
+
### Submit Password (from waiting-password state)
|
|
63
|
+
# @name submitPassword
|
|
64
|
+
PATCH {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{startLogin.response.body.key}}/transitions/submit-password
|
|
65
|
+
Accept-Language: tr-TR
|
|
66
|
+
X-Request-Id: {{$guid}}
|
|
67
|
+
X-Device-Id: {{deviceId}}
|
|
68
|
+
X-Token-Id: {{$guid}}
|
|
69
|
+
X-Device-Info: Test Device/1.0
|
|
70
|
+
X-Forwarded-For: 192.168.1.100
|
|
71
|
+
user_reference: {{userKey}}
|
|
72
|
+
Content-Type: application/json
|
|
73
|
+
|
|
74
|
+
{
|
|
75
|
+
"password": "hashed-password-12345"
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
###
|
|
79
|
+
|
|
80
|
+
### Get State After Password (should be in consent-selection subflow or OTP)
|
|
81
|
+
# @name getStateAfterPassword
|
|
82
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{startLogin.response.body.key}}/functions/state
|
|
83
|
+
Accept-Language: tr-TR
|
|
84
|
+
X-Request-Id: {{$guid}}
|
|
85
|
+
X-Device-Id: {{deviceId}}
|
|
86
|
+
X-Token-Id: {{$guid}}
|
|
87
|
+
user_reference: {{userKey}}
|
|
88
|
+
|
|
89
|
+
### Get Data After Password (should show auto-consent created)
|
|
90
|
+
# @name getDataAfterPassword
|
|
91
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{startLogin.response.body.key}}/functions/data
|
|
92
|
+
Accept-Language: tr-TR
|
|
93
|
+
X-Request-Id: {{$guid}}
|
|
94
|
+
X-Device-Id: {{deviceId}}
|
|
95
|
+
X-Token-Id: {{$guid}}
|
|
96
|
+
user_reference: {{userKey}}
|
|
97
|
+
|
|
98
|
+
### Submit OTP (from waiting-otp state)
|
|
99
|
+
# @name submitOtp
|
|
100
|
+
PATCH {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{startLogin.response.body.key}}/transitions/submit-otp
|
|
101
|
+
Accept-Language: tr-TR
|
|
102
|
+
X-Request-Id: {{$guid}}
|
|
103
|
+
X-Device-Id: {{deviceId}}
|
|
104
|
+
X-Token-Id: {{$guid}}
|
|
105
|
+
X-Device-Info: Test Device/1.0
|
|
106
|
+
X-Forwarded-For: 192.168.1.100
|
|
107
|
+
user_reference: {{userKey}}
|
|
108
|
+
Content-Type: application/json
|
|
109
|
+
|
|
110
|
+
{
|
|
111
|
+
"otpCode": "123456"
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
###
|
|
115
|
+
|
|
116
|
+
### Get Final State
|
|
117
|
+
# @name getFinalState
|
|
118
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{startLogin.response.body.key}}/functions/state
|
|
119
|
+
Accept-Language: tr-TR
|
|
120
|
+
X-Request-Id: {{$guid}}
|
|
121
|
+
X-Device-Id: {{deviceId}}
|
|
122
|
+
X-Token-Id: {{$guid}}
|
|
123
|
+
user_reference: {{userKey}}
|
|
124
|
+
|
|
125
|
+
### Get Final Data
|
|
126
|
+
# @name getFinalData
|
|
127
|
+
GET {{baseUrl}}/api/{{apiVersion}}/{{domain}}/workflows/user-login/instances/{{startLogin.response.body.key}}/functions/data
|
|
128
|
+
Accept-Language: tr-TR
|
|
129
|
+
X-Request-Id: {{$guid}}
|
|
130
|
+
X-Device-Id: {{deviceId}}
|
|
131
|
+
X-Token-Id: {{$guid}}
|
|
132
|
+
user_reference: {{userKey}}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Test Auto-Consent
|
|
2
|
+
|
|
3
|
+
Bu test senaryosu, **consent olmadan** login flow'unu test eder.
|
|
4
|
+
Flow'un auto-consent oluşturması beklenir.
|
|
5
|
+
|
|
6
|
+
## Senaryo
|
|
7
|
+
|
|
8
|
+
- **userKey**: 12345
|
|
9
|
+
- **personKey**: 12345 (securityQuestion dolu)
|
|
10
|
+
- **scopeKey**: 12345-auto (autoConsent: true)
|
|
11
|
+
- **consent**: YOK ❌
|
|
12
|
+
- **deviceId**: test-device-12345
|
|
13
|
+
|
|
14
|
+
## Beklenen Flow
|
|
15
|
+
|
|
16
|
+
1. Login başlat → user-validation
|
|
17
|
+
2. Person fetch → check-device → security-check (geçer, security data var)
|
|
18
|
+
3. waiting-password → submit-password
|
|
19
|
+
4. consent-selection subflow:
|
|
20
|
+
- Consent bulunamadı (count=0)
|
|
21
|
+
- Scope autoConsent=true → hasAutoConsentEligible=true
|
|
22
|
+
- auto-consent-creation state'ine git
|
|
23
|
+
- Yeni consent otomatik oluştur
|
|
24
|
+
5. OTP verification → complete
|
|
25
|
+
|
|
26
|
+
## Kurulum
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
./run-setup.sh
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Temizlik
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
node cleanup.js
|
|
36
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const { Client } = require('pg');
|
|
2
|
+
|
|
3
|
+
const config = {
|
|
4
|
+
user: process.env.DB_USER || 'postgres',
|
|
5
|
+
host: process.env.DB_HOST || 'localhost',
|
|
6
|
+
database: process.env.DB_NAME || 'Aether_WorkflowDb',
|
|
7
|
+
password: process.env.DB_PASSWORD || 'postgres',
|
|
8
|
+
port: process.env.DB_PORT || 5432,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const queries = [
|
|
12
|
+
{ name: 'person', sql: `DELETE FROM person."Instances" WHERE "Key" = '12345'` },
|
|
13
|
+
{ name: 'user', sql: `DELETE FROM "user"."Instances" WHERE "Key" = '12345'` },
|
|
14
|
+
{ name: 'scope', sql: `DELETE FROM scope."Instances" WHERE "Key" LIKE '12345-%'` },
|
|
15
|
+
{ name: 'consent', sql: `DELETE FROM consent."Instances" WHERE "Key" LIKE '12345-%'` },
|
|
16
|
+
{ name: 'device', sql: `DELETE FROM device."Instances" WHERE "Key" = 'test-device-12345'` },
|
|
17
|
+
{ name: 'user-login', sql: `DELETE FROM "user-login"."Instances" WHERE "Key" LIKE 'login-auto-%'` },
|
|
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');
|
|
26
|
+
|
|
27
|
+
let totalDeleted = 0;
|
|
28
|
+
for (const query of queries) {
|
|
29
|
+
const result = await client.query(query.sql);
|
|
30
|
+
if (result.rowCount > 0) {
|
|
31
|
+
console.log(`${query.name}: ${result.rowCount} deleted`);
|
|
32
|
+
totalDeleted += result.rowCount;
|
|
33
|
+
} else {
|
|
34
|
+
console.log(`${query.name}: nothing to delete`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
console.log(`\nTotal: ${totalDeleted} rows deleted`);
|
|
38
|
+
|
|
39
|
+
} catch (err) {
|
|
40
|
+
console.error('Database cleanup failed:', err.message);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
} finally {
|
|
43
|
+
await client.end();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
cleanup();
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Test Auto-Consent - Run setup requests (NO consent created)
|
|
3
|
+
|
|
4
|
+
cd "$(dirname "$0")"
|
|
5
|
+
|
|
6
|
+
run_request() {
|
|
7
|
+
local file=$1
|
|
8
|
+
local name=$2
|
|
9
|
+
|
|
10
|
+
echo -n "$file ($name): "
|
|
11
|
+
|
|
12
|
+
output=$(npx httpyac "$file" -n "$name" -e dev -o short 2>&1)
|
|
13
|
+
exit_code=$?
|
|
14
|
+
|
|
15
|
+
if [ $exit_code -ne 0 ]; then
|
|
16
|
+
echo "FAILED"
|
|
17
|
+
echo "$output"
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
if echo "$output" | grep -qE "HTTP/[0-9.]+ [45][0-9]{2}"; then
|
|
22
|
+
echo "HTTP ERROR"
|
|
23
|
+
echo "$output"
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
echo "OK"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
echo "Running Test Auto-Consent Setup..."
|
|
31
|
+
echo "(No consent created - will test auto-consent flow)"
|
|
32
|
+
echo ""
|
|
33
|
+
|
|
34
|
+
# Create instances (NO CONSENT!)
|
|
35
|
+
run_request "01-person.http" "startPerson"
|
|
36
|
+
run_request "02-user.http" "createUser"
|
|
37
|
+
run_request "03-scope.http" "createScope"
|
|
38
|
+
run_request "04-device.http" "createDevice"
|
|
39
|
+
|
|
40
|
+
echo ""
|
|
41
|
+
echo "Publishing..."
|
|
42
|
+
echo ""
|
|
43
|
+
|
|
44
|
+
# Publish instances
|
|
45
|
+
run_request "01-person.http" "publishPerson"
|
|
46
|
+
run_request "02-user.http" "publishUser"
|
|
47
|
+
run_request "03-scope.http" "publishScope"
|
|
48
|
+
|
|
49
|
+
echo ""
|
|
50
|
+
echo "Setup complete. Run 05-user-login.http to test auto-consent flow."
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"environments": {
|
|
3
|
+
"dev": {
|
|
4
|
+
"baseUrl": "http://localhost:4201",
|
|
5
|
+
"apiVersion": "v1",
|
|
6
|
+
"domain": "morph-idm",
|
|
7
|
+
"personKey": "1234",
|
|
8
|
+
"userKey": "1234",
|
|
9
|
+
"scopeKey": "1234-1234",
|
|
10
|
+
"scopeKey2": "1234-Corporate",
|
|
11
|
+
"clientKey": "IbWeb",
|
|
12
|
+
"consentKey1": "1234-IbWeb-1234-1234",
|
|
13
|
+
"consentKey2": "1234-IbWeb-1234-Corporate",
|
|
14
|
+
"deviceId": "test-device-1234"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|