-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #468 from felicijus/feature/oauth-client-credentials
feat: oauth2 client credentials
- Loading branch information
Showing
11 changed files
with
918 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
=========== | ||
Credentials | ||
=========== | ||
|
||
Oauth2 Client Credentials Plugin | ||
-------------------------------- | ||
|
||
.. autoclass:: pyzeebe.credentials.Oauth2ClientCredentialsMetadataPlugin | ||
:members: | ||
:special-members: | ||
:private-members: | ||
|
||
Example: | ||
|
||
.. code-block:: python | ||
oauth2_client_credentials = Oauth2ClientCredentialsMetadataPlugin( | ||
client_id=ZEEBE_CLIENT_ID, | ||
client_secret=ZEEBE_CLIENT_SECRET, | ||
authorization_server=ZEEBE_AUTHORIZATION_SERVER_URL, | ||
scope="profile email", | ||
audience="zeebe-api", | ||
) | ||
call_credentials: grpc.CallCredentials = grpc.metadata_call_credentials(oauth2_client_credentials) | ||
channel_credentials: grpc.ChannelCredentials = grpc.ssl_channel_credentials( | ||
certificate_chain=None, private_key=None, root_certificates=None | ||
) | ||
composite_credentials: grpc.ChannelCredentials = grpc.composite_channel_credentials( | ||
channel_credentials, call_credentials | ||
) | ||
options: ChannelArgumentType = (("grpc.so_reuseport", 0),) | ||
channel: grpc.aio.Channel = grpc.aio.secure_channel( | ||
target=ZEEBE_ADDRESS, credentials=composite_credentials, options=options | ||
) | ||
client = ZeebeClient(channel) | ||
Oauth2 Plugin | ||
------------- | ||
.. autoclass:: pyzeebe.credentials.OAuth2MetadataPlugin | ||
:members: | ||
:special-members: | ||
:private-members: | ||
|
||
Internal (Deprecated) | ||
--------------------- | ||
|
||
.. autoclass:: pyzeebe.AuthMetadataPlugin | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: pyzeebe.CredentialsABC | ||
:members: | ||
:undoc-members: | ||
|
||
.. autoclass:: pyzeebe.CamundaIdentityCredentials | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
from pyzeebe.channel.camunda_cloud_channel import create_camunda_cloud_channel | ||
from pyzeebe.channel.insecure_channel import create_insecure_channel | ||
from pyzeebe.channel.oauth_channel import ( | ||
create_camunda_cloud_channel, | ||
create_oauth2_client_credentials_channel, | ||
) | ||
from pyzeebe.channel.secure_channel import create_secure_channel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.