Closed noskillahh closed 5 years ago
So as a total noob Ive been doing my best to make something out of the data in the redis db. I have found certain API-keys in full, in the form of gw2_discord:response_cache keys. These keys have a TTL and there do not seem to be response_cache keys for every user_token key. I am trying to query these API's to find out about certain guild memberships, to give you an idea of why I want to get the full API key.
Hi,
The users API keys should be stored in the hash gw2_discord:user_keys, with the users discord id as the key.
Hey Nabrok,
Thanks for the reply. I have found these keys, but the api key listed here isnt listed in full. It seems to only save (atleast how I can see it) the first three parts of the api key. I cant query any api key as it is saved in these keys in the db. Any idea?
That should be the full key. Are you viewing with the redis CLI?
hkeys gw2_discord:user_keys
To list available keys and then
hget gw2_discord:user_keys [ID]
To view one of them.
This is what I see in my redis:
hkeys gw2_discord:user_tokens [] hget gw2_discord:user_tokens 310166759854309398 (nil) get gw2_discord:user_tokens:310166759854309398 "{"id":"30D9D707-938C-BE4B-B1D5-E98F508D1849","name":"VF35G","permissions":["account"]}"
That key there in the end isnt the complete one. Im fucking it up?
user_keys
, not user_tokens
.
Thanks dude, got it like this. Sorry for bothering you.
Hi Nabrok,
sorry for bothering you. So when people change servers, the bot will see that their server was changed and update their server role accordingly. I was looking in the redis database, and to my surprise I could not find any full length API-keys anywhere in the db. How does the bot query API-keys? If I look up my own Discord ID in the db, the API-key I get in return cant be queried by me. Its not full length. Am I missing something here? Is it possible to find full length API-keys anywhere? Thanks in advance.