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

Spec: multi-tenancy #49

Closed
cdupont opened this issue Nov 14, 2016 · 13 comments
Closed

Spec: multi-tenancy #49

cdupont opened this issue Nov 14, 2016 · 13 comments
Assignees
Labels
Milestone

Comments

@cdupont
Copy link
Contributor

cdupont commented Nov 14, 2016

The Waziup platform need to provide tenant isolation: my sensors/data/apps should not be visible to others.
Orion provides a basic mechanism for tenant isolation called Fiware-service and Fiware-servicePath: http://fiware-orion.readthedocs.io/en/master/user/service_path/

@cdupont cdupont added this to the V0.3 milestone Nov 14, 2016
@cdupont
Copy link
Contributor Author

cdupont commented Nov 21, 2016

Proposition from Congduc:

#server: CAUTION must exist
waziup_server="http://broker.waziup.io/v2"

#project name
project_name='waziup"

#your organization: CHANGE HERE
organization_name="UPPA"

#sensor name: CHANGE HERE
sensor_name="Sensor"

#service path: CHANGE HERE
service_path="/UPPA/LIUPPA/T2I/CPHAM"

#the entity name will then be sensor_name+scr_addr, e.g. "Sensor1"
#the Fiware-ServicePath will be service_path, e.g. "/UPPA/LIUPPA/T2I/CPHAM"
#the Fiware-Service will be project_name+organization_name, e.g. "waziupUPPA"

So for UPPA, there are 3 sensors:

curl http://broker.waziup.io/v2/entities/Sensor10/attrs/TC/value --header Fiware-ServicePath:/UPPA/LIUPPA/T2I/CPHAM --header Fiware-Service:waziupUPPA -X GET

curl http://broker.waziup.io/v2/entities/Sensor3/attrs/temp/value --header Fiware-ServicePath:/UPPA/LIUPPA/T2I/CPHAM --header Fiware-Service:waziupUPPA -X GET

curl http://broker.waziup.io/v2/entities/Sensor6/attrs/temp/value --header Fiware-ServicePath:/UPPA/LIUPPA/T2I/CPHAM --header Fiware-Service:waziupUPPA -X GET

I proposed that each partner uses the following organization_name:

  • "UPPA"
  • "EGM"
  • "IT21"
  • "CREATENET"
  • "CTIC"
  • "UI"
  • "ISPACE"
  • "UGB"
  • "WOELAB"
  • "FARMERLINE"
  • "C4A"
  • "PUBD"

The service path can be whatever they want. Can we agree on these organization name?

@cdupont
Copy link
Contributor Author

cdupont commented Nov 21, 2016

As far as I understand, Fiware-service is intended to provide tenant isolation, while Fiware-servicePath provides hierarchical organization of sensors.
It seems that service maps to different databases, while servicePath maps to different tables in the DB.

dbName=<fiware-service>
tableName=<fiware-servicePath>

Do we really need different databases?
For example, what if I want to retrieve all the sensors registered in Waziup, for example to make some statistics?
It seems that I can use a query on the root of the service path:
http://fiware-orion.readthedocs.io/en/master/user/service_path/

In this case, maybe it's better to have:

fiware-service = waziup
Fiware-ServicePath = pilot name

In the future, do you think that a sensor owner should be mapped to a fiware-service?
Just want to avoid additional complexity :)

@cdupont
Copy link
Contributor Author

cdupont commented Nov 23, 2016

Actually, if we use only one fiware-service tenant, it's better to not use it at all (leave it empty): it will simplify the requests.

@cdupont
Copy link
Contributor Author

cdupont commented Nov 23, 2016

@CongducPham
Copy link

I don't agree, I think we should put waziup. It is not that complicated
because we need the service path anyway.

regards,

Le 23/11/16 à 16:08, Corentin Dupont a écrit :

Actually, if we use only one fiware-service tenant, it's better to not
use it at all (leave it empty): it will simplify the requests.


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#49 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABNEN-NUt2rSbHtWP9veLAQC0eIj3W3nks5rBFcDgaJpZM4KxYrE.

C. Pham.

|------------ Congduc PHAM - Professor --------------------------|
| LIUPPA - Equipe T2I | U.P.P.A. Pau |
| http://liuppa.univ-pau.fr/ | http://www.univ-pau.fr |
|----------------------------------------------------------------|
|UPPA, LIUPPA laboratory, UFR Sciences et Techniques |
|Avenue de l'Université - BP 1155 |
|64013 PAU CEDEX, FRANCE |
| |
|phone: 33 5 59 40 75 94 |
|fax: 33 5 59 40 76 54 |
|Congduc.Pham@univ-pau.fr http://www.univ-pau.fr/~cpham |
|----------------------------------------------------------------|

@cdupont
Copy link
Contributor Author

cdupont commented Nov 24, 2016

@CongducPham Agreed. So let's keep it like that:

Fiware-Service:waziup
Fiware-ServicePath:/<pilot name>

Sublevels of Fiware-ServicePath are free to decide (for example /UPPA/LIUPPA/T2I/CPHAM)

@cdupont
Copy link
Contributor Author

cdupont commented Nov 24, 2016

I did some research and it seems Orion supports recursive servicePath.
So I can search all sensors in waziup, using a wildcard # for the servicePath:

curl http://broker.waziup.io/v2/entities --header Fiware-ServicePath:/# --header Fiware-Service:waziup -X GET

This will return all sensors in UPPA (including all departments):

curl http://broker.waziup.io/v2/entities --header Fiware-ServicePath:/UPPA/# --header Fiware-Service:waziup -X GET

If I don't include the wildcard, the search is not recursive. This will return only sensors registered at "UPPA" level:

curl http://broker.waziup.io/v2/entities --header Fiware-ServicePath:/UPPA/ --header Fiware-Service:waziup -X GET

@cdupont
Copy link
Contributor Author

cdupont commented Nov 24, 2016

I think we agree on the format, so closing.
We need to update all documentation and gateway code for complying.

@cdupont cdupont closed this as completed Nov 24, 2016
@CongducPham
Copy link

CongducPham commented Nov 24, 2016 via email

@cdupont
Copy link
Contributor Author

cdupont commented Nov 24, 2016

OK

1 similar comment
@sabrine2020
Copy link
Contributor

OK

@cdupont
Copy link
Contributor Author

cdupont commented Nov 27, 2016

need to update https://github.com/Waziup/Platform/blob/master/broker/broker_spec.md
with result of this discussion

@cdupont
Copy link
Contributor Author

cdupont commented Dec 21, 2016

Done 4a3cb2c

@cdupont cdupont closed this as completed Dec 21, 2016
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

3 participants