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

Command icon 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

zaporylie created an issue. See original summary.

pasqualle’s picture

Title: Port module to D8 » Port SSH Key module to D8
voleger’s picture

Can 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.

voleger’s picture

Assigned: Unassigned » voleger
Status: Active » Needs work

Started some conversion, I'll push some updates this weekend

colan’s picture

I'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.

colan’s picture

ChatGPT analysis on the current state of the branch...


[Edit: Removed as it makes this issue too long.]

voleger’s picture

Assigned: voleger » Unassigned

I'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.

colan’s picture

Title: Port SSH Key module to D8 » Port SSH Key module to D8+

It 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.

colan’s picture

Related issues:

Sorry for the delay, folks, but we had to wait for #3566902: Offering to maintain SSH Key to take its course.

colan’s picture

Related issues:
voleger’s picture

We need to create a new branch first.
It has to be main, or 2.0.x, or 3.0.x, or 4.0.x (as it is in https://github.com/coldfrontlabs/drupal-sshkey/tree/4.x)

minoroffense’s picture

For 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 :-/

colan’s picture

👍

voleger’s picture

Version: 7.x-2.x-dev » 4.x-dev
colan’s picture

Thanks. 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.

colan’s picture

  • 24e1adb8 committed on 4.x
    Issue #2986693 by colan: Drupal 11 file category updates.
    
colan’s picture

Sorry, I meant "field" category updates, not "file".

minoroffense’s picture

We 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).

minoroffense’s picture

And 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.

minoroffense’s picture

And 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).

colan’s picture

alpha3 is out.

@voleger: Thanks for the CI fixes! Any ideas on how to fix #3579871: Warning: Undefined array key "description" in FieldStorageAddForm->buildForm()?

colan’s picture

Another issue I just discovered, really two parts: #3579902: Chosen list of acceptable algorithms neither saves nor validates

voleger’s picture

Test runs uncover additional issues, so you may see relevant fixes.

voleger’s picture

Status: Needs work » Needs review

Updated #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?

colan’s picture

Status: Needs review » Fixed

Maybe nothing?

Please reopen if we're missing something.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

colan’s picture

#3577829: Add tests is in now, so let's move the high-level discussion to #3580605: Stable release roadmap.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.