I need this module for D8 project I'm currently working on so I decided to start a port. Since there is no 8.x branch in this project's repository I keep progress of all the changes I make on github. As soon as I have something on an alpha release state it would be nice to actually merge it back to this repo. If more people would like to get involved it would be nice to move development here asap.
My plan:
- Create FieldType - 3 properties: name (comment?), value (key), fingerprint (md5 hash)
- Create FieldWidget - Textfield for the name, Textarea for the key
- Create FieldFormatter(s) - Fingerprint, Name (fallback to fingerprint)
- Constraint/ConstraintValidator
- Service - calculate fingerprint
Issue fork sshkey-2986693
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pasqualleComment #3
volegerCan be 2.0.x branch introduced for the development? The porting process has to start at some point, so this might help contributors propose changes by creating the issue forks based on the development branch.
Comment #5
volegerStarted some conversion, I'll push some updates this weekend
Comment #6
colanI've opened #3566902: Offering to maintain SSH Key to get this rolling.
@voleger: From your perspective, what are the remaining tasks we still have left to do?
I noticed that the field type hasn't been added yet (as done in the original port on Github). I was expected this to simply extend the long plain text field, but maybe it's fine as it's own thing.
Comment #7
colanChatGPT analysis on the current state of the branch...
[Edit: Removed as it makes this issue too long.]
Comment #8
volegerI'll help to review the changes, it worth to start from branching out to new main or 1.0.x branch and start with small changes in the info file to make the module installable.
Then it make sence enable CI for the project.
After that, focus on metrics provided by CI tools to replace the legacy api one by one. After that, we can extract part of the module that needs to be rewritten.
Comment #9
colanIt turns out that there's already code for this at https://github.com/coldfrontlabs/drupal-sshkey/tree/4.x .
We just need to bring it over here.
@minoroffense: If you want to start moving the code over, please go ahead. Otherwise, I'll get to it in a couple of weeks.
Comment #10
colanSorry for the delay, folks, but we had to wait for #3566902: Offering to maintain SSH Key to take its course.
Comment #11
colanComment #12
volegerWe need to create a new branch first.
It has to be
main, or2.0.x, or3.0.x, or4.0.x(as it is in https://github.com/coldfrontlabs/drupal-sshkey/tree/4.x)Comment #13
minoroffense commentedFor my own sanity lets use 4.x please. Otherwise I'm going to have to remember which branch to commit to depending on where / what I'm doing :-/
Comment #14
colan👍
Comment #15
volegerComment #16
colanThanks. Just pushed 4.x, and cut an alpha release. Now to see what works and what doesn't.
@minoroffense: Any insight you have would be helpful, e.g. are you using it on Production, known gaps from D7, etc.
Comment #17
colanJust got this in: #3577824: Get CI pipelines working
Comment #19
colanSorry, I meant "field" category updates, not "file".
Comment #20
minoroffense commentedWe do use it in prod. I think the schema needs updating. I'm not aware of deprecations we're using. But the phpseclib version might need updating (I haven't checked in a while).
Comment #21
minoroffense commentedAnd there are a couple helper field widgets / services I wanted to add to make it. I put together some quick field formatters to output the public key from a stored private key, get the fingerprint of a key, and various conversions (e.g. like a putty key as a normal rsa key). Basically just wrapping displays around the conversion tools inside of phpseclib3
They were put together real quick and would like benefit from using a service to do the conversions and then config on a unified formatter instead of coding each output individually.
Comment #22
minoroffense commentedAnd we also use the https://www.drupal.org/project/field_encrypt module when storing private keys. But it's not hard required (which it probably should be).
Comment #23
colanalpha3 is out.
@voleger: Thanks for the CI fixes! Any ideas on how to fix #3579871: Warning: Undefined array key "description" in FieldStorageAddForm->buildForm()?
Comment #24
colanAnother issue I just discovered, really two parts: #3579902: Chosen list of acceptable algorithms neither saves nor validates
Comment #25
volegerTest runs uncover additional issues, so you may see relevant fixes.
Comment #26
volegerUpdated #3577829: Add tests
As the module already has an alpha release for recent versions of Drupal, what else needs to be done before we can close this issue?
Comment #27
colanMaybe nothing?
Please reopen if we're missing something.
Comment #29
colan#3577829: Add tests is in now, so let's move the high-level discussion to #3580605: Stable release roadmap.