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

Standardise roles #634

Merged
merged 7 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/workflows/continuous-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
governance-multitenant-web,
governance-ga-web,
governance-tenant-web,
governance-trust-registry-web,
governance-public-web,
governance-webhooks-web,
governance-multitenant-agent,
governance-endorser,
Expand All @@ -78,7 +78,7 @@ jobs:
- image: governance-tenant-web
context: .
file: dockerfiles/fastapi/Dockerfile
- image: governance-trust-registry-web
- image: governance-public-web
context: .
file: dockerfiles/fastapi/Dockerfile
- image: governance-webhooks-web
Expand Down Expand Up @@ -332,12 +332,32 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

# - name: Determine branch
# id: set_branch
# uses: actions/github-script@v5
# with:
# script: |
# const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
# const octokit = require('@actions/github').getOctokit(GITHUB_TOKEN);
# const branchName = process.env.GITHUB_REF.replace('refs/heads/', '');
# try {
# await octokit.rest.repos.getBranch({
# owner: process.env.GITHUB_REPOSITORY_OWNER,
# repo: (process.env.GITHUB_REPOSITORY).split('/')[1],
# branch: branchName,
# });
# return branchName;
# } catch (error) {
# return 'master';
# }

- name: Checkout Charts
uses: actions/checkout@v4
with:
repository: didx-xyz/charts
token: ${{ secrets.PAT }}
path: charts
# ref: ${{ steps.set_branch.outputs.result }} #

- name: Install dependencies
run: sudo apt-get install -y postgresql-client redis-tools
Expand Down
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def routes_for_role(role: str) -> list:
return tenant_routes
elif ROLE == "tenant-admin":
return tenant_admin_routes
elif ROLE == "trust-registry":
elif ROLE == "public":
return trust_registry_routes
elif ROLE == "*":
return tenant_admin_routes + tenant_routes + trust_registry_routes
Expand Down
2 changes: 1 addition & 1 deletion app/routes/trust_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

logger = get_logger(__name__)

router = APIRouter(tags=["trust-registry"])
router = APIRouter(prefix="/trust-registry", tags=["trust-registry"])


@router.get("/schemas", response_model=List[Schema])
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,17 @@ services:
- host
env_file:
- environments/governance-tenant/fastapi.default.env
governance-trust-registry-web:
image: ${REGISTRY:-local}/governance-trust-registry-web:${IMAGE_TAG:-latest}
container_name: governance-trust-registry-web
governance-public-web:
image: ${REGISTRY:-local}/governance-public-web:${IMAGE_TAG:-latest}
container_name: governance-public-web
build:
context: .
dockerfile: ./dockerfiles/fastapi/Dockerfile
ports:
- 0.0.0.0:8400:8000
volumes:
- ./app:/app
- ./environments/governance-trust-registry/fastapi.default.env:/app/.env
- ./environments/governance-public/fastapi.default.env:/app/.env
- ./logs/tenant:/logs
depends_on:
governance-multitenant-wallets-db:
Expand All @@ -209,7 +209,7 @@ services:
- governance-multitenant
- host
env_file:
- environments/governance-trust-registry/fastapi.default.env
- environments/governance-public/fastapi.default.env
governance-webhooks-web:
image: ${REGISTRY:-local}/governance-webhooks-web:${IMAGE_TAG:-latest}
container_name: governance-webhooks-web
Expand Down
2 changes: 1 addition & 1 deletion environments/governance-multitenant/fastapi.default.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ PYTHONPATH=/

ACAPY_ENDORSER_ALIAS=endorser

ROOT_PATH=/admin
ROOT_PATH=/tenant-admin
ROLE=tenant-admin
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ACAPY_MULTITENANT_JWT_SECRET=jwtSecret
TRUST_REGISTRY_URL=http://governance-trust-registry:8001

# OpenAPI name
OPENAPI_NAME=CloudAPI-Trust-Registry
OPENAPI_NAME=CloudAPI-Public

# Webhooks
WEBHOOKS_URL=http://governance-webhooks-web:3010
Expand All @@ -19,5 +19,5 @@ PYTHONPATH=/

ACAPY_ENDORSER_ALIAS=endorser

ROOT_PATH=/trust-registry
ROLE=trust-registry
ROOT_PATH=/public
ROLE=public
2 changes: 1 addition & 1 deletion manage
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ EOF
# Default Settings:
# -----------------------------------------------------------------------------------------------------------------
DEFAULT_CONTAINERS="governance-trust-registry trustregistry-db governance-multitenant-wallets-db governance-multitenant-agent tails-server ledger-nodes ledger-browser
governance-ga-wallets-db governance-ga-agent governance-multitenant-web governance-tenant-web governance-ga-web governance-trust-registry-web wh-redis governance-webhooks-web governance-endorser"
governance-ga-wallets-db governance-ga-agent governance-multitenant-web governance-tenant-web governance-ga-web governance-public-web wh-redis governance-webhooks-web governance-endorser"
TEST_CONTAINERS="${DEFAULT_CONTAINERS} tests"
# -----------------------------------------------------------------------------------------------------------------
# Functions:
Expand Down
Loading