mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 05:19:13 +00:00
make getauthmethods acctually useful loll - still needs work
fix double content on 17.0+ in foregroundStylecolor
This commit is contained in:
@@ -232,8 +232,35 @@ class SSHHandler: ObservableObject {
|
||||
}
|
||||
|
||||
func getAuthMethods() {
|
||||
var method: CInt
|
||||
method = ssh_userauth_list(session, host.username)
|
||||
var recievedMethod: CInt
|
||||
recievedMethod = ssh_userauth_list(session, host.username)
|
||||
|
||||
let allAuthDescriptions: [String] = [
|
||||
"none",
|
||||
"unknown",
|
||||
"password",
|
||||
"hostbased",
|
||||
"publickey",
|
||||
"interactive",
|
||||
"gssapi_mic"
|
||||
]
|
||||
let allAuthRaws: [UInt32] = [
|
||||
SSH_AUTH_METHOD_NONE,
|
||||
SSH_AUTH_METHOD_UNKNOWN,
|
||||
SSH_AUTH_METHOD_PASSWORD,
|
||||
SSH_AUTH_METHOD_HOSTBASED,
|
||||
SSH_AUTH_METHOD_PUBLICKEY,
|
||||
SSH_AUTH_METHOD_INTERACTIVE,
|
||||
SSH_AUTH_METHOD_GSSAPI_MIC
|
||||
]
|
||||
let allAuths = zip(allAuthDescriptions, allAuthRaws)
|
||||
|
||||
for authMethod in allAuths {
|
||||
if authMethod.1 == recievedMethod {
|
||||
print(authMethod.0)
|
||||
}
|
||||
}
|
||||
print(recievedMethod)
|
||||
}
|
||||
|
||||
func openShell() {
|
||||
|
||||
@@ -19,8 +19,9 @@ struct foregroundColorStyle: ViewModifier {
|
||||
if #available(iOS 17.0, *) {
|
||||
if let color = color {
|
||||
content.foregroundStyle(color)
|
||||
} else {
|
||||
content
|
||||
}
|
||||
content
|
||||
} else {
|
||||
content.foregroundColor(color)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user