migueldeicaza / SwiftTermApp

MIT License
305 stars 29 forks source link

URL handler #106

Closed migueldeicaza closed 2 years ago

migueldeicaza commented 2 years ago

Need to register url handlers for various transports like ssh:// or swifttermapp:// with syntax like this:

prefix://[username]@[hostname]:[port number]‌
MichaelRumpler commented 2 years ago

Please also add the password:

prefix://[username]:[password]@[hostname]:[port number]‌

As the password can include special characters, it must be url encoded.

If all parameters are there, the app should connect right away without showing another screen which the user has to confirm.

The ssh: scheme alone is a problem, because other apps also handle it. If you try to start a ssh: url, then iOS starts the app which was installed/updated last. This is more or less random. The user can not choose between the apps which handle the scheme (in contrast to Android).

migueldeicaza commented 2 years ago

I have implemented ssh:// and swifttermapp:// but I have not implemented password, I think this is generally frowned upon.

MichaelRumpler commented 2 years ago

I think this is generally frowned upon.

Why? Yes, a malicious app could also register for the swifttermapp scheme, but the user would immediately recognize it because SwiftTerm won't start and (hopefully) report the other app.

Yesterday SwiftTermApp was started when I tried to open a ssh:// url. It tried to connect to the host, but there was an error because the password was incorrect (because you ignored it). There was no way to enter (or paste) the password manually.

Today I installed SwiftTermApp 1.3 (197) fresh from TestFlight. Now ssh:// starts SwiftTermApp, but it doesn't start a session. It doesn't even show the parameters from the url anywhere. When I try to start a swifttermapp:// url, then SwiftTermApp isn't even started. It almost seems like this is an older version than yesterday.