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

feat: support new device ID format #1911

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

andyholmes
Copy link
Collaborator

Update the certificate generation to produce EC-based certificates
with the required device ID format and reject connections from those
with an ID not matching /[a-zA-Z0-9_]{32,38}/.

Migrate installations to new certificates, with device IDs
following the protocol v8 constraints.

closes #1910

@andyholmes andyholmes force-pushed the andyholmes/device-id-verification branch 4 times, most recently from 6fae25a to 3613d85 Compare January 18, 2025 11:51
Comment on lines +52 to +65
_migrateConfiguration() {
if (Device.validateId(this.settings.get_string('id')))
return;

// Remove the old certificate, serving as the single source of truth
// for the device ID
try {
Gio.File.new_build_filenamev([Config.CONFIGDIR, 'certificate.pem'])
.delete(null);
Gio.File.new_build_filenamev([Config.CONFIGDIR, 'private.pem'])
.delete(null);
} catch {
// Silence errors
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks sensible, but I wonder if we need some sort of notification to the user, when the migration process triggers? ("Hey, we had to re-generate your local device ID, so all of your devices need to be re-paired. Lusciously sorry!")

@andyholmes
Copy link
Collaborator Author

I hate this test suite so much, so much.

@ferdnyc
Copy link
Member

ferdnyc commented Jan 18, 2025

I don't mind admitting, it scares the bejesus out of me. I managed to wrap my brain around JUnit1 in a day or two, a while back, at least well enough so that I could accomplish what I needed to. But jasmine? Uh-uh. (And the friction increased by a factor of about 5, once the tests could no longer be run un-installed after the move to ESM.)

  1. (in much the manner that one wraps a car around a telephone pole)

@andyholmes andyholmes force-pushed the andyholmes/device-id-verification branch 3 times, most recently from 9384e5b to de04c0f Compare January 23, 2025 01:39
@andyholmes
Copy link
Collaborator Author

image

@andyholmes andyholmes force-pushed the andyholmes/device-id-verification branch 3 times, most recently from 9bd75d9 to 48d0e80 Compare January 23, 2025 19:50
Update the certificate generation to produce EC-based certificates
with the required device ID format.
Check incoming device IDs and reject connections from those with
an ID not matching `/[a-zA-Z0-9_]{32,38}/`.
Migrate installations to new certificates, with device IDs
following the protocol v8 constraints.
Add a brief notification, explaining that GSConnect has been
updated and some devices may require re-pairing.
@andyholmes andyholmes force-pushed the andyholmes/device-id-verification branch from 48d0e80 to 59be25a Compare January 23, 2025 20:03
@andyholmes
Copy link
Collaborator Author

There's still some bits left to do for protocol v8, so I'm probably going to split this up before review.

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

Successfully merging this pull request may close these issues.

GSConnect device ID format needs to be updated
2 participants