-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define the scenarios on the Studio for the usage of authWithAPIKey call #35
Comments
we do need the address when auth with api key. otherwise how do we know who is the requester ?
Yes, to know who to grant the request to.
I'm struggling to see that works. Can you elaborate how that will work in your vision? I want to provide a background info for our auth flow because it's a 2 steps system.
Here, we only use the API key on step 1. We didn't use that API key in step 2. |
Okay, I see where our gaps are. The API Key I mentioned is a tradtional API Key, that gives a developer to master operations of all users of one’s application. For example, currently the Studio leverages an API Key. The implementation of it should be separated from the user signature generated AuthToken, due to the below reasons.
Right now the same code manages two different security settings, and my suggestion is that they should be speparated. Their permissions are different, so should the usage, in other words the parameters of authWithAPIKey(). |
no, we don't bind any wallet to an api key.
yes, we're doing that
Yes, we 're doing that too
I think what you're suggesting is we pass the API KEY on every request? Allow me to explain the current design. The API Key and the Auth key are 2 different thing. They use in different context. Every request to create wallet, and manage task require an Auth Key. That's the only way to authentication with us. The Auth Key is a JWT token so we don't need to store session anywhere. There are 2 ways to generate this auth key.
The only thing an API KEY can do is generate an AUTH KEY. It cannot do anything else. We never bind any wallet to API KEY. The AUTH KEY is a JWT KEY and it does encapsulate who generate it (user signature or api key). Without the AUTH KEY concept, every single time a user do something how would they authenticate their request? Notice as an end user, they don't have an API KEY. Well, their only choice is to sign some message to prove the ownership. Then they would need to generate it every single request: list task, view task. That's why I introduce the AUTH KEY concept. As an end-user, take your wallet private key, exchange for an AUTH KEY, with an expiration. Now send that AUTH KEY in every request. Now, when sending data to server, the AUTH KEY already contains information about who are they, they don't need to specify that in the request payload. When you send API KEY directly to every request, suddenly now in the request payload we need to specify it. Therefore, I solve it nicely with the API KEY concept. Where this API KEY doesn't and cannot do anything. It can only use to exchange for an AUTH KEY for any wallet. Effectively allow an app to manipulate user data. I'm open to change. Just want to make sure I understand what you want to achieve. I would be easiser if you can share some sample code in the SDK that you think we should switch to? then I can update the server to match. |
Let’s keep the design for now, and use an address for the owner of API key. What we need is a list of scenarios on the Studio side from the API key.
Currently we don’t have a feature to use on API key to display multiple user’s data. Also for our telegram bot we need scope: write, but for a 3rd party develoeper, only scope: read on the API key. This is related to #36 as well. |
request.setOwner(address)
is added to theauthWithAPIKey
. Since this API key gives the request an admin rights, which could view any wallet address, is there a reason to bind one specific wallet address to it?38b6d89#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80R72
Additionally, I don’t think the third parameter expired_at is needed either. If a developer get an API key from us, the key solely should pass auth and offer admin rights. So basically I’m suggesting,
authWithAPIKey(apiKey)
instead of
authWithAPIKey(walletAddress, apiKey, expiredAt)
The text was updated successfully, but these errors were encountered: