All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.nemerosa.ontrack.model.security.AuthenticationSourceRepository.kt Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
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