net.nemerosa.ontrack.model.security.AuthenticationSourceRepository.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-model Show documentation
Show all versions of ontrack-model Show documentation
Ontrack module: ontrack-model
package net.nemerosa.ontrack.model.security
import net.nemerosa.ontrack.model.exceptions.AuthenticationSourceNotFoundException
interface AuthenticationSourceRepository {
/**
* List of all authentication sources
*/
val authenticationSources: List
/**
* List of all authentication source providers
*/
val authenticationSourceProviders: List
/**
* Gets an authentication source provider using its ID.
*/
fun getAuthenticationSourceProvider(provider: String): AuthenticationSourceProvider
/**
* Gets an authentication source using the provider ID and the source name.
*/
fun getAuthenticationSource(provider: String, source: String): AuthenticationSource? =
getAuthenticationSourceProvider(provider)
.sources
.find { it.key == source }
/**
* Gets an authentication source using the provider ID and the source name.
*/
fun getRequiredAuthenticationSource(provider: String, source: String): AuthenticationSource =
getAuthenticationSource(provider, source)
?: throw AuthenticationSourceNotFoundException(provider, source)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy