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() {
|
func getAuthMethods() {
|
||||||
var method: CInt
|
var recievedMethod: CInt
|
||||||
method = ssh_userauth_list(session, host.username)
|
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() {
|
func openShell() {
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ struct foregroundColorStyle: ViewModifier {
|
|||||||
if #available(iOS 17.0, *) {
|
if #available(iOS 17.0, *) {
|
||||||
if let color = color {
|
if let color = color {
|
||||||
content.foregroundStyle(color)
|
content.foregroundStyle(color)
|
||||||
|
} else {
|
||||||
|
content
|
||||||
}
|
}
|
||||||
content
|
|
||||||
} else {
|
} else {
|
||||||
content.foregroundColor(color)
|
content.foregroundColor(color)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user