Skip to content

Commit

Permalink
Merge pull request #210 from camunda-community-hub/development
Browse files Browse the repository at this point in the history
v2.4.0
  • Loading branch information
JonatanMartens authored Sep 6, 2021
2 parents 8fc8c07 + c5c21c3 commit d567ef2
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/client_quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ To create a client for a Camunda Cloud instance:
credentials = CamundaCloudCredentials(client_id="client_id", client_secret="client_secret",
cluster_id="cluster_id")
client = ZeebeClient()
client = ZeebeClient(credentials=credentials)
Run a workflow
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
author = 'Jonatan Martens'

# The full version, including alpha/beta/rc tags
release = '2.3.2'
release = '2.4.0'

# -- General configuration ---------------------------------------------------

Expand Down Expand Up @@ -59,6 +59,6 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

version = "2.3.2"
version = "2.4.0"

master_doc = 'index'
2 changes: 1 addition & 1 deletion docs/worker_quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ To create a worker for a Camunda Cloud instance:
credentials = CamundaCloudCredentials(client_id="client_id", client_secret="client_secret",
cluster_id="cluster_id")
worker = ZeebeWorker()
worker = ZeebeWorker(credentials=credentials)
Add a task
Expand Down
2 changes: 1 addition & 1 deletion pyzeebe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.3.2"
__version__ = "2.4.0"

from pyzeebe import exceptions
from pyzeebe.client.client import ZeebeClient
Expand Down
4 changes: 2 additions & 2 deletions pyzeebe/credentials/camunda_cloud_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@


class CamundaCloudCredentials(OAuthCredentials):
def __init__(self, client_id: str, client_secret: str, cluster_id: str):
def __init__(self, client_id: str, client_secret: str, cluster_id: str, region: str="bru-2"):
try:
super().__init__(url="https://login.cloud.camunda.io/oauth/token", client_id=client_id,
client_secret=client_secret, audience=f"{cluster_id}.zeebe.camunda.io")
client_secret=client_secret, audience=f"{cluster_id}.{region}.zeebe.camunda.io")
except InvalidOAuthCredentials:
raise InvalidCamundaCloudCredentials(client_id=client_id, cluster_id=cluster_id)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pyzeebe",
version="2.3.2",
version="2.4.0",
author="Jonatan Martens",
author_email="[email protected]",
description="Zeebe client api",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/credentials/camunda_cloud_credentials_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_init():
with patch("pyzeebe.credentials.oauth_credentials.OAuthCredentials.__init__") as init:
CamundaCloudCredentials(client_id, client_secret, cluster_id)
init.assert_called_with(url=f"https://login.cloud.camunda.io/oauth/token", client_id=client_id,
client_secret=client_secret, audience=f"{cluster_id}.zeebe.camunda.io")
client_secret=client_secret, audience=f"{cluster_id}.bru-2.zeebe.camunda.io")


def test_invalid_credentials():
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/grpc_internals/zeebe_adapter_base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_credentials_connection_uri_gotten(zeebe_adapter):
CamundaCloudCredentials.get_access_token = MagicMock(return_value=str(uuid4()))
credentials = CamundaCloudCredentials(client_id, client_secret, cluster_id)
zeebe_adapter = ZeebeAdapterBase(credentials=credentials)
assert zeebe_adapter.connection_uri == f"{cluster_id}.zeebe.camunda.io:443"
assert zeebe_adapter.connection_uri == f"{cluster_id}.bru-2.zeebe.camunda.io:443"


def test_credentials_no_connection_uri(zeebe_adapter):
Expand Down

0 comments on commit d567ef2

Please sign in to comment.