Example #1
0
    def new(cls, environment='prod', user=None, password=None):
        '''create a new cross-service client'''
        services = get_services()

        oauth_client = BBPOIDCClient().implicit_auth(
            user=user,
            password=password,
            oauth_url=services['oidc_service'][environment]['url'])

        return cls(task_client=TaskClient(
            host=services['task_service'][environment]['url'],
            oauth_client=oauth_client),
                   prov_client=ProvClient(
                       host=services['prov_service'][environment]['url'],
                       oauth_client=oauth_client),
                   document_client=DocumentClient(
                       host=services['document_service'][environment]['url'],
                       oauth_client=oauth_client),
                   mimetype_client=MIMETypeClient(
                       host=services['mimetype_service'][environment]['url']))