mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-10-29 17:52:28 +00:00
Initial checkins
This commit is contained in:
42
README.md
42
README.md
@@ -1,2 +1,44 @@
|
|||||||
# OpenWiFi Provisioning
|
# OpenWiFi Provisioning
|
||||||
|
|
||||||
|
## Root entity
|
||||||
|
It's UUID value is 0000-0000-0000. Its parent entity must be empty.
|
||||||
|
|
||||||
|
## Entity
|
||||||
|
You must set the parent of an entity.
|
||||||
|
|
||||||
|
## Venue
|
||||||
|
When creating a venue, the top venue must have its entity property set to the owning entity, and its parent property empty.
|
||||||
|
For all sub venues, their entity must be set to empty and its parent entity must be set to the venue above it.
|
||||||
|
|
||||||
|
## Management policy
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"default" : [],
|
||||||
|
"acls" : [
|
||||||
|
{
|
||||||
|
"roles" : [ uuid1, uuid2, uuid3 ],
|
||||||
|
"access" : [ READ, WRITE, ... ]
|
||||||
|
} ,
|
||||||
|
{
|
||||||
|
"roles" : [ ... ],
|
||||||
|
"access" : [ ... ]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Management roles
|
||||||
|
Management roles can be created using UUIDs from the SEC service. SEC service may ask prov if deleting a user
|
||||||
|
is OK. PROV should answer with username in use or something like this.
|
||||||
|
|
||||||
|
Management roles are created by adding UUIDs into a group. Then that UUID may be used in any management
|
||||||
|
policy.
|
||||||
|
|
||||||
|
Management roles must have a quick way to evaluate all the roles a user has. This is important for
|
||||||
|
speed. Roles ddo not use subscribers.
|
||||||
|
|
||||||
|
So read all the roles, cross ref all the users sp you can apply access rules against a resource very quickly.
|
||||||
|
|
||||||
|
If a user is part of 2 roles, then the access will be agregate. if NONE is found, then NONE wins.
|
||||||
|
|
||||||
|
|||||||
@@ -229,14 +229,14 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
# uuids: mgg:<uuid>
|
# uuids: mgg:<uuid>
|
||||||
ManagementGroup:
|
ManagementRole:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
allOf:
|
allOf:
|
||||||
$ref: '#/components/schemas/ObjectInfo'
|
$ref: '#/components/schemas/ObjectInfo'
|
||||||
managementPolicy:
|
managementPolicy:
|
||||||
$ref: '#/components/schemas/ManagementPolicy'
|
$ref: '#/components/schemas/ManagementPolicy'
|
||||||
managers:
|
users:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ namespace OpenWifi{
|
|||||||
LocalObject.info.modified = std::time(nullptr);
|
LocalObject.info.modified = std::time(nullptr);
|
||||||
|
|
||||||
std::string Error;
|
std::string Error;
|
||||||
for(auto const &i:Request) {
|
for(auto const &i:Parameters_) {
|
||||||
if(i.first == "addContact" || i.first == "delContact") {
|
if(i.first == "addContact" || i.first == "delContact") {
|
||||||
if(!Storage()->ContactDB().Exists("id",i.second)) {
|
if(!Storage()->ContactDB().Exists("id",i.second)) {
|
||||||
Error = "Unknown Contact UUID: " + i.second;
|
Error = "Unknown Contact UUID: " + i.second;
|
||||||
@@ -225,10 +225,6 @@ namespace OpenWifi{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if(i.first == "addManager" || i.first == "delManager") {
|
} else if(i.first == "addManager" || i.first == "delManager") {
|
||||||
if(!Storage()->VenueDB().Exists("id",i.second)) {
|
|
||||||
Error = "Unknown Venue UUID: " + i.second;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Error = "Unknown operation: " + i.first;
|
Error = "Unknown operation: " + i.first;
|
||||||
break;
|
break;
|
||||||
@@ -241,8 +237,6 @@ namespace OpenWifi{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(Storage()->EntityDB().UpdateRecord("id",UUID,LocalObject)) {
|
if(Storage()->EntityDB().UpdateRecord("id",UUID,LocalObject)) {
|
||||||
Poco::JSON::Object Answer;
|
|
||||||
|
|
||||||
for(const auto &i:Request) {
|
for(const auto &i:Request) {
|
||||||
std::string Child{i.second};
|
std::string Child{i.second};
|
||||||
if(i.first == "addContact") {
|
if(i.first == "addContact") {
|
||||||
@@ -258,10 +252,13 @@ namespace OpenWifi{
|
|||||||
Storage()->EntityDB().DeleteLocation("id", UUID, Child);
|
Storage()->EntityDB().DeleteLocation("id", UUID, Child);
|
||||||
Storage()->LocationDB().DeleteEntity("id",Child,UUID);
|
Storage()->LocationDB().DeleteEntity("id",Child,UUID);
|
||||||
} else if (i.first == "addManager") {
|
} else if (i.first == "addManager") {
|
||||||
|
Storage()->EntityDB().AddManager("id",UUID,Child);
|
||||||
} else if (i.first == "delManager") {
|
} else if (i.first == "delManager") {
|
||||||
|
Storage()->EntityDB().DeleteManager("id",UUID,Child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Poco::JSON::Object Answer;
|
||||||
|
Storage()->EntityDB().GetRecord("id",UUID, LocalObject);
|
||||||
LocalObject.to_json(Answer);
|
LocalObject.to_json(Answer);
|
||||||
ReturnObject(Request, Answer, Response);
|
ReturnObject(Request, Answer, Response);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user