Open
Conversation
🤖 Nethcti-middleware API structural change detectedStructural change detailsAdded (1)
Powered by Bump.sh |
There was a problem hiding this comment.
Pull request overview
This PR adds a new GET /chat endpoint to provide Matrix chat configuration to users with appropriate permissions. The endpoint returns Matrix homeserver and Acrobits URLs when configured, or an empty object otherwise. Access is restricted to users with the nethvoice_cti.chat capability.
Key Changes:
- New configuration field
MatrixBaseURLloaded fromNETHVOICE_MATRIX_BASE_URLenvironment variable - New handler
ChatInfoHandlerthat returns Matrix configuration based on the environment variable - Comprehensive test coverage including unit tests and capability-based access control tests
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| configuration/configuration.go | Adds MatrixBaseURL field and initialization from environment variable |
| methods/chat.go | Implements ChatInfoHandler that returns Matrix configuration or empty object |
| methods/chat_test.go | Unit tests for handler with and without Matrix URL configured |
| main_test.go | Integration tests verifying capability-based access control for the endpoint |
| main.go | Registers the /chat endpoint with capability middleware protection |
| doc/openapi.yaml | Documents the API endpoint with request/response specifications |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d790fe5 to
ba7c162
Compare
The endpoint can be used by ctiapp-authproxy to provision the mobile app: users with chat capability will have access to messaging function
ba7c162 to
8e168df
Compare
505fa4b to
e23bab1
Compare
edospadoni
approved these changes
Jan 28, 2026
Member
Author
|
Please bear in mind that this changes breaks the compatibility with https://github.com/nethesis/matrix2acrobits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds a new chat integration feature, primarily focused on exposing Matrix chat server configuration and user extension data via a new
/chatAPI endpoint. The changes include configuration, API handler, OpenAPI documentation, supporting data structures, and comprehensive tests.Chat/Matrix Integration API
/chatendpoint (protected by thenethvoice_cti.chatcapability) that returns Matrix homeserver configuration and, optionally, a list of chat users with their extensions. (main.go,methods/chat.go,doc/openapi.yaml) [1] [2] [3] [4]/chatendpoint, including response examples and a newChatUserschema. (doc/openapi.yaml) [1] [2]Configuration Enhancements
NETHVOICE_MATRIX_BASE_URLto configure the Matrix homeserver base URL, with support in the configuration struct and initialization logic. (README.md,configuration/configuration.go) [1] [2] [3]Data Model and Store Updates
MainExtensionandExtensionsfields, and updated parsing logic to extract these from the user profile data. (store/profiles.go) [1] [2]ChatUserstruct andGetAllChatUsersfunction to aggregate chat-capable users and their extensions for the API. (methods/user.go) [1] [2] [3]Testing
/chatendpoint, including capability checks and response validation under various configurations. (main_test.go,methods/chat_test.go) [1] [2]Linked work
PRs for chat implementation:
New repository for chat implementation:
Issues: