Skip to content

Commit 17b7ea5

Browse files
author
Niraj Acharya
committed
test: add test for mfa
1 parent 99360b2 commit 17b7ea5

15 files changed

Lines changed: 3663 additions & 26 deletions

File tree

.drone.star

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,32 @@ config = {
219219
"IDP_ACCESS_TOKEN_EXPIRATION": 30,
220220
},
221221
},
222+
"keycloak": {
223+
"earlyFail": True,
224+
"skip": False,
225+
"features": [
226+
"specs/keycloak/mfa.spec.ts",
227+
],
228+
"extraServerEnvironment": {
229+
"PROXY_AUTOPROVISION_ACCOUNTS": "true",
230+
"PROXY_ROLE_ASSIGNMENT_DRIVER": "oidc",
231+
"OCIS_OIDC_ISSUER": "https://keycloak:8443/realms/oCIS",
232+
"PROXY_OIDC_REWRITE_WELLKNOWN": "true",
233+
"WEB_OIDC_CLIENT_ID": "web",
234+
"PROXY_USER_OIDC_CLAIM": "preferred_username",
235+
"PROXY_USER_CS3_CLAIM": "username",
236+
"OCIS_ADMIN_USER_ID": "",
237+
"OCIS_EXCLUDE_RUN_SERVICES": "idp",
238+
"GRAPH_ASSIGN_DEFAULT_USER_ROLE": "false",
239+
"GRAPH_USERNAME_MATCH": "none",
240+
"KEYCLOAK_DOMAIN": "keycloak:8443",
241+
"OCIS_MFA_ENABLED": "true",
242+
"WEB_OIDC_SCOPE": "openid profile email acr",
243+
},
244+
"testEnv": {
245+
"MFA": "true",
246+
},
247+
},
222248
},
223249
"build": True,
224250
}
@@ -597,6 +623,7 @@ def e2eTestsOnPlaywright(ctx):
597623
"extraServerEnvironment": {},
598624
"skipA11y": True,
599625
"reportTracing": False,
626+
"testEnv": {},
600627
}
601628

602629
pipelines = []
@@ -677,6 +704,8 @@ def e2eTestsOnPlaywright(ctx):
677704
if "keycloak" in suite:
678705
environment["KEYCLOAK"] = "true"
679706
environment["KEYCLOAK_HOST"] = "keycloak:8443"
707+
if params["testEnv"]:
708+
environment.update(params["testEnv"])
680709
e2e_volumes.append({
681710
"name": "certs",
682711
"temp": {},
@@ -1949,7 +1978,7 @@ def keycloakService():
19491978
},
19501979
"commands": [
19511980
"mkdir -p /opt/keycloak/data/import",
1952-
"cp tests/drone/ocis_keycloak/ocis-ci-realm.dist.json /opt/keycloak/data/import/oCIS-realm.json",
1981+
"cp tests/drone/ocis_keycloak/ocis-mfa-ci-realm.dist.json /opt/keycloak/data/import/oCIS-realm.json",
19531982
"/opt/keycloak/bin/kc.sh start-dev --proxy-headers xforwarded --spi-connections-http-client-default-disable-trust-manager=true --import-realm --health-enabled=true",
19541983
],
19551984
"volumes": [

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@
6767
"git-repo-info": "2.1.1",
6868
"globals": "^16.5.0",
6969
"happy-dom": "20.0.10",
70+
"jimp": "^1.6.0",
7071
"jsdom": "^27.2.0",
72+
"jsqr": "^1.4.0",
7173
"license-checker-rseidelsohn": "4.4.2",
7274
"multiple-cucumber-html-reporter": "^3.9.3",
7375
"node-fetch": "3.3.2",
@@ -79,6 +81,7 @@
7981
"rollup-plugin-gzip": "^4.1.1",
8082
"rollup-plugin-visualizer": "6.0.5",
8183
"simple-git": "3.30.0",
84+
"speakeasy": "^2.0.0",
8285
"ts-node": "10.9.2",
8386
"tslib": "2.8.1",
8487
"typescript": "5.9.3",

0 commit comments

Comments
 (0)