mirror of
				https://github.com/maxgoedjen/secretive.git
				synced 2025-11-04 09:20:56 +00:00 
			
		
		
		
	Cleanup
This commit is contained in:
		
							parent
							
								
									25434aa31c
								
							
						
					
					
						commit
						cac207f6c9
					
				@ -5754,6 +5754,17 @@
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "create_secret_key_type_macOS_update_required_label" : {
 | 
			
		||||
      "extractionState" : "manual",
 | 
			
		||||
      "localizations" : {
 | 
			
		||||
        "en" : {
 | 
			
		||||
          "stringUnit" : {
 | 
			
		||||
            "state" : "translated",
 | 
			
		||||
            "value" : "Unavailable on this version of macOS"
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "create_secret_mldsa_warning" : {
 | 
			
		||||
      "extractionState" : "manual",
 | 
			
		||||
      "localizations" : {
 | 
			
		||||
@ -17031,9 +17042,6 @@
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "macOS Tahoe or Later Required" : {
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
    "no_secure_storage_description" : {
 | 
			
		||||
      "extractionState" : "manual",
 | 
			
		||||
 | 
			
		||||
@ -78,12 +78,16 @@ public struct KeyAvailability: Sendable {
 | 
			
		||||
 | 
			
		||||
    public struct UnavailableKeyType: Sendable {
 | 
			
		||||
        public let keyType: KeyType
 | 
			
		||||
        public let reason: LocalizedStringResource
 | 
			
		||||
        public let reason: Reason
 | 
			
		||||
 | 
			
		||||
        public init(keyType: KeyType, reason: LocalizedStringResource) {
 | 
			
		||||
        public init(keyType: KeyType, reason: Reason) {
 | 
			
		||||
            self.keyType = keyType
 | 
			
		||||
            self.reason = reason
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public enum Reason: Sendable {
 | 
			
		||||
            case macOSUpdateRequired
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -198,7 +198,7 @@ extension SecureEnclave {
 | 
			
		||||
                    .ecdsa256,
 | 
			
		||||
                ] + (isAtLeastMacOS26 ? macOS26Keys : []),
 | 
			
		||||
                unavailable: (isAtLeastMacOS26 ? [] : macOS26Keys).map {
 | 
			
		||||
                    KeyAvailability.UnavailableKeyType(keyType: $0, reason: "macOS Tahoe or Later Required")
 | 
			
		||||
                    KeyAvailability.UnavailableKeyType(keyType: $0, reason: .macOSUpdateRequired)
 | 
			
		||||
                }
 | 
			
		||||
            )
 | 
			
		||||
        }()
 | 
			
		||||
 | 
			
		||||
@ -61,19 +61,15 @@ extension Preview {
 | 
			
		||||
        var name: String { "Modifiable Preview Store" }
 | 
			
		||||
        let secrets: [Secret]
 | 
			
		||||
        var supportedKeyTypes: KeyAvailability {
 | 
			
		||||
            let macOS26Keys: [KeyType] = [.mldsa65, .mldsa87]
 | 
			
		||||
            let isAtLeastMacOS26 = if #available(macOS 26, *) {
 | 
			
		||||
                true
 | 
			
		||||
            } else {
 | 
			
		||||
                false
 | 
			
		||||
            }
 | 
			
		||||
            return KeyAvailability(
 | 
			
		||||
                available: [
 | 
			
		||||
                    .ecdsa256,
 | 
			
		||||
                ] + (isAtLeastMacOS26 ? macOS26Keys : []),
 | 
			
		||||
                unavailable: (isAtLeastMacOS26 ? [] : macOS26Keys).map {
 | 
			
		||||
                    KeyAvailability.UnavailableKeyType(keyType: $0, reason: "macOS Tahoe or Later Required")
 | 
			
		||||
                }
 | 
			
		||||
                    .mldsa65,
 | 
			
		||||
                    .mldsa87
 | 
			
		||||
                ],
 | 
			
		||||
                unavailable: [
 | 
			
		||||
                    .init(keyType: .ecdsa384, reason: .macOSUpdateRequired)
 | 
			
		||||
                ]
 | 
			
		||||
            )
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
@ -78,17 +78,20 @@ struct CreateSecretView<StoreType: SecretStoreModifiable>: View {
 | 
			
		||||
                                ForEach(store.supportedKeyTypes.available, id: \.self) { option in
 | 
			
		||||
                                    Text(String(describing: option))
 | 
			
		||||
                                        .tag(option)
 | 
			
		||||
                                        .font(.caption)
 | 
			
		||||
                                }
 | 
			
		||||
                                Divider()
 | 
			
		||||
                                ForEach(store.supportedKeyTypes.unavailable, id: \.keyType) { option in
 | 
			
		||||
                                    VStack {
 | 
			
		||||
                                        Button {
 | 
			
		||||
                                        } label: {
 | 
			
		||||
                                            Text(String(describing: option.keyType))
 | 
			
		||||
                                            .font(.caption)
 | 
			
		||||
                                        Text(option.reason)
 | 
			
		||||
                                            .font(.caption)
 | 
			
		||||
                                            switch option.reason {
 | 
			
		||||
                                            case .macOSUpdateRequired:
 | 
			
		||||
                                                Text(.createSecretKeyTypeMacOSUpdateRequiredLabel)
 | 
			
		||||
                                            }
 | 
			
		||||
                                    .disabled(true)
 | 
			
		||||
                                        }
 | 
			
		||||
                                    }
 | 
			
		||||
                                    .selectionDisabled()
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            if keyType?.algorithm == .mldsa {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user