diff --git a/waltid-libraries/auth/waltid-ktor-authnz/src/test/kotlin/id/walt/AccountIdentifierRegistryTest.kt b/waltid-libraries/auth/waltid-ktor-authnz/src/test/kotlin/id/walt/AccountIdentifierRegistryTest.kt new file mode 100644 index 000000000..1cb7100a0 --- /dev/null +++ b/waltid-libraries/auth/waltid-ktor-authnz/src/test/kotlin/id/walt/AccountIdentifierRegistryTest.kt @@ -0,0 +1,26 @@ +package id.walt + +import id.walt.ktorauthnz.accounts.identifiers.AccountIdentifierRegistry +import id.walt.ktorauthnz.accounts.identifiers.methods.EmailIdentifier +import id.walt.ktorauthnz.accounts.identifiers.methods.JWTIdentifier +import id.walt.ktorauthnz.accounts.identifiers.methods.RADIUSIdentifier +import id.walt.ktorauthnz.accounts.identifiers.methods.UsernameIdentifier +import kotlin.test.Test + +class AccountIdentifierRegistryTest { + + @Test + fun testIdentifierRegistry() { + listOf( + EmailIdentifier("test@example.org"), + JWTIdentifier("subject1"), + RADIUSIdentifier("example.host", "username1"), + UsernameIdentifier("alice1") + ).associateWith { it.identifierName to it.toDataString() } + .map { (k, v) -> k to AccountIdentifierRegistry.getAccountIdentifier(v.first, v.second) } + .forEach { + println("${it.first} == ${it.second}") + check(it.first == it.second) { "${it.first} does not match ${it.second}" } + } + } +} diff --git a/waltid-libraries/auth/waltid-permissions/build.gradle.kts b/waltid-libraries/auth/waltid-permissions/build.gradle.kts index 80cf9b530..0f51335b8 100644 --- a/waltid-libraries/auth/waltid-permissions/build.gradle.kts +++ b/waltid-libraries/auth/waltid-permissions/build.gradle.kts @@ -33,9 +33,10 @@ kotlin { } js(IR) { moduleName = "waltid-permissions" + nodejs() browser { generateTypeScriptDefinitions() - testTask { + /*testTask { useKarma { fun hasProgram(program: String) = runCatching { @@ -51,11 +52,10 @@ kotlin { ).entries.firstOrNull { hasProgram(it.key) } if (testEngine == null) println("No web test engine installed, please install chromium or firefox or chrome.") else { - // println("Using web test engine: ${testEngine.key}") testEngine.value.invoke() } } - } + }*/ } binaries.library() } @@ -124,3 +124,7 @@ extensions.getByType().apply { ) ) } + +tasks.named("jsBrowserTest") { + enabled = false +}