malys / keypirinha-rocketchat

Rocketchat plugin for keypirinha
MIT License
2 stars 1 forks source link

problem with credentials #2

Closed res1st closed 5 years ago

res1st commented 5 years ago

I just seen you keypirinha plug-in for rocket chat. Thank you for your work so far.

But I did't get the user search to work. In my keypirinha config I added these lines:

USER_ID = "bla.blu" DOMAIN = "https://chat.blu.de"

Don't you need a password property or something like that? Is the AUTH property the password? Any idea to get it work?

malys commented 5 years ago

AUTH is not your password but a token. In your personal profile (My Account), Generate a Personal Access Tokens for this use and add it "AUTH" field. Restart keypirinha and It will download channel and users.

If you are interested to improve rocketchat integration, You can participate and I accept Pull requests :)

res1st commented 5 years ago

Thank you Malys, I generated that token but it still doesn't work here. I never coded Python, but I try to find time this year. :)

malys commented 5 years ago

Try to open diagnostic Window in Keypirinha and post console log. You can remove Keypirinha\portable\Local\Packages\rocketchat contains to force to download users list.

res1st commented 5 years ago

Thank you, the Keypirinha console helped me.I assume that my company blocks the ReST api of RocketChat. Do you agree?This is my error message in the console. 14:59:01.486 ** ERROR: Rocketchat.Rocketchat: Could not reach the users to generate the cache:  unknown url type: '/api/v1/users.list?fields={"name":1,"username":2}&query={"active":true,"type":{"$in":["user"]}}&count=2000&offset=0'

Best regardsIngo Am Donnerstag, 17. Oktober 2019, 10:00:55 MESZ hat Malys notifications@github.com Folgendes geschrieben:

Try to open diagnostic Window in Keypirinha and post console log. You can remove Keypirinha\portable\Local\Packages\rocketchat contains to force to download users list.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

malys commented 5 years ago

Probably!!! try to forge a query with curl to be sure. Sometihng like this curl 'xxxxx/api/v1/users.list?fields={"name":1,"username":2}&query={"active":true,"type":{"$in":["user"]}}&count=2000&offset=0' -H "X-Auth-Token:??? " -H "X-User-Id:???" You could detected if it's a network issue or an api version incompatibility.

res1st commented 5 years ago

Hi, the ReST request works with curl.I get a list of users there. But in Keypirinha i still have the same problem. 18:03:14.933 ** ERROR: Rocketchat.Rocketchat: Could not reach the users to generate the cache:  unknown url type: '/api/v1/users.list?fields={"name":1,"username":2}&query={"active":true,"type":{"$in":["user"]}}&count=2000&offset=0

diag windows: Keypirinha 2.22 (48adade) for x64Portable modeDiagnostic timestamp: 2019-10-18T16:04:58+0200Keypirinha uptime: 1m 43sStats gathering: 0.0010s System: WinNT-x64 10.0.17134-ws-0x0100Keyboard layout: 00000407Monitor #1: Name[\.\DISPLAY1] Rect[3840, 0, 5760, 1080] DpiScale[1.00]Monitor #2: Name[\.\DISPLAY4] Rect[1920, 0, 3840, 1080] DpiScale[1.00]Monitor #3: Name[\.\DISPLAY5] Rect[0, 0, 1920, 1080] DpiScale[1.00] PRIMARYMachine NetBIOS name: "CAS-N03709"User name (current thread): "Ingo.Siebert" Official packages: C:\Program Files\Keypirinha\default\PackagesProfile dir: C:\Program Files\Keypirinha\portable\ProfileLocal dir: C:\Program Files\Keypirinha\portable\Local Packages              23Plugins               27Running package tasks 0Pending package tasks 0 TotalHits         747TotalCatalogItems 1597TotalHistoryItems 97TotalKwAssocItems 232TotalKeywords     176FirstHit          2018-11-02T20:52:54+0100LastHit           2019-10-18T16:03:19+0200HistorySpan       349d 19h 10m 25s Package Apps: ... Package Rocketchat:    ID       0x867eb213    Instance #1             Hits         0             CatalogItems 1             HistoryItems 0             KwAssocItems 0             Keywords     0    Plugin   Rocketchat.Rocketchat (0x867eb213.0xfa3c78c7)               Hits         0               CatalogItems 1               HistoryItems 0               KwAssocItems 0               Keywords     0 Am Freitag, 18. Oktober 2019, 16:52:55 MESZ hat Malys notifications@github.com Folgendes geschrieben:

Probably!!! try to forge a query with curl to be sure. Sometihng like this curl 'xxxxx/api/v1/users.list?fields={"name":1,"username":2}&query={"active":true,"type":{"$in":["user"]}}&count=2000&offset=0' -H "X-Auth-Token:??? " -H "X-User-Id:???" It"s perhaps network issue or api version compatibility.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

malys commented 5 years ago

ok I find the origin of problem

add [main] USER_ID = "bla.blu" DOMAIN = "https://chat.blu.de"

The configuration is not set correctly add [main] to ini file.

See example: [main]

Plugin's main configuration section.

AUTH = "auth"

USER_ID = "id"

DOMAIN = "https://open.rocket.chat"

malys commented 5 years ago

For debugging @res1st : see python code

os.environ['DEBUG'] == 'rocketchat'

on windows set DEBUG=rocketchat

malys commented 5 years ago

@res1st can I close this ticket?

res1st commented 5 years ago

Hi, I have these properties set. [main]AUTH = "lzAe6N...."USER_ID = "9mQXnz23aTCFH3QaF"DOMAIN = "https://chat.bla.de" I called "configure rocketchat" in Keypirinha to set it.With DEBUG enabled, I don't get much more important information. 13:03:10.054 Rocketchat.Rocketchat(36): DEBUG: On Start13:03:10.188 Rocketchat.Rocketchat(183): DEBUG: Reading config13:03:10.410 Apps.EnvPath: Cataloged 839 items in 0.5 seconds13:03:10.432 Rocketchat.Rocketchat(80): DEBUG: generate_cache user "lBGe6NNX8ey4MYhEB1g1JCFfHVvY6KK7kp74i6AbGP2" "9mQXnz23aTCFH3QaF" "https://chat.cas.de"13:03:10.502 Rocketchat.Rocketchat(84): DEBUG: C:\Program Files\Keypirinha\portable\Local\Packages\Rocketchat13:03:10.528 ** ERROR: Rocketchat.Rocketchat: Could not reach the users to generate the cache:  unknown url type: '/api/v1/users.list?fields={"name":1,"username":2}&query={"active":true,"type":{"$in":["user"]}}&count=2000&offset=0'13:03:10.535 Rocketchat.Rocketchat(44): DEBUG: On catalog Because I can call the URL in my own tool, I expect that the HTTP request is not build correctly in the plug-in.At the moment I teach myself some Python and Keypirinha basics. Maybe I can find the problem then.

Am Montag, 21. Oktober 2019, 09:51:32 MESZ hat Malys <notifications@github.com> Folgendes geschrieben:  

For debugging @res1st : see python code

os.environ['DEBUG'] == 'rocketchat'

on windows set DEBUG=rocketchat

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

res1st commented 5 years ago

OK, I found the problems. I'll do some pull requests as soon as I find time

malys commented 5 years ago

super!!

malys commented 4 years ago

@res1st have you fixed your problem?