Compare commits

...

7 Commits

Author SHA1 Message Date
Max Goedjen
1947b326a4 Scheudle timer on mian 2024-01-20 19:47:55 -08:00
Max Goedjen
3df4bcef3c . 2024-01-20 19:08:20 -08:00
Max Goedjen
18ba03bf03 . 2024-01-20 19:07:00 -08:00
Riccardo Pesciarelli
85a7a64bc9 Updated Italian localization strings (#520)
* 🇮🇹 Initial proposal for Italian localization

* 🇮🇹 Updated Italian localization

---------

Co-authored-by: Max Goedjen <max.goedjen@gmail.com>
2024-01-18 17:35:36 +00:00
Max Goedjen
409efa5f9f Use Apple Silicon runners (#519)
* Test running on XL (does this work for OSS projects?)

* Move over test/release
2024-01-17 19:28:29 +00:00
Max Goedjen
bb63ae8469 Set min width/height for setup. (#518) 2024-01-17 04:08:48 +00:00
Max Goedjen
30c1d36974 Mark newlines as verbatim (#517)
* Merge

* Add missing key
2024-01-17 03:49:14 +00:00
10 changed files with 99 additions and 22 deletions

View File

@@ -5,8 +5,8 @@ on:
- cron: "0 8 * * *" - cron: "0 8 * * *"
jobs: jobs:
build: build:
# runs-on: macOS-latest # runs-on: macOS-latest-xlarge
runs-on: macos-13 runs-on: macos-13-xlarge
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@@ -6,8 +6,8 @@ on:
- '*' - '*'
jobs: jobs:
test: test:
# runs-on: macOS-latest # runs-on: macOS-latest-xlarge
runs-on: macos-13 runs-on: macos-13-xlarge
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@@ -3,8 +3,8 @@ name: Test
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
test: test:
# runs-on: macOS-latest # runs-on: macOS-latest-xlarge
runs-on: macos-13 runs-on: macos-13-xlarge
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@@ -44,7 +44,7 @@ let package = Package(
.target( .target(
name: "SecureEnclaveSecretKit", name: "SecureEnclaveSecretKit",
dependencies: ["SecretKit"], dependencies: ["SecretKit"],
swiftSettings: [.enableExperimentalFeature("StrictConcurrency"), .unsafeFlags(["-warnings-as-errors"])] swiftSettings: [.unsafeFlags(["-warnings-as-errors"])]
), ),
.target( .target(
name: "SmartCardSecretKit", name: "SmartCardSecretKit",

View File

@@ -17,7 +17,7 @@ public protocol Secret: Identifiable, Hashable {
} }
/// The type of algorithm the Secret uses. Currently, only elliptic curve algorithms are supported. /// The type of algorithm the Secret uses. Currently, only elliptic curve algorithms are supported.
public enum Algorithm: Hashable { public enum Algorithm: Hashable, Sendable {
case ellipticCurve case ellipticCurve
case rsa case rsa

View File

@@ -5,7 +5,7 @@ import SecretKit
extension SecureEnclave { extension SecureEnclave {
/// An implementation of Secret backed by the Secure Enclave. /// An implementation of Secret backed by the Secure Enclave.
public struct Secret: SecretKit.Secret { public struct Secret: SecretKit.Secret, Sendable {
public let id: Data public let id: Data
public let name: String public let name: String

View File

@@ -180,7 +180,7 @@ extension SecureEnclave {
public func persistAuthentication(secret: Secret, forDuration duration: TimeInterval) throws { public func persistAuthentication(secret: Secret, forDuration duration: TimeInterval) throws {
let newContext = LAContext() let newContext = LAContext()
newContext.touchIDAuthenticationAllowableReuseDuration = duration newContext.touchIDAuthenticationAllowableReuseDuration = max(duration, LATouchIDAuthenticationMaximumAllowableReuseDuration)
newContext.localizedCancelTitle = String(localized: "auth_context_request_deny_button") newContext.localizedCancelTitle = String(localized: "auth_context_request_deny_button")
let formatter = DateComponentsFormatter() let formatter = DateComponentsFormatter()
@@ -196,6 +196,23 @@ extension SecureEnclave {
guard success else { return } guard success else { return }
let context = PersistentAuthenticationContext(secret: secret, context: newContext, duration: duration) let context = PersistentAuthenticationContext(secret: secret, context: newContext, duration: duration)
self?.persistedAuthenticationContexts[secret] = context self?.persistedAuthenticationContexts[secret] = context
// Contexts will expire within LATouchIDAuthenticationMaximumAllowableReuseDuration unless we periodically refresh them
if duration > LATouchIDAuthenticationMaximumAllowableReuseDuration {
DispatchQueue.main.async {
Timer.scheduledTimer(withTimeInterval: LATouchIDAuthenticationMaximumAllowableReuseDuration - 10, repeats: true) { [weak self] timer in
print("Refreshing context")
guard let refreshContext = self?.persistedAuthenticationContexts[secret] else { return }
guard refreshContext.valid else {
timer.invalidate()
return
}
refreshContext.context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: "Refresh") { success, _ in
guard success else { return }
print("Refreshed")
}
}
}
}
} }
} }

View File

@@ -1,12 +1,6 @@
{ {
"sourceLanguage" : "en", "sourceLanguage" : "en",
"strings" : { "strings" : {
"\n" : {
},
"\n\n" : {
},
"agent_not_running_notice_title" : { "agent_not_running_notice_title" : {
"localizations" : { "localizations" : {
"de" : { "de" : {
@@ -429,6 +423,12 @@
"value" : "déverrouiller le secret \"%1$@\" pendant %2$@" "value" : "déverrouiller le secret \"%1$@\" pendant %2$@"
} }
}, },
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "sblocca il Segreto \"%1$@\" per %2$@"
}
},
"pt-BR" : { "pt-BR" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -465,6 +465,12 @@
"value" : "déverrouiller le secret \"%1$@\"" "value" : "déverrouiller le secret \"%1$@\""
} }
}, },
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "sblocca il Segreto \"%1$@\""
}
},
"pt-BR" : { "pt-BR" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -501,6 +507,12 @@
"value" : "déchiffrer les données en utilisant le secret \"%1$@\"." "value" : "déchiffrer les données en utilisant le secret \"%1$@\"."
} }
}, },
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "decifra i dati usando il Segreto \"%1$@\""
}
},
"pt-BR" : { "pt-BR" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -537,6 +549,12 @@
"value" : "Refuser" "value" : "Refuser"
} }
}, },
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "Nega"
}
},
"pt-BR" : { "pt-BR" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -573,6 +591,12 @@
"value" : "chiffrer les données en utilisant le secret \"%1$@\"" "value" : "chiffrer les données en utilisant le secret \"%1$@\""
} }
}, },
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "cifra i dati usando il Segreto \"%1$@\""
}
},
"pt-BR" : { "pt-BR" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -609,6 +633,12 @@
"value" : "signer une requête de \"%1$@\" en utilisant le secret \"%2$@\"" "value" : "signer une requête de \"%1$@\" en utilisant le secret \"%2$@\""
} }
}, },
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "firma la richiesta di \"%1$@\" usando il Segreto \"%2$@\""
}
},
"pt-BR" : { "pt-BR" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -645,6 +675,12 @@
"value" : "vérifier une signature en utilisant le secret \"%1$@\"" "value" : "vérifier une signature en utilisant le secret \"%1$@\""
} }
}, },
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "verifica una firma usando il segreto \"%1$@\""
}
},
"pt-BR" : { "pt-BR" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -2124,6 +2160,12 @@
"value" : "Enclave sécurisée" "value" : "Enclave sécurisée"
} }
}, },
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "Secure Enclave"
}
},
"pt-BR" : { "pt-BR" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -2843,6 +2885,12 @@
"value" : "Carte à puce" "value" : "Carte à puce"
} }
}, },
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "Smart Card"
}
},
"pt-BR" : { "pt-BR" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -2878,6 +2926,12 @@
"value" : "Sans nom" "value" : "Sans nom"
} }
}, },
"it" : {
"stringUnit" : {
"state" : "translated",
"value" : "Anonimo"
}
},
"pt-BR" : { "pt-BR" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
@@ -3368,6 +3422,12 @@
"value" : "Secretive %1$@" "value" : "Secretive %1$@"
} }
}, },
"pt-BR" : {
"stringUnit" : {
"state" : "translated",
"value" : "Secretive %1$@"
}
},
"zh-Hans" : { "zh-Hans" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",

View File

@@ -26,7 +26,7 @@ struct SetupView: View {
} }
} }
} }
.frame(idealWidth: 500, idealHeight: 500) .frame(minWidth: 500, idealWidth: 500, minHeight: 500, idealHeight: 500)
} }

View File

@@ -42,16 +42,16 @@ struct UpdateDetailView<UpdaterType: Updater>: View {
if let prefix = split.first { if let prefix = split.first {
switch prefix { switch prefix {
case "#": case "#":
attributed = Text(unprefixed).font(.title) + Text("\n") attributed = Text(unprefixed).font(.title) + Text(verbatim: "\n")
case "##": case "##":
attributed = Text(unprefixed).font(.title2) + Text("\n") attributed = Text(unprefixed).font(.title2) + Text(verbatim: "\n")
case "###": case "###":
attributed = Text(unprefixed).font(.title3) + Text("\n") attributed = Text(unprefixed).font(.title3) + Text(verbatim: "\n")
default: default:
attributed = Text(line) + Text("\n\n") attributed = Text(line) + Text(verbatim: "\n\n")
} }
} else { } else {
attributed = Text(line) + Text("\n\n") attributed = Text(line) + Text(verbatim: "\n\n")
} }
text = text + attributed text = text + attributed
} }