Skip to content

Commit 2113cd0

Browse files
committed
refactor: user friendly name for proxy address
1 parent db5483e commit 2113cd0

7 files changed

Lines changed: 42 additions & 43 deletions

File tree

data/init.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,17 @@ CREATE TABLE IF NOT EXISTS domains(
101101
);
102102
CREATE TABLE IF NOT EXISTS proxyconfigs(
103103
proxy_config_name citext,
104-
access_info citext NOT NULL,
104+
address citext NOT NULL,
105105
info_format integer NOT NULL,
106106
port integer NOT NULL,
107107
network_dns_suffix varchar(192),
108108
creation_date timestamp,
109109
tenant_id varchar(36),
110-
CONSTRAINT access_info_port UNIQUE (access_info, port, tenant_id),
110+
CONSTRAINT proxy_config_name_port_tenant_id UNIQUE (proxy_config_name, tenant_id),
111111
PRIMARY KEY (proxy_config_name, tenant_id)
112112
);
113113
CREATE TABLE IF NOT EXISTS profiles_proxyconfigs(
114114
proxy_config_name citext,
115-
access_info citext,
116115
profile_name citext,
117116
FOREIGN KEY (proxy_config_name,tenant_id) REFERENCES proxyconfigs(proxy_config_name,tenant_id),
118117
FOREIGN KEY (profile_name,tenant_id) REFERENCES profiles(profile_name,tenant_id),

src/data/postgres/tables/proxyConfigs.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('proxy configs tests', () => {
2828
beforeEach(() => {
2929
proxyConfig = {
3030
proxyName: 'proxy profile',
31-
accessInfo: 'proxy.com',
31+
address: 'proxy.com',
3232
infoFormat: 201, // FQDN (201)
3333
port: 1000,
3434
networkDnsSuffix: 'suffix',
@@ -98,7 +98,7 @@ describe('proxy configs tests', () => {
9898
`
9999
SELECT
100100
proxy_config_name as "proxyName",
101-
access_info as "accessInfo",
101+
address as "address",
102102
info_format as "infoFormat",
103103
port as "port",
104104
network_dns_suffix as "networkDnsSuffix",
@@ -124,7 +124,7 @@ describe('proxy configs tests', () => {
124124
`
125125
SELECT
126126
proxy_config_name as "proxyName",
127-
access_info as "accessInfo",
127+
address as "address",
128128
info_format as "infoFormat",
129129
port as "port",
130130
network_dns_suffix as "networkDnsSuffix",
@@ -231,11 +231,11 @@ describe('proxy configs tests', () => {
231231
expect(querySpy).toBeCalledWith(
232232
`
233233
INSERT INTO proxyconfigs
234-
(proxy_config_name, access_info, info_format, port, network_dns_suffix, creation_date, tenant_id)
234+
(proxy_config_name, address, info_format, port, network_dns_suffix, creation_date, tenant_id)
235235
values($1, $2, $3, $4, $5, $6, $7)`,
236236
[
237237
proxyConfig.proxyName,
238-
proxyConfig.accessInfo,
238+
proxyConfig.address,
239239
proxyConfig.infoFormat,
240240
proxyConfig.port,
241241
proxyConfig.networkDnsSuffix,
@@ -278,11 +278,11 @@ describe('proxy configs tests', () => {
278278
expect(querySpy).toBeCalledWith(
279279
`
280280
UPDATE proxyconfigs
281-
SET access_info=$2, info_format=$3, port=$4, network_dns_suffix=$5
281+
SET address=$2, info_format=$3, port=$4, network_dns_suffix=$5
282282
WHERE proxy_config_name=$1 and tenant_id = $6`,
283283
[
284284
proxyConfig.proxyName,
285-
proxyConfig.accessInfo,
285+
proxyConfig.address,
286286
proxyConfig.infoFormat,
287287
proxyConfig.port,
288288
proxyConfig.networkDnsSuffix,
@@ -321,11 +321,11 @@ describe('proxy configs tests', () => {
321321
expect(querySpy).toBeCalledWith(
322322
`
323323
UPDATE proxyconfigs
324-
SET access_info=$2, info_format=$3, port=$4, network_dns_suffix=$5
324+
SET address=$2, info_format=$3, port=$4, network_dns_suffix=$5
325325
WHERE proxy_config_name=$1 and tenant_id = $6`,
326326
[
327327
proxyConfig.proxyName,
328-
proxyConfig.accessInfo,
328+
proxyConfig.address,
329329
proxyConfig.infoFormat,
330330
proxyConfig.port,
331331
proxyConfig.networkDnsSuffix,

src/data/postgres/tables/proxyConfigs.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class ProxyConfigsTable implements IProxyConfigsTable {
5858
`
5959
SELECT
6060
proxy_config_name as "proxyName",
61-
access_info as "accessInfo",
61+
address as "address",
6262
info_format as "infoFormat",
6363
port as "port",
6464
network_dns_suffix as "networkDnsSuffix",
@@ -86,7 +86,7 @@ export class ProxyConfigsTable implements IProxyConfigsTable {
8686
`
8787
SELECT
8888
proxy_config_name as "proxyName",
89-
access_info as "accessInfo",
89+
address as "address",
9090
info_format as "infoFormat",
9191
port as "port",
9292
network_dns_suffix as "networkDnsSuffix",
@@ -172,11 +172,11 @@ export class ProxyConfigsTable implements IProxyConfigsTable {
172172
const results = await this.db.query(
173173
`
174174
INSERT INTO proxyconfigs
175-
(proxy_config_name, access_info, info_format, port, network_dns_suffix, creation_date, tenant_id)
175+
(proxy_config_name, address, info_format, port, network_dns_suffix, creation_date, tenant_id)
176176
values($1, $2, $3, $4, $5, $6, $7)`,
177177
[
178178
proxyConfig.proxyName,
179-
proxyConfig.accessInfo,
179+
proxyConfig.address,
180180
proxyConfig.infoFormat,
181181
proxyConfig.port,
182182
proxyConfig.networkDnsSuffix,
@@ -213,11 +213,11 @@ export class ProxyConfigsTable implements IProxyConfigsTable {
213213
const results = await this.db.query(
214214
`
215215
UPDATE proxyconfigs
216-
SET access_info=$2, info_format=$3, port=$4, network_dns_suffix=$5
216+
SET address=$2, info_format=$3, port=$4, network_dns_suffix=$5
217217
WHERE proxy_config_name=$1 and tenant_id = $6`,
218218
[
219219
proxyConfig.proxyName,
220-
proxyConfig.accessInfo,
220+
proxyConfig.address,
221221
proxyConfig.infoFormat,
222222
proxyConfig.port,
223223
proxyConfig.networkDnsSuffix,

src/models/RCS.Config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ export interface Ieee8021xConfig {
4848
/*
4949
- AddMpServer Method:
5050
51-
AccessInfo: IP or FQDN of MPS server(MaxLen 256)
51+
address: IP or FQDN of MPS server(MaxLen 256)
5252
Port (number)
5353
Username (16 alphanumeric characters)
5454
Password (16 characters)
55-
CN (common name used when AccessInfo is IP address)
55+
CN (common name used when address is IP address)
5656
5757
Additional information that we need to provide when configuring MPS:
5858
@@ -194,7 +194,7 @@ export interface TLSConfigFlow {
194194
}
195195

196196
export interface mpsServer {
197-
AccessInfo: any
197+
address: any
198198
InfoFormat: number
199199
Port: number
200200
AuthMethod: number
@@ -304,8 +304,8 @@ export interface connectionParams {
304304

305305
export interface ProxyConfig {
306306
proxyName: string
307-
accessInfo: string // A string holding the IP address or FQDN of the server
308-
infoFormat: AMT.Types.MPServer.InfoFormat // An enumerated integer describing the format and interpretation of the AccessInfo property (IPv4 (3), IPv6 (4), FQDN (201))
307+
address: string // A string holding the IP address or FQDN of the server
308+
infoFormat: AMT.Types.MPServer.InfoFormat // An enumerated integer describing the format and interpretation of the address property (IPv4 (3), IPv6 (4), FQDN (201))
309309
port: number
310310
networkDnsSuffix: string // Domain name of the network to which this proxy belongs
311311
tenantId: string

src/routes/admin/proxy/proxyValidator.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ export const proxyValidator = (): any => [
2929
])
3030
.withMessage('Server address format should be either 3(IPV4), 4(IPV6) or 201(FQDN)'),
3131

32-
// accessInfo presence
33-
check('accessInfo').not().isEmpty().withMessage('Server address is required'),
32+
// address presence
33+
check('address').not().isEmpty().withMessage('Server address is required'),
3434

35-
// accessInfo format based on infoFormat
36-
check('accessInfo')
35+
// address format based on infoFormat
36+
check('address')
3737
.if((_, { req }) => req.body.infoFormat === 3)
3838
.isIP(4)
3939
.withMessage('infoFormat 3 requires IPV4 server address'),
40-
check('accessInfo')
40+
check('address')
4141
.if((_, { req }) => req.body.infoFormat === 4)
4242
.isIP(6)
4343
.withMessage('infoFormat 4 requires IPV6 server address'),
44-
check('accessInfo')
44+
check('address')
4545
.if((_, { req }) => req.body.infoFormat === 201)
4646
.isFQDN({ require_tld: true, allow_underscores: false, allow_numeric_tld: false })
4747
.withMessage('infoFormat 201 requires FQDN server address'),

src/stateMachines/ciraConfiguration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export class CIRAConfiguration {
192192
addMPS = async ({ input }: { input: CIRAConfigContext }): Promise<any> => {
193193
if (input.amt != null) {
194194
const server: AMT.Models.MPServer = {
195-
AccessInfo: input.ciraConfig?.mpsServerAddress,
195+
address: input.ciraConfig?.mpsServerAddress,
196196
InfoFormat: input.ciraConfig?.serverAddressFormat,
197197
Port: input.ciraConfig?.mpsPort,
198198
AuthMethod: input.ciraConfig?.authMethod,

src/test/collections/rps.postman_collection.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7256,7 +7256,7 @@
72567256
"pm.test(\"Creation should succeed\", function () {\r",
72577257
" var jsonData = pm.response.json();\r",
72587258
" pm.expect(jsonData.proxyName).to.eql(\"proxyabc\");\r",
7259-
" pm.expect(jsonData.accessInfo).to.eql(\"www.proxy-abc.com\");\r",
7259+
" pm.expect(jsonData.address).to.eql(\"www.proxy-abc.com\");\r",
72607260
" pm.expect(jsonData.infoFormat).to.eql(201);\r",
72617261
" pm.expect(jsonData.port).to.eql(902);\r",
72627262
" pm.expect(jsonData.networkDnsSuffix).to.eql(\"intel.com\");\r",
@@ -7285,7 +7285,7 @@
72857285
],
72867286
"body": {
72877287
"mode": "raw",
7288-
"raw": "{\r\n \"proxyName\": \"proxyabc\",\r\n \"accessInfo\": \"www.proxy-abc.com\",\r\n \"infoFormat\": 201,\r\n \"port\": 902,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
7288+
"raw": "{\r\n \"proxyName\": \"proxyabc\",\r\n \"address\": \"www.proxy-abc.com\",\r\n \"infoFormat\": 201,\r\n \"port\": 902,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
72897289
"options": {
72907290
"raw": {
72917291
"language": "json"
@@ -7309,7 +7309,7 @@
73097309
"pm.test(\"Request should return proxy just created\", function () {\r",
73107310
" var jsonData = pm.response.json();\r",
73117311
" pm.expect(jsonData.proxyName).to.eql(\"proxyabctest\");\r",
7312-
" pm.expect(jsonData.accessInfo).to.eql(\"www.proxy-abc.test.com\");\r",
7312+
" pm.expect(jsonData.address).to.eql(\"www.proxy-abc.test.com\");\r",
73137313
" pm.expect(jsonData.infoFormat).to.eql(201);\r",
73147314
" pm.expect(jsonData.port).to.eql(800);\r",
73157315
" pm.expect(jsonData.networkDnsSuffix).to.eql(\"intel.com\");\r",
@@ -7337,7 +7337,7 @@
73377337
],
73387338
"body": {
73397339
"mode": "raw",
7340-
"raw": "{\r\n \"proxyName\": \"proxyabctest\",\r\n \"accessInfo\": \"www.proxy-abc.test.com\",\r\n \"infoFormat\": 201,\r\n \"port\": 800,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
7340+
"raw": "{\r\n \"proxyName\": \"proxyabctest\",\r\n \"address\": \"www.proxy-abc.test.com\",\r\n \"infoFormat\": 201,\r\n \"port\": 800,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
73417341
"options": {
73427342
"raw": {
73437343
"language": "json"
@@ -9990,7 +9990,7 @@
99909990
"header": [],
99919991
"body": {
99929992
"mode": "raw",
9993-
"raw": "{\r\n \"proxyName\": \"\",\r\n \"accessInfo\": \"proxy.dummy.com\",\r\n \"infoFormat\": 201,\r\n \"port\": 900,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
9993+
"raw": "{\r\n \"proxyName\": \"\",\r\n \"address\": \"proxy.dummy.com\",\r\n \"infoFormat\": 201,\r\n \"port\": 900,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
99949994
"options": {
99959995
"raw": {
99969996
"language": "json"
@@ -10014,7 +10014,7 @@
1001410014
"pm.test(\"Result should contain an error and message\", function () {\r",
1001510015
" var jsonData = pm.response.json();\r",
1001610016
" pm.expect(jsonData.errors[0].msg).to.eql(\"Server address is required\");\r",
10017-
" pm.expect(jsonData.errors[0].path).to.eql(\"accessInfo\");\r",
10017+
" pm.expect(jsonData.errors[0].path).to.eql(\"address\");\r",
1001810018
"});"
1001910019
],
1002010020
"type": "text/javascript",
@@ -10033,7 +10033,7 @@
1003310033
"header": [],
1003410034
"body": {
1003510035
"mode": "raw",
10036-
"raw": "{\r\n \"proxyName\": \"proxy1\",\r\n \"accessInfo\": \"\",\r\n \"infoFormat\": 3,\r\n \"port\": 900,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
10036+
"raw": "{\r\n \"proxyName\": \"proxy1\",\r\n \"address\": \"\",\r\n \"infoFormat\": 3,\r\n \"port\": 900,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
1003710037
"options": {
1003810038
"raw": {
1003910039
"language": "json"
@@ -10076,7 +10076,7 @@
1007610076
"header": [],
1007710077
"body": {
1007810078
"mode": "raw",
10079-
"raw": "{\r\n \"proxyName\": \"proxy1\",\r\n \"accessInfo\": \"192.168.9.58\",\r\n \"infoFormat\": 5,\r\n \"port\": 900,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
10079+
"raw": "{\r\n \"proxyName\": \"proxy1\",\r\n \"address\": \"192.168.9.58\",\r\n \"infoFormat\": 5,\r\n \"port\": 900,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
1008010080
"options": {
1008110081
"raw": {
1008210082
"language": "json"
@@ -10119,7 +10119,7 @@
1011910119
"header": [],
1012010120
"body": {
1012110121
"mode": "raw",
10122-
"raw": "{\r\n \"proxyName\": \"proxy1\",\r\n \"accessInfo\": \"192.168.9.58\",\r\n \"infoFormat\": 3,\r\n \"port\": 65536,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
10122+
"raw": "{\r\n \"proxyName\": \"proxy1\",\r\n \"address\": \"192.168.9.58\",\r\n \"infoFormat\": 3,\r\n \"port\": 65536,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
1012310123
"options": {
1012410124
"raw": {
1012510125
"language": "json"
@@ -10162,7 +10162,7 @@
1016210162
"header": [],
1016310163
"body": {
1016410164
"mode": "raw",
10165-
"raw": "{\r\n \"proxyName\": \"proxy1\",\r\n \"accessInfo\": \"192.168.9.58\",\r\n \"infoFormat\": 3,\r\n \"port\": 900,\r\n \"networkDnsSuffix\": \"-intel.com\"\r\n}",
10165+
"raw": "{\r\n \"proxyName\": \"proxy1\",\r\n \"address\": \"192.168.9.58\",\r\n \"infoFormat\": 3,\r\n \"port\": 900,\r\n \"networkDnsSuffix\": \"-intel.com\"\r\n}",
1016610166
"options": {
1016710167
"raw": {
1016810168
"language": "json"
@@ -10185,7 +10185,7 @@
1018510185
"});\r",
1018610186
"pm.test(\"Request should return proxy just created\", function () {\r",
1018710187
" var jsonData = pm.response.json();\r",
10188-
" pm.expect(jsonData.accessInfo).to.eql(\"www.vprodemo.com\");\r",
10188+
" pm.expect(jsonData.address).to.eql(\"www.vprodemo.com\");\r",
1018910189
" pm.expect(jsonData.infoFormat).to.eql(201);\r",
1019010190
" pm.expect(jsonData.port).to.eql(900);\r",
1019110191
" pm.expect(jsonData.networkDnsSuffix).to.eql(\"intel.com\");\r",
@@ -10207,7 +10207,7 @@
1020710207
"header": [],
1020810208
"body": {
1020910209
"mode": "raw",
10210-
"raw": "{\r\n \"proxyName\": \"proxy1\",\r\n \"accessInfo\": \"www.vprodemo.com\",\r\n \"infoFormat\": 201,\r\n \"port\": 900,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
10210+
"raw": "{\r\n \"proxyName\": \"proxy1\",\r\n \"address\": \"www.vprodemo.com\",\r\n \"infoFormat\": 201,\r\n \"port\": 900,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
1021110211
"options": {
1021210212
"raw": {
1021310213
"language": "json"
@@ -10250,7 +10250,7 @@
1025010250
"header": [],
1025110251
"body": {
1025210252
"mode": "raw",
10253-
"raw": "{\r\n \"proxyName\": \"proxy1\",\r\n \"accessInfo\": \"www.vprodemo.com\",\r\n \"infoFormat\": 201,\r\n \"port\": 900,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
10253+
"raw": "{\r\n \"proxyName\": \"proxy1\",\r\n \"address\": \"www.vprodemo.com\",\r\n \"infoFormat\": 201,\r\n \"port\": 900,\r\n \"networkDnsSuffix\": \"intel.com\"\r\n}",
1025410254
"options": {
1025510255
"raw": {
1025610256
"language": "json"

0 commit comments

Comments
 (0)