Introduce Credential structure to define auth type

For now we are planning to support Password and OAuthToken.
In the future, we would like to add certificate-based authentication.
This commit is contained in:
Mickael Remond
2019-10-01 10:59:55 +02:00
committed by Mickaël Rémond
parent 3b66e31888
commit 9c8353d081
10 changed files with 50 additions and 23 deletions

View File

@@ -32,9 +32,9 @@ func sendxmpp(cmd *cobra.Command, args []string) {
var err error
client, err := xmpp.NewClient(xmpp.Config{
Jid: viper.GetString("jid"),
Address: viper.GetString("addr"),
Password: viper.GetString("password"),
Jid: viper.GetString("jid"),
Address: viper.GetString("addr"),
Credential: xmpp.Password(viper.GetString("password")),
}, xmpp.NewRouter())
if err != nil {