passforios/pass/Controllers/KeyImporter.swift
Danny Mösch 1bdf9d684b Rely on SPM plugins to consume SwiftLint and SwiftFormat
Use their latest releases and fix some violations and issues.

# Conflicts:
#	.github/workflows/linting.yml
#	.github/workflows/testing.yml
2024-11-29 00:18:30 +01:00

36 lines
671 B
Swift

//
// KeyImporter.swift
// pass
//
// Created by Danny Moesch on 15.02.20.
// Copyright © 2020 Bob Sun. All rights reserved.
//
import passKit
protocol KeyImporter {
static var keySource: KeySource { get }
static var label: String { get }
static var isCurrentKeySource: Bool { get }
static var menuLabel: String { get }
func isReadyToUse() -> Bool
func importKeys() throws
}
extension KeyImporter {
static var isCurrentKeySource: Bool {
Defaults.gitSSHKeySource == keySource
}
static var menuLabel: String {
if isCurrentKeySource {
return "\(label)"
}
return label
}
}