Skip to content

Return and accept the standard IronCore device format - #151

Merged
skeet70 merged 8 commits into
mainfrom
standard-device-format
Oct 16, 2026
Merged

skeet70 merged 8 commits into
mainfrom
standard-device-format

Conversation

@skeet70

@skeet70 skeet70 commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Closes #27. Closes #137. Closes #91.

User.generateDeviceKeys() now returns the device format shared by the other IronCore SDKs (accountId, segmentId, devicePrivateKey, signingPrivateKey) plus the new device's deviceId, name, created, and lastUpdated, matching ironoxide's DeviceAddResult. The deviceId comes from the device add response, which was previously discarded, and can be passed to SDK.user.deleteDevice() to revoke the device.

initialize() accepts a DeviceContext object in addition to the existing four positional arguments, so the result of generateDeviceKeys() or a device JSON from ironoxide can be passed directly.

This is additive and goes out as 1.3.0. The old accountID, segmentID, deviceKeys, and signingKeys fields are still returned and marked @deprecated in ironnode.d.ts.

SDK.user.listDevices() is typed with the new UserDevice interface, which adds publicSigningKey. The API already returns it (IronCoreLabs/ironcore-id#853) and the SDK already passed it through, so this is a type-only change, matching ironweb's UserDevice.

Added SDK.user.deleteDeviceByPublicSigningKey(publicSigningKey) and IronNode.User.deleteDeviceByPublicSigningKey(jwt, publicSigningKey), matching ironweb's pair. Both resolve with {id} like deleteDevice(). Deleting the SDK's own device through SDK.user clears the session, the same as deleteDevice() with no ID.

UserDevice.name is now string | null. ironcore-id returns null for devices created without a deviceName. TypeScript callers that read name without a null check will see a compile error, but this ships in 1.3.0 as a bug fix.

Other changes:

  • integration/sdkOperation.ts initializes from the saved device object. A .device.json generated before this change needs to be regenerated.
  • examples/.device_keys is converted to the shared format (same keys), and examples/dek-reuse uses initialize(deviceContext) with ^1.3.0. Its yarn.lock still pins 1.2.0 and needs yarn upgrade @ironcorelabs/ironnode once 1.3.0 is published.

Docs: IronCoreLabs/website#1508.

Verification

  • Lint, tsc --noEmit, and the full jest suite pass (391 tests).
  • initialize() from src/ with the converted examples/.device_keys succeeded against the live API.
  • SDK.user.deleteDeviceByPublicSigningKey() with a nonexistent key containing / and + reached the live API route and was rejected as not accessible for the user; the session and device list were unaffected.
  • generateDeviceKeys() was not run against the live API, since it creates a device.

@skeet70
skeet70 requested a review from a team as a code owner October 14, 2026 17:47
@skeet70
skeet70 requested review from BobWall23 and coltfred and removed request for a team and BobWall23 October 14, 2026 17:47

@coltfred coltfred left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@skeet70
skeet70 merged commit d63f8e0 into main Oct 16, 2026
3 checks passed
@skeet70
skeet70 deleted the standard-device-format branch October 16, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants