-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: authnz registration initial auth
- Loading branch information
Showing
33 changed files
with
305 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
...authnz/src/main/kotlin/id/walt/ktorauthnz/accounts/identifiers/methods/EmailIdentifier.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
package id.walt.ktorauthnz.accounts.identifiers.methods | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class EmailIdentifier(val email: String) : AccountIdentifier("email") { | ||
@SerialName("email") | ||
data class EmailIdentifier(val email: String) : AccountIdentifier() { | ||
override fun identifierName() = "email" | ||
|
||
override fun toDataString() = email | ||
|
||
companion object : AccountIdentifierFactory<EmailIdentifier>("email") { | ||
override fun fromAccountIdentifierDataString(dataString: String): EmailIdentifier = EmailIdentifier(dataString) | ||
} | ||
|
||
|
||
} |
5 changes: 4 additions & 1 deletion
5
...r-authnz/src/main/kotlin/id/walt/ktorauthnz/accounts/identifiers/methods/JWTIdentifier.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...-authnz/src/main/kotlin/id/walt/ktorauthnz/accounts/identifiers/methods/LDAPIdentifier.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
...-authnz/src/main/kotlin/id/walt/ktorauthnz/accounts/identifiers/methods/OIDCIdentifier.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...uthnz/src/main/kotlin/id/walt/ktorauthnz/accounts/identifiers/methods/RADIUSIdentifier.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
...hnz/src/main/kotlin/id/walt/ktorauthnz/accounts/identifiers/methods/UsernameIdentifier.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
package id.walt.ktorauthnz.accounts.identifiers.methods | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class UsernameIdentifier(val name: String) : AccountIdentifier("username") { | ||
@SerialName("userpass") | ||
data class UsernameIdentifier(val name: String) : AccountIdentifier() { | ||
override fun identifierName() = "userpass" | ||
override fun toDataString() = name | ||
|
||
companion object : AccountIdentifierFactory<UsernameIdentifier>("username") { | ||
companion object : AccountIdentifierFactory<UsernameIdentifier>("userpass") { | ||
override fun fromAccountIdentifierDataString(dataString: String) = UsernameIdentifier(dataString) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...-ktor-authnz/src/main/kotlin/id/walt/ktorauthnz/methods/config/AuthMethodConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
package id.walt.ktorauthnz.methods.config | ||
|
||
import id.walt.ktorauthnz.methods.AuthenticationMethod | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
sealed interface AuthMethodConfiguration | ||
sealed interface AuthMethodConfiguration { | ||
fun authMethod(): AuthenticationMethod | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,6 @@ data class OidcAuthConfiguration( | |
init { | ||
runBlocking { init() } | ||
} | ||
|
||
override fun authMethod() = OIDC | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...altid-ktor-authnz/src/main/kotlin/id/walt/ktorauthnz/methods/data/AuthMethodStoredData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
package id.walt.ktorauthnz.methods.data | ||
|
||
import id.walt.ktorauthnz.methods.AuthenticationMethod | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
sealed interface AuthMethodStoredData | ||
sealed interface AuthMethodStoredData { | ||
fun authMethod(): AuthenticationMethod | ||
} |
7 changes: 5 additions & 2 deletions
7
...waltid-ktor-authnz/src/main/kotlin/id/walt/ktorauthnz/methods/data/EmailPassStoredData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package id.walt.ktorauthnz.methods.data | ||
|
||
import id.walt.ktorauthnz.methods.EmailPass | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
@SerialName("emailpass-data") | ||
@SerialName("email") | ||
data class EmailPassStoredData( | ||
val password: String, | ||
) : AuthMethodStoredData | ||
) : AuthMethodStoredData { | ||
override fun authMethod() = EmailPass | ||
} |
7 changes: 5 additions & 2 deletions
7
...h/waltid-ktor-authnz/src/main/kotlin/id/walt/ktorauthnz/methods/data/FlowAmendmentData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
package id.walt.ktorauthnz.methods.data | ||
|
||
import id.walt.ktorauthnz.flows.AuthFlow | ||
import id.walt.ktorauthnz.methods.virtual.GlobalIdentify | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
@SerialName("flowamendment-data") | ||
@SerialName("flowamendment") | ||
data class FlowAmendmentData( | ||
val appendFlow: Set<AuthFlow>? = null, | ||
var replaceFlow: Set<AuthFlow>? = null, | ||
) : AuthMethodStoredData | ||
) : AuthMethodStoredData { | ||
override fun authMethod() = GlobalIdentify | ||
} |
Oops, something went wrong.