UriParser
public final class UriParser : Sendable
Base class for URI parsers with common functionality.
-
Declaration
Swift
public static let mfauthScheme: String -
Declaration
Swift
public static let issuerParam: String -
Declaration
Swift
public static let userIdParam: String -
Declaration
Swift
public static let userIdParamOath: String -
Declaration
Swift
public static let imageUrlParam: String -
Declaration
Swift
public static let backgroundColorParam: String -
Declaration
Swift
public static let policiesParam: String -
Declaration
Swift
public init()
-
Parses the issuer and account name from the label component of a URI.
Throws
UriParseError.issuerMismatchif the issuer parameter doesn’t match the label issuer.Declaration
Swift
public func parseLabelComponents(_ label: String, issuerParam: String?) throws -> (issuer: String, accountName: String)Parameters
labelThe label from the URI path (format: “Issuer:AccountName”).
issuerParamThe issuer from the URI query parameter (optional).
Return Value
A tuple containing the issuer and account name.
-
Formats the background color for URI inclusion by removing the “#” prefix if present.
Declaration
Swift
public func formatBackgroundColor(_ backgroundColor: String?) -> String?Parameters
backgroundColorThe background color string to format.
Return Value
The formatted background color value, or nil if input is nil.
View on GitHub