refactor: add http proxy endpoints#2277
Conversation
8848ddf to
4128486
Compare
1bc1bec to
810618a
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds HTTP proxy configuration support by implementing API endpoints for creating and retrieving proxy profiles linked to AMT profiles. The implementation includes validation, database operations, and integration with the existing profile system.
- Add comprehensive proxy profile management with create and read operations
- Integrate proxy configurations into AMT profiles with priority-based ordering
- Implement database schema and operations for proxy profile storage
Reviewed Changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/constants.ts | Code style formatting changes from single to double quotes |
| src/routes/admin/proxies/ | New proxy API endpoints with validation and CRUD operations |
| src/models/ | Extended data models to support proxy configurations |
| src/interfaces/database/ | New database interfaces for proxy profile operations |
| src/data/postgres/tables/ | Database implementation for proxy profile storage and relationships |
| data/init.sql | Database schema for proxy configurations and profile associations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
bf5f561 to
6500fb2
Compare
484cece to
73828d2
Compare
a425614 to
7605988
Compare
6842bbd to
f19d0a2
Compare
| } | ||
|
|
||
| if (amtConfig.proxyConfigs) { | ||
| if (amtConfig.proxyConfigs?.length > 0) { |
There was a problem hiding this comment.
the question mark already checks if proxyConfigs is null or undefined, so remove if condition on 273 as it is redundant
There was a problem hiding this comment.
Hi @rsdmike , tried to remove line 273 but it complains about the following:
Same case for all other comments about the same topic. BTW, I took as reference code on line 263.
| amtConfig.tenantId | ||
| ) | ||
| } | ||
| if (amtConfig.proxyConfigs && amtConfig.proxyConfigs?.length > 0) { |
There was a problem hiding this comment.
same comment here, ? already checks null/undefined
| [accessInfo, tenantId] | ||
| ) | ||
|
|
||
| if (results?.rowCount) { |
| [accessInfo, tenantId] | ||
| ) | ||
|
|
||
| if (results?.rowCount) { |
| proxyConfig.tenantId | ||
| ] | ||
| ) | ||
| if (results?.rowCount) { |
| ) | ||
|
|
||
| latestItem = await this.getByName(proxyConfig.accessInfo, proxyConfig.tenantId) | ||
| if (results?.rowCount) { |
| [configName, tenantId] | ||
| ) | ||
|
|
||
| if (deleteProfileWifiResults?.rowCount) { |
| ) | ||
| ) | ||
|
|
||
| if (proxyProfilesQueryResults?.rowCount) { |
| [tenantId] | ||
| ) | ||
| let count = 0 | ||
| if (result != null && result.rows?.length > 0) { |
There was a problem hiding this comment.
nit: if (result?.rows?.length > 0) {
| [accessInfo, tenantId] | ||
| ) | ||
| if (profiles?.rowCount) { | ||
| if (profiles.rowCount > 0) { |
1937247 to
eaa5a23
Compare
eaa5a23 to
b91c7fe
Compare
|
🎉 This PR is included in version 2.28.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Covering create and select all operations
PR Checklist
What are you changing?
Creating endpoints to support get all and create operations, for http proxies linked to a profile
Anything the reviewer should know when reviewing this PR?
If the there are associated PRs in other repositories, please link them here (i.e. device-management-toolkit/repo#365 )