1
0
mirror of https://github.com/oceanprotocol/barge.git synced 2024-11-25 20:01:10 +01:00

Merge pull request #251 from oceanprotocol/feature/rbac

add rbac server
This commit is contained in:
Alex Coseru 2021-06-09 18:56:01 +03:00 committed by GitHub
commit a7dee2056f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 0 deletions

View File

@ -70,17 +70,20 @@ The default versions are always a combination of component versions which are co
| Elasticsearch | Aquarius | 6.8.3 | 172.15.0.6 | |
| Provider | | v0.4.9 | 172.15.0.4 | 8030 -> 8030 |
| Provider2 | | v0.4.9 | 172.15.0.7 | 8030 -> 8030 |
| RBAC Server | | main | 172.15.0.8 | 3000 -> 3000 |
| GraphNode | | oceanprotocol/graph-node:latest | 172.15.0.15 | 9000 -> 8000 ,9001 -> 8001 , 9020 -> 8020, 9030 -> 8030, 9040 -> 8040 |
| Graphipfs | | ipfs/go-ipfs:v0.4.23 | 172.15.0.16 | 5001 -> 5001 |
| Graphpgsql | | postgres | 172.15.0.7 | 5432 -> 5432 |
| Dashboard | | portainer/portainer | 172.15.0.25 | 9100 -> 9000 |
You can override the Docker image tag used for a particular component by setting its associated environment variable before calling `start_ocean.sh`:
- `AQUARIUS_VERSION`
- `PROVIDER_VERSION`
- `CONTRACTS_VERSION`
- `RBAC_VERSION`
For example:
@ -99,6 +102,7 @@ export AQUARIUS_VERSION=v2.0.0
| `--with-provider2` | Runs a 2nd provider, on port 8031. This is required for ocean.js/ocean.py integration tests. 2nd Provider will use the same image and parameters (log_level, ipfs gateway, compute gateway, etc) as provider1, but has a different private key |
| `--no-ganache` | Start up Ocean without the `ganache` Building Block. |
| `--no-dashboard` | Start up Ocean without the `dashboard` Building Block. |
| `--with-rbac` | Start up Ocean with RBAC Server |
| `--with-thegraph` | Start up Ocean with graphnode, ipfs & postgresql |
| `--skip-deploy` | Start up Ocean without deploying the contracts. Useful when ethereum node already has contracts.|
| `--force-pull` | Force pulling the latest revision of the used Docker images. |
@ -165,6 +169,28 @@ This will start a `portainer` dashboard with the following admin credentials and
| ----------- | ------------- | --------------------- | --------------------- | --------------------------------------------------- |
| `dashboard` | `9100` | http://dashboard:9100 | http://localhost:9100 | [Portainer](https://github.com/portainer/portainer) |
### RBAC Server
| Hostname | External Port | Internal URL | Local URL | Description |
| ----------- | ------------- | --------------------- | --------------------- | --------------------------------------------------- |
| `rbac` | `3000` | http://rbac:3000 | http://localhost:3000 | |
The following addresses are preconfigured for testing: (first 10 addresses from the default mnemonic)
| Address | Roles |
| ----------------------------------------- | ------------------------------- |
| 0xe2DD09d719Da89e5a3D0F2549c7E24566e947260 | ["user","publisher","consumer"] |
| 0xBE5449a6A97aD46c8558A3356267Ee5D2731ab5e | ["user","publisher","consumer"] |
| 0xA78deb2Fa79463945C247991075E2a0e98Ba7A09 | ["user","publisher","consumer"] |
| 0x02354A1F160A3fd7ac8b02ee91F04104440B28E7 | ["user","publisher","consumer"] |
| 0xe17D2A07EFD5b112F4d675ea2d122ddb145d117B | ["user","publisher","consumer"] |
| 0xA32C84D2B44C041F3a56afC07a33f8AC5BF1A071 | ["user","publisher","consumer"] |
| 0xFF3fE9eb218EAe9ae1eF9cC6C4db238B770B65CC | ["user"] |
| 0x529043886F21D9bc1AE0feDb751e34265a246e47 | ["consumer"] |
| 0xe08A1dAe983BC701D05E492DB80e0144f8f4b909 | ["publisher"] |
| 0xbcE5A3468386C64507D30136685A99cFD5603135 | ["consumer","publisher"] |
## Contributing
See the page titled "[Ways to Contribute](https://docs.oceanprotocol.com/concepts/contributing/)" in the Ocean Protocol documentation.

13
compose-files/rbac.yml Normal file
View File

@ -0,0 +1,13 @@
version: '3'
services:
rbac:
image: oceanprotocol/rbac-server:${RBAC_VERSION:-next}
ports:
- 3000:3000
networks:
backend:
ipv4_address: 172.15.0.8
environment:
DEFAULT_AUTH_SERVICE: "json"
JSON_DATA: '[{"address":"0xe2DD09d719Da89e5a3D0F2549c7E24566e947260","id":"0","userRoles":["user","publisher","consumer"]},{"address":"0xBE5449a6A97aD46c8558A3356267Ee5D2731ab5e","id":"1","userRoles":["user","publisher","consumer"]},{"address":"0xA78deb2Fa79463945C247991075E2a0e98Ba7A09","id":"2","userRoles":["user","publisher","consumer"]},{"address":"0x02354A1F160A3fd7ac8b02ee91F04104440B28E7","id":"3","userRoles":["user","publisher","consumer"]},{"address":"0xe17D2A07EFD5b112F4d675ea2d122ddb145d117B","id":"4","userRoles":["user","publisher","consumer"]},{"address":"0xA32C84D2B44C041F3a56afC07a33f8AC5BF1A071","id":"5","userRoles":["user","publisher","consumer"]},{"address":"0xFF3fE9eb218EAe9ae1eF9cC6C4db238B770B65CC","id":"6","userRoles":["user"]},{"address":"0x529043886F21D9bc1AE0feDb751e34265a246e47","id":"7","userRoles":["consumer"]},{"address":"0xe08A1dAe983BC701D05E492DB80e0144f8f4b909","id":"8","userRoles":["publisher"]},{"address":"0xbcE5A3468386C64507D30136685A99cFD5603135","id":"9","userRoles":["consumer","publisher"]}]'

View File

@ -31,6 +31,7 @@ COMPOSE_DIR="${DIR}/compose-files"
export AQUARIUS_VERSION=${AQUARIUS_VERSION:-v2.2.12}
export PROVIDER_VERSION=${PROVIDER_VERSION:-v0.4.9}
export CONTRACTS_VERSION=${CONTRACTS_VERSION:-v0.6.2}
export RBAC_VERSION=${RBAC_VERSION:-next}
export PROJECT_NAME="ocean"
export FORCEPULL="false"
@ -192,6 +193,10 @@ while :; do
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/provider2.yml"
printf $COLOR_Y'Starting with a 2nd Provider...\n\n'$COLOR_RESET
;;
--with-rbac)
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/rbac.yml"
printf $COLOR_Y'Starting with RBAC Server...\n\n'$COLOR_RESET
;;
--with-thegraph)
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/thegraph.yml"
printf $COLOR_Y'Starting with TheGraph...\n\n'$COLOR_RESET