def create_client(self): dataset = DictDBWrap(USERDB) client = Client({}, client_authn_methods=CLIENT_AUTHN_METHOD) self.rsh = ResourceSetHandler(dataset, client, "hans") self.rsh.dataset.scopes2op[ 'https://dirg.org.umu.se/uma/read'] = self.rsh.dataset.get self.rsh.client.provider_info = { "resource_set_registration_endpoint": 'https://as.example.com/rsr' } self.rsh.token["PAT"] = 'pat'
"givenName": "Hans", "sn": "Granberg", "eduPersonNickname": "Hasse", "email": "*****@*****.**", }, "linda": { "displayName": "Linda Lindgren", "eduPersonNickname": "Linda", "givenName": ["Linda", "Maria"], "sn": "Lindgren", "email": "*****@*****.**", "uid": "linda" } } dataset = DictDBWrap(USERDB.copy()) dataset.scopes2op['https://www.example.com/uma/read'] = dataset.get info_store = {} RS_PORT = 8089 RS_HOST = "https://localhost:%s" % RS_PORT ressrv = ResourceServer(dataset, "linda", info_store, client_authn_methods=CLIENT_AUTHN_METHOD) ressrv.rs_handler.op2scope['GET'] = 'https://www.example.com/uma/read' # ============================== 1 =========================================== # Connect RS to AS
def create_db(self): self.dw = DictDBWrap(USERDB.copy()) self.dw.scopes2op["https://dirg.org.umu.se/uma/read"] = self.dw.get