-
public class FidoConfigManagerGlobal manager for FIDO UI configuration.
This singleton provides methods to read and modify the configuration that controls FIDO operation behavior and UI presentation. Configuration changes are applied globally and affect all FidoClient instances.
Reading configuration:
// Get current snapshot val config = FidoConfigManager.current // Observe changes reactively FidoConfigManager.configuration.collect { config -> // React to configuration changes }Modifying configuration:
// Set individual properties FidoConfigManager.setIsPinPrioritized(true) FidoConfigManager.setExtensions(listOf(LargeBlobExtension())) FidoConfigManager.setTheme { content -> MyAppTheme { content() } } // Or update atomically FidoConfigManager.update { config -> config.copy(isPinPrioritized = true, fidoExtensions = listOf(...)) } // Or replace entirely FidoConfigManager.replace(FidoConfig(isPinPrioritized = true))Thread safety:
All operations are thread-safe. The configuration flow emits updates atomically.
-
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<FidoConfig>configurationprivate final FidoConfigcurrentpublic final static FidoConfigManagerINSTANCE
-
Method Summary
Modifier and Type Method Description final UnitsetIsPinPrioritized(Boolean value)Sets whether PIN entry should be prioritized before security key interaction. final UnitsetExtensions(List<Extension> extensions)Sets the FIDO extensions to enable for all operations. final UnitsetTheme(Function1<Function0<Unit>, Unit> theme)Sets a custom Compose theme for the FIDO UI screens. final UnitsetIsCustomThemeEnabled(Boolean value)Sets whether to use a custom theme for the FIDO UI screens. final Unitupdate(Function1<FidoConfig, FidoConfig> transform)Atomically updates the configuration using a transform function. final Unitreplace(FidoConfig configuration)Replaces the entire configuration with a new value. final StateFlow<FidoConfig>getConfiguration()final FidoConfiggetCurrent()-
-
Method Detail
-
setIsPinPrioritized
final Unit setIsPinPrioritized(Boolean value)
Sets whether PIN entry should be prioritized before security key interaction.
- Parameters:
value-trueto show PIN entry first,falseto prompt for key touch first.
-
setExtensions
final Unit setExtensions(List<Extension> extensions)
Sets the FIDO extensions to enable for all operations.
- Parameters:
extensions- List of Extension instances to enable, ornullto use the default set of extensions provided by the CTAP2 client.
-
setTheme
final Unit setTheme(Function1<Function0<Unit>, Unit> theme)
Sets a custom Compose theme for the FIDO UI screens.
- Parameters:
theme- A composable function that wraps content with your theme, ornullto use the default theme.
-
setIsCustomThemeEnabled
final Unit setIsCustomThemeEnabled(Boolean value)
Sets whether to use a custom theme for the FIDO UI screens.
- Parameters:
value-trueto use custom theme,falseto use default theme.
-
update
final Unit update(Function1<FidoConfig, FidoConfig> transform)
Atomically updates the configuration using a transform function.
This is useful when you need to modify multiple properties based on the current configuration state.
- Parameters:
transform- A function that receives the current config and returns the new config.
-
replace
final Unit replace(FidoConfig configuration)
Replaces the entire configuration with a new value.
- Parameters:
configuration- The new FidoConfig to set.
-
getConfiguration
final StateFlow<FidoConfig> getConfiguration()
-
getCurrent
final FidoConfig getCurrent()
-
-
-
-