-
Notifications
You must be signed in to change notification settings - Fork 15
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
SSH generation question #155
Comments
For this I was originally going to set up a check to only generate the key if they do not exist in our database (so the first time that they login) but I am thinking that it would be best to check and see if the file actually exists instead, just in case the user deletes the key from their account. This brings up another question though, if the user deletes the key on the account, to my understanding it will do nothing with the private key on the file system. I can do a test to see if the public key exists on the account, and then see if there is a private key within the file system (since we should only ever have one). If its not on the account but is in the file system we could delete it from the file system and then do the whole process over again. Does that sound workable @ZAM- or @apotheos? If so, would you (@ZAM-) be able to add check and delete methods for the private key? |
Sounds workable, I wonder if we'll have enough time to include this before our first release. I say create your pull request assuming the user will never delete the key from their account, and if @ZAM- has time to come through with the other two methods you need, then create another pull request that implements the workflow you described earlier. In other words, we do it in parts. Does that sound fair? |
Certainly sounds fair. For the time being I will do the check based on whether or not their in the database. On that note, thus far I have only used the database locally to test queries and such. for using database functions on the server, is there any setup or files that I need to run before the database will be accessible? |
Run |
awesome thanks |
@wwforg This does sound workable, but I'll be honest with you, since this is close to the end I don't think I'll have enough time to implement these functions. I have other finals to study for. I have a question though, how do we check if the user has deleted the key from GH? There might be some information we grab from the token, but I am not sure. |
Its possible to grab a list of public keys, so we just loop through those and check if our public key is there. I don't know if that's the most efficient way but its definitely possible. |
You would literally have to check the contents of each key @wwforg. It doesn't really matter that it's not efficient because even a power user will probably not have more than a handful of keys, and each key is only about 2024 characters long. |
Thanks for responding honestly @ZAM-, I figured that might be the case. |
Also, GitHub users rarely if ever need to delete keys, so it would be very rare for this particular problem to arise. Still could happen though. |
During our testing we kept running into the issue of whenever we generate a SSH key. If the directory the key will be held in is already created the mkdir() throws and error that the directory already exists. I wasn't sure if we will generate an SSH key for a user more than once. If we only do it once there is no problem but if they have to generate if more than once we need to check if the file or directory is there before we try and make it.
The text was updated successfully, but these errors were encountered: