MechanismParser

abstract class MechanismParser

Base class for converting mechanism URIs to useful data. Extracts common information (scheme, type, version, issuer and account name). All information stored as parameters are converted to a map. Subclasses on this class must implement postProcess(), which verifies that all required information is present, and transforms it as required.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val ACCOUNT_NAME: String = "accountname"
The identity account name
Link copied to clipboard
val BG_COLOR: String = "b"
The identity color
Link copied to clipboard
val IMAGE: String = "image"
The identity image
Link copied to clipboard
val ISSUER: String = "issuer"
The IDP that issued the URI
Link copied to clipboard
val POLICIES: String = "policies"
The Authenticator Policies.
Link copied to clipboard
val SCHEME: String = "scheme"
The protocol of the URI
Link copied to clipboard
private val SLASH: String = "/"
Link copied to clipboard
private val TAG: String
Link copied to clipboard
val TYPE: String = "authority"
The type of OTP (TOTP or HOTP)
Link copied to clipboard
val UNTITLED: String = "Untitled"
Unknown identity
Link copied to clipboard
val VERSION: String = "version"
The URI API Version

Functions

Link copied to clipboard
protected fun containsNonEmpty(values: Map<String, String>, key: String): Boolean
Link copied to clipboard
protected open fun getBase64DecodedString(value: String): String
Link copied to clipboard
protected open fun getUriParameters(uriString: String): Map<String, String>
Link copied to clipboard
protected open fun isBase64Encoded(value: String): Boolean
Link copied to clipboard
fun map(uriScheme: String): Map<String, String>
Call through to map
private open fun map(uri: URI): Map<String, String>
Parse the URI into a more useful Map format with known keys.
Link copied to clipboard
protected abstract fun postProcess(values: Map<String, String>): Map<String, String>
Validates the parsed URI values
Link copied to clipboard
protected open fun split(s: String, sep: String): Array<String>
Link copied to clipboard
private open fun stripSlash(s: String): String