Skip to content

feat: add ExternalTool model and integrate with User model#21

Open
Imene-Amirat wants to merge 1 commit into
developmentfrom
feature/add-opentheso-apikey-to-user
Open

feat: add ExternalTool model and integrate with User model#21
Imene-Amirat wants to merge 1 commit into
developmentfrom
feature/add-opentheso-apikey-to-user

Conversation

@Imene-Amirat

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings July 8, 2026 09:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new ExternalTool embedded model and wires it into the existing User model so users can store a list of external tool configurations.

Changes:

  • Add LinkedData::Models::Users::ExternalTool as an embedded model.
  • Add externalTools list attribute to LinkedData::Models::User.
  • Enable embedding of externalTools alongside subscription in user hypermedia serialization.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lib/ontologies_linked_data/models/users/user.rb Requires the new model, adds the externalTools attribute, and embeds it in user serialization.
lib/ontologies_linked_data/models/users/external_tool.rb Adds the new ExternalTool embedded model with toolName, apikey, and inverse link back to User.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4 to +7
attribute :toolName, enforce: [:existence]
attribute :apikey, enforce: [:existence]
attribute :user, inverse: { on: :user, attribute: :externalTools }
embedded true
attribute :passwordHash, enforce: [:existence]
attribute :apikey, enforce: [:unique], :default => lambda {|x| SecureRandom.uuid}
attribute :subscription, enforce: [:list, :subscription]
attribute :externalTools, enforce: [:list, :external_tool]
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.

2 participants