Skip to content

Conversation

@dmitrytrager
Copy link
Collaborator

Implement Device model with SHA256-hashed API keys, join tables for provider/topic associations, and Bearer token authentication for the device API. Includes services for key generation, device creation, and key regeneration with soft revocation support.

What Issue Does This PR Cover, If Any?

Resolves
#564
#565

What Changed? And Why Did It Change?

  • added new models for device and join tables between device and providers/topics
  • added flow for adding new device, with api key, and key regeneration
  • introduced API for device auth

How Has This Been Tested?

Added several specs for services and requests

Please Provide Screenshots

Additional Comments

Implement Device model with SHA256-hashed API keys, join tables for
provider/topic associations, and Bearer token authentication for the
device API. Includes services for key generation, device creation,
and key regeneration with soft revocation support.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dmitrytrager dmitrytrager force-pushed the feature/device-management-api-keys branch from 6bc3457 to 70c6b92 Compare February 3, 2026 10:21
Each device now belongs to a region in addition to a language,
allowing location-based scoping of device content delivery.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dmitrytrager dmitrytrager marked this pull request as ready for review February 3, 2026 10:44
# fk_rails_... (language_id => languages.id)
#
class Device < ApplicationRecord
belongs_to :language
Copy link
Collaborator Author

@dmitrytrager dmitrytrager Feb 3, 2026

Choose a reason for hiding this comment

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

This may be redundant, not sure

# fk_rails_... (device_id => devices.id)
# fk_rails_... (provider_id => providers.id)
#
class DeviceProvider < ApplicationRecord
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Join models can be redundant as well

Rename all tables, models, controllers, services, routes, specs,
and factories from device/Device to beacon/Beacon to better reflect
the domain terminology.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dmitrytrager dmitrytrager merged commit 12b994c into main Feb 3, 2026
4 checks passed
@dmitrytrager dmitrytrager deleted the feature/device-management-api-keys branch February 3, 2026 11:11
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.

3 participants