-
Notifications
You must be signed in to change notification settings - Fork 3
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
Bring 'Stocks' to the app store (Depot / BeSly or create a new repo) #39
Comments
I think that Haikuports will require a recipe. I think that BeSly is already hosting some 'closed' sources software with permissions of their authors though I'm not sure if they need to be able to build them. You may contact Lelldorin or Lorglas for more infos. |
It's impossible to both be a secret and be distributed in an app, even if only in binary form. Much less so when it is part of the URL in HTTP requests. The only way would be to make it a setting and that every user (or group of users) got their own. Or set up a proxy that would add the key and relay the requests to the real server, but that would be open to the same abuse as sharing the key. |
Why not make it easier? The api key not being compiled into the binaries, and instead upon the first launch (or as long as there isn't a saved key) the user is asked to input his/her own API key in a dialog box. If an API key was provided, then the app goes on, otherwise it should quit. The key will not be provided in the package, and instead saved in UserSetupEnvironment or else it could be saved into the keystore using the Key Storage API (https://www.haiku-os.org/docs/api/app_keystore.html). |
Oh. |
I have an idea about mockup above `` BTextControl* APIInput = new BTextControl(NULL,NULL, NULL); BLayoutBuilder::Group<>(this, B_VERTICAL, 0) CenterOnScreen(); `` |
I was also working on an implementation of that mock-up, but with an approach that allows the usage of one or several API keys (perhaps for some strange reason, the user has 2 api keys, one personal free-tiered and another from an enterprise subscription provided by his/her company). I will post the code as soon as I get it done to know how it works. |
I made this mockup app: KeyStoreTest to preview how could my approach work if it is implemented. (The test app could contain dirty code and some unsafe ways to deal with the secrets, but it was made as a concept test, not as a real world app). Although KeyStorage APi is not currently secure, it is better just to make use of the API thinking in the future, when it becomes more secure by default, rather than saving the code in an unencrypted form in UserSetupEnvironment or in a flattened BMessage. But by accessing the KeyStore, at least we are adding an additional dialog box to the user (besides the dialog box asking for the key), and if we add additional features to manage multiple keys, then we could ending up being asked several times by the keystore server for permission for different kind of operations, and that could annoy (or else scare) the user if the api key management is not performed with "just enough calls and no more". Using the other two approaches (saving the key as a environment variable or in a flattened BMessage as an app's settings could then become easier. This is how it is seen:
At start, it tries to access the keystore and the app's keyring (if it does not exist, it creates one). If the user denies access to the keystore, the app shows an error and the user can only quit. If it allows the access, then it searches for any keys. It shows the "Add key" if the app's keyring in the keystore is empty, otherwise it tries to retrieve the default key (from the settings). If there is no default key (none was configured as such or the user previously deleted the key marked as default) it prompts the user to start with any of the keys. The app starts normally when there is a key and it was set as default. If it is too complicated, the example from hfsfox for a single key could be just enough. |
Sorry for the delay. This is the initial version of the changes proposed: I decided (at least by now) to drop the multi-key approach and follow the initial idea of using a single key. This is how it works:
The add key dialog box could also allow the user to choose the saving location, being the keystore or the UBS for more freedom. I disabled the automatic creation of Some additional changes not related to the issue:
Please tell me what do you think about the main changes. |
Looks good so far - thank you for your effort. |
No, not via a receipe - the internal API key should stay as a secret. The package should be added to a repository.
Whats about to create an own repo - server?
The text was updated successfully, but these errors were encountered: