Skip to content

Commit

Permalink
Correct domain address variable naming from "network_addr" to "networ…
Browse files Browse the repository at this point in the history
…k_address"

    Updates names on POST input and GET responses.
    Update documentation.
  • Loading branch information
Misterblue committed Oct 26, 2020
1 parent 36c6a25 commit 8da9cc2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/API-Domains.md
Expand Up @@ -29,7 +29,7 @@ A request returns an array of domain descriptions:
"ice_server_address": stringAddrIceServerBeingUsed,
"version": stringSoftwareVersion,
"protocol_version": stringProtocolVersion,
"network_addr": stringNetworkAddress,
"network_address": stringNetworkAddress,
"networking_mode": stringMode, // one of "full", ...
"restricted": boolWhetherRestricted,
"num_users": intCurrentLoggedInUsers,
Expand Down Expand Up @@ -103,7 +103,7 @@ not included, the value is not set.
"name": stringName,
"version": stringSoftwareVersion,
"protocol": stringProtocolVersion,
"network_addr": stringNetworkAddress,
"network_address": stringNetworkAddress,
"restricted": boolWhetherRestricted,
"capacity": intMaxCapacity,
"description": stringDescription,
Expand Down
4 changes: 3 additions & 1 deletion src/route-tools/Util.ts
Expand Up @@ -131,6 +131,7 @@ export async function buildDomainInfo(pDomain: DomainEntity): Promise<any> {
'name': pDomain.name,
'label': pDomain.name,
'network_address': pDomain.networkAddr,
'network_port': pDomain.networkPort,
'ice_server_address': pDomain.iceServerAddr,
'time_of_last_heartbeat': pDomain.timeOfLastHeartbeat ? pDomain.timeOfLastHeartbeat.toISOString() : undefined,
'num_users': pDomain.numUsers
Expand All @@ -150,7 +151,8 @@ export async function buildDomainInfoV1(pDomain: DomainEntity): Promise<any> {
'ice_server_address': pDomain.iceServerAddr,
'version': pDomain.version,
'protocol_version': pDomain.protocol,
'network_addr': pDomain.networkAddr,
'network_address': pDomain.networkAddr,
'network_port': pDomain.networkPort,
'networking_mode': pDomain.networkingMode,
'restricted': pDomain.restricted,
'num_users': pDomain.numUsers,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/v1/domains/domainId.ts
Expand Up @@ -66,7 +66,7 @@ const procPutDomains: RequestHandler = async (req: Request, resp: Response, next
// 'valuesToSet' are the values sent to use in the request.
// Collect the specific values set. Cannot just accept all because the
// requestor could do things like set the password hash or other bad things.
for (const field of ['version', 'protocol', 'network_addr', 'network_port', 'automatic_networking',
for (const field of ['version', 'protocol', 'network_address', 'network_port', 'automatic_networking',
'restricted', 'capacity', 'description', 'maturity', 'restriction', 'managers', 'tags' ]) {
if (valuesToSet.hasOwnProperty(field)) {
await setDomainField(req.vAuthToken, req.vDomain, field, valuesToSet[field], req.vAuthAccount, updated);
Expand Down

0 comments on commit 8da9cc2

Please sign in to comment.