Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message with wrong Fiware-Service is accepted #207

Open
gobaldia opened this issue Apr 21, 2017 · 2 comments
Open

Message with wrong Fiware-Service is accepted #207

gobaldia opened this issue Apr 21, 2017 · 2 comments
Labels

Comments

@gobaldia
Copy link
Contributor

gobaldia commented Apr 21, 2017

I have the following important issue.
I have two Services created as follows:

Host: localhost:4061
Content-Type: application/json
X-Auth-Token: [TOKEN]
Fiware-Service: A
Fiware-ServicePath: /auto
Cache-Control: no-cache
{
      "services": [
        {
          "apikey":      "apikeyA",
          "cbroker":     "http://localhost:1026",
          "entity_type": "A",
          "resource":    "/iot/d"
        }
      ]
    }

and

Host: localhost:4061
Content-Type: application/json
X-Auth-Token: [TOKEN]
Fiware-Service: B
Fiware-ServicePath: /auto
Cache-Control: no-cache
{
      "services": [
        {
          "apikey":      "apikeyB",
          "cbroker":     "http://localhost:1026",
          "entity_type": "B",
          "resource":    "/iot/d"
        }
      ]
    }

Then I have two devices: deviceA (in the service A, with Fiware-Service A) and deviceB (in the service B, with Fiware-Service B).

Then, if I try to send a measure to deviceA with APIKEY=apikeyA and Fiware-Service=B the measure is accepted and processed normally, and viceversa.
It seems to header Fiware-Service is ignored.
That's a big issue. It caused us a lot of inconveniences.

@AlvaroVega
Copy link
Member

In that case apikey is prevaling over the header fiware-service. In some cases apikey unique by a mongo index.

@AlvaroVega
Copy link
Member

Anyway, in order to check that service and subservice matches with the configuration provided for apikey you should enable Single Configuration Mode. https://github.com/telefonicaid/iotagent-node-lib#configurations-and-subservices

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants