mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-10-12 06:00:56 +00:00
Fix allowedsigners formatting (#744)
This commit is contained in:
parent
275b6ef9bb
commit
65bc6c1a69
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,7 @@ struct ToolConfigurationView: View {
|
||||
|
||||
@State var creating = false
|
||||
@State var selectedSecret: AnySecret?
|
||||
@State var email = ""
|
||||
|
||||
init(selectedInstruction: ConfigurationFileInstructions) {
|
||||
self.selectedInstruction = selectedInstruction
|
||||
@ -48,6 +49,12 @@ struct ToolConfigurationView: View {
|
||||
.tag(secret)
|
||||
}
|
||||
}
|
||||
TextField(text: $email, prompt: Text(.integrationsConfigureUsingEmailPlaceholder)) {
|
||||
Text(.integrationsConfigureUsingEmailTitle)
|
||||
Text(.integrationsConfigureUsingEmailSubtitle)
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
} header: {
|
||||
Text(.integrationsConfigureUsingSecretHeader)
|
||||
}
|
||||
@ -102,9 +109,11 @@ struct ToolConfigurationView: View {
|
||||
func placeholdersReplaced(text: String) -> String {
|
||||
guard let selectedSecret else { return text }
|
||||
let writer = OpenSSHPublicKeyWriter()
|
||||
let gitAllowedSignersString = [email.isEmpty ? String(localized: .integrationsConfigureUsingEmailPlaceholder) : email, writer.openSSHString(secret: selectedSecret)]
|
||||
.joined(separator: " ")
|
||||
let fileController = PublicKeyFileStoreController(homeDirectory: URL.agentHomeURL)
|
||||
return text
|
||||
.replacingOccurrences(of: Instructions.Constants.publicKeyPlaceholder, with: writer.openSSHString(secret: selectedSecret))
|
||||
.replacingOccurrences(of: Instructions.Constants.publicKeyPlaceholder, with: gitAllowedSignersString)
|
||||
.replacingOccurrences(of: Instructions.Constants.publicKeyPathPlaceholder, with: fileController.publicKeyPath(for: selectedSecret))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user