Skip to content

Linux Secure Storage #152

Description

@codefiesta

Now that the Keychain storage has been abstracted out, we'll need to implement the preferred secure storage protocol for Linux

#if os(Linux)
struct LinuxStorage: Storage {
   ...
}
#endif

class Keychain: @unchecked Sendable {
    /// Initializes the keychain with an overridden accound identifier.
    /// - Parameter account: a key indicating the account owner. Ideally, use the application identifier for this value.
    public init(_ account: String) {
        assert(account.isNotEmpty, "❌ The account identifier cannot be empty.")
        #if canImport(Security)
        self.storage = DefaultStorage(account: account)
        #elseif os(Android)
        // TODO: Android storage not implemented
        #elseif os(Linux)
        self.storage = LinuxStorage(account: account)
        #endif
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededlinuxLinux related

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions