Skip to content
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

Bundle private/public keys in one flat archive #22

Open
aaaaalbert opened this issue Mar 27, 2018 · 5 comments
Open

Bundle private/public keys in one flat archive #22

aaaaalbert opened this issue Mar 27, 2018 · 5 comments

Comments

@aaaaalbert
Copy link
Contributor

Feedback from the SAS 2018 Sensibility Hackathon: The Custom Installer Builder creates new key pairs for users if you don't upload public keys for them. After the Build step, three separate downloads are offered:

  • An archive containing all private keys (if any),
  • An archive containing all public keys, including those that were uploaded,
  • And finally, the customized installers themselves.

Also, the keys archives each contain and thus extract into a directory, public_keys/ and private_keys/, respectively. Navigating these dirs to just copy over the keys to a demokit dir has been described as "a pain", particularly on Windows.

A suggested solution is to,

  1. Put all keys / key pairs into a single archive (to avoid handling multiple archives)
  2. Make the archive "flat", i.e. not contain a subdirectory (so that its contents will extract right into the dir that the archive is placed in)

The place to modify is this bit in packager.py. We'll need to check that the workflow where pubkeys are uploaded keeps working, as our Clearinghouses depend on it.

@yyzhuang, @JustinCappos, let me hear what you think.

@JustinCappos
Copy link
Contributor

JustinCappos commented Mar 27, 2018 via email

@yyzhuang
Copy link

Please go ahead and make the changes, also making sure that uploading keys won't break. Thanks.

@aaaaalbert
Copy link
Contributor Author

One observation from my initial tests: OS X will always extract archives that contain more than one file into a sub-directory of the current working dir. This is still mildly painfull, but at least you can loadkeys keys/username in seash which works as long as the public and private keys are in the same dir.

aaaaalbert added a commit to aaaaalbert/custominstallerbuilder that referenced this issue Mar 28, 2018
This work-in-progress patch addresses SeattleTestbed#22.
It mainly modifies the CIB packager to put all user keys, public and
private, into a single, flat archive.

For this, a few changes in the logic are necessary.

* In `common/constants.py`, replace a few "public/private" constants
  with "keypair" ones
* In `common/packager.py`, modify `package_keys` to conform to the
  new specification -- all keys shall go into a single archive with
  no internal subdirectories
* Also modify the helper functions accordingly
* In `html/static/js/keys.js`, replace the download check function
  for private keys so that the logic hinges on having downloaded
  the keypairs archive now
* In `html/templates/download_keys.html`, replace the private/public
  key download buttons and checks with ones for keypairs.
* In `html/views.py`, remove the use of `has_private_keys` (which
  controlled the download buttons, see above).

More simplifications are possible, I guess, so consider this commit
work in progress!
@JustinCappos
Copy link
Contributor

JustinCappos commented Mar 28, 2018 via email

@aaaaalbert
Copy link
Contributor Author

Alright, here's a running prototype for you to test: https://seattle-dev.engineering.nyu.edu/cib/

Please use (and try to break) it in any way conceivable --- different browsers and OSses, Private tabs and plain ones, all combinations of public keys and CIB-created users, whatever you can think of ---, and provide feedback below.

Also feel free to review the suggested patch, aaaaalbert/custominstallerbuilder@64787d0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants