You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SaslMechanism.kt 514B

123456789101112131415161718192021
  1. package com.dmdirc.ktirc.sasl
  2. import com.dmdirc.ktirc.IrcClient
  3. import com.dmdirc.ktirc.SaslConfig
  4. internal interface SaslMechanism {
  5. val ircName: String
  6. val priority: Int
  7. fun handleAuthenticationEvent(client: IrcClient, data: ByteArray?)
  8. }
  9. internal fun SaslConfig.createSaslMechanism(): List<SaslMechanism> = mechanisms.mapNotNull {
  10. when (it.toUpperCase()) {
  11. "EXTERNAL" -> ExternalMechanism()
  12. "PLAIN" -> PlainMechanism(this)
  13. else -> null
  14. }
  15. }