Skip to content

[DataStorage] Request Rejection from localhost and 127.0.0.1 #403

@tiokim

Description

@tiokim

Describe the issue
DataStorage rejects localhost and 127.0.0.1 requests other than the IP set as Service's Host in configuration.toml.

To Reproduce

  1. Run Edge Orchestration with edgex
  2. Requests to Edge Orchestration DataStorage
  • curl -X POST "127.0.0.1:49986/api/v1/resource/int" -H "accept: text/plain" -H "Content-Type: text/plain" -d 1
  • curl -X POST "localhost:49986/api/v1/resource/int" -H "accept: text/plain" -H "Content-Type: text/plain" -d 1
t25kim@t25kim:~/work/edge-home-orchestration-go$ curl -X POST "10.113.70.227:49986/api/v1/resource/int" -H "accept: text/plain" -H "Content-Type: text/plain" -d 123
t25kim@t25kim:~/work/edge-home-orchestration-go$ curl 10.113.70.227:49986/api/v1/resource/int
[{"id":"962444ff-4294-4136-8b24-1eca535da035","created":1634703497600,"origin":1634703497598631070,"device":"edge-orchestration-c1b23cc6-0767-400a-9cf0-36e1b3902da2","name":"int","value":"123","valueType":"Int64"}]

t25kim@t25kim:~/work/edge-home-orchestration-go$ curl -X POST "127.0.0.1:49986/api/v1/resource/int" -H "accept: text/plain" -H "Content-Type: text/plain" -d 1
curl: (7) Failed to connect to 127.0.0.1 port 49986: Connection refused
t25kim@t25kim:~/work/edge-home-orchestration-go$ curl -X POST "localhost:49986/api/v1/resource/int" -H "accept: text/plain" -H "Content-Type: text/plain" -d 1
curl: (7) Failed to connect to localhost port 49986: Connection refused

Expected solution

  • Request EdgeX to open up to localhost and 127.0.0.1

Alternative

  • Create a REST API that returns service host information at externalhandler

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions