trzsz-ssh icon indicating copy to clipboard operation
trzsz-ssh copied to clipboard

[suggestion] is it possible to add feature of provider api

Open warjiang opened this issue 11 months ago • 5 comments

provider api means that not only we can get host from location ssh config file, but also from a rest api, the rest api should have some restriction, like data restriction.

warjiang avatar Mar 11 '24 09:03 warjiang

It is technically possible, but there may be some security risks. It will be more complicated, and the requirements for users will be very high.

lonnywong avatar Mar 11 '24 09:03 lonnywong

or may a plugin of trzsa-ssh.

It is technically possible, but there may be some security risks. It will be more complicated, and the requirements for users will be very high.

indeed. tssh provide a open-box options for most of users. If supported this feature, for advanced user, we can provide spec to let them to implemented, for common user, we can provide a subproject in form of docker to reduce the complexity of provide api.

It is technically possible, but there may be some security risks.

cannot agree with this point any more, so we need to have a full consideration.

warjiang avatar Mar 11 '24 09:03 warjiang

Is it possible for users to implement a client themselves, write a custom configuration file after obtaining the informations, and then specify the default configuration file in ~/.tssh.conf?

lonnywong avatar Mar 11 '24 09:03 lonnywong

sounds feasible 👍

warjiang avatar Mar 11 '24 11:03 warjiang

Now you can get the host information from anywhere you want, convert it into ssh command line arguments, and call tssh to log in.

Before v0.1.22 is released, you can go get github.com/trzsz/trzsz-ssh@main, and then call tssh to log in like:

package main

import (
	"os"
	"github.com/trzsz/trzsz-ssh/tssh"
)

func main() {
	code := tssh.TsshMain([]string{"-t", "[email protected]"})
	os.Exit(code)
}

lonnywong avatar Jul 13 '24 16:07 lonnywong