mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-04-09 18:57:22 +02:00
Compare commits
7 Commits
de8d18f9e9
...
experiment
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1947b326a4 | ||
|
|
3df4bcef3c | ||
|
|
18ba03bf03 | ||
|
|
85a7a64bc9 | ||
|
|
409efa5f9f | ||
|
|
bb63ae8469 | ||
|
|
30c1d36974 |
4
.github/workflows/nightly.yml
vendored
4
.github/workflows/nightly.yml
vendored
@@ -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
|
||||||
|
|||||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -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
|
||||||
|
|||||||
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -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
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ struct SetupView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(idealWidth: 500, idealHeight: 500)
|
.frame(minWidth: 500, idealWidth: 500, minHeight: 500, idealHeight: 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user