This is the Ocean role-based access control (RBAC) server. The RBAC server is used to implement fine-grained permissions on browsing, consumer and publishing data assets. The permissions are controlled precisely at two levels:
"eventType"= "consume".User profiles and roles can be stored in Keycloak or in json. The functionality has also been designed so that it is easy to expand to use other identity management services.
In order to start user the RBAC server:
git clone https://github.com/oceanprotocol/RBAC-Server.git
cd RBAC-Server
npm install
npm run build
npm run start
npm run build:docker
npm run start:docker
http://localhost:49160 in your requests.You can change the default auth service in the .env file e.g. DEFAULT_AUTH_SERVICE = "keycloak". This is the auth service that will be used if no authService is defined within the request.
POST request to the RBAC URL, if you are running it locally the address will be http://localhost:3000.The body of the request should be in the following format:
{
"eventType": "publish",
"component": "market" ,
"credentials": {
"type": "address",
"value": "0xETHEURM_ADRESS"
}
}
If the eventType is "consume" the request format must include the did of the asset. This is because the DDO needs to be requested and checked for an allow or deny list. For example:
{
"eventType": "consume",
"component": "market" ,
"did": "did:op:e0089c4BAC163b571649f6AC4614580f968A2294",
"credentials": {
"type": "address",
"value": "0xETHEURM_ADRESS"
}
}
Code style is automatically enforced through ESLint & Prettier rules:
prettier on staged files, setup with HuskyFor running linting and auto-formatting manually, you can use from the root of the project:
# linting check, also runs Typescript typings check
npm run lint
# auto format all files in the project with prettier, taking all configs into account
npm run format
Content type
Image
Digest
sha256:5242ec3b7…
Size
137.6 MB
Last updated
about 3 years ago
docker pull oceanprotocol/rbac-server:next