Skip to content

Commit

Permalink
Merge master inot issue_61 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
morrieinmaas committed Mar 8, 2021
2 parents 1d2ffe7 + f2aead2 commit 10df19d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
4 changes: 4 additions & 0 deletions configuration/aries-args-basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ wallet-name: !ENV ${WALLET_NAME}
wallet-key: !ENV ${WALLET_KEY}
seed: !ENV ${WALLET_SEED}
auto-provision: true
<<<<<<< HEAD
=======

>>>>>>> master

## run a local postgres (docker) like:
## docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d -p 5432:5432 postgres:10
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# For usage please consult https://github.com/hyperledger/aries-cloudagent-python/blob/main/Mediation.md

from .base import BaseController
from aiohttp import ClientSession
import logging
from typing import List

logger = logging.getLogger("aries_controller.multitenancy")


class MultitenancyController(BaseController):

def __init__(self, admin_url: str, client_session: ClientSession):
super().__init__(admin_url, client_session)
self.base_url = "/multitenancy"

def default_handler(self, payload):
logger.debug("Multitenancy Message received", payload)


# Create a subwallet
async def create_subwallet(self, request):
return await self.admin_POST(f"{self.base_url}/wallet", json_data=request)


# Get a single subwallet
async def get_single_subwallet_by_id(self, wallet_id: str):
return await self.admin_GET(f"{self.base_url}/wallet/{wallet_id}")


# Update a subwallet
async def update_subwallet_by_id(self, request, wallet_id: str):
return await self.admin_PUT(f"{self.base_url}/wallet/{wallet_id}", json_data=request)


# Remove a subwallet
async def remove_subwallet_by_id(self, request, wallet_id: str):
return await self.admin_POST(f"{self.base_url}/wallet/{wallet_id}/remove", json_data=request)


# Get auth token for a subwallet
async def get_subwallet_authtoken_by_id(self, request, wallet_id: str):
return await self.admin_POST(f"{self.base_url}/wallet/{wallet_id}/token", json_data=request)


# Query subwallets
async def query_subwallets(self, wallet_name: str = None):
params = {}
if wallet_name:
params["wallet_name"] = wallet_name

return await self.admin_GET(f"{self.base_url}/wallets")



0 comments on commit 10df19d

Please sign in to comment.