Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- beta

permissions:
contents: write
Expand Down
6 changes: 5 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"branches": [
"main"
"main",
{
"name": "beta",
"prerelease": "beta"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
Expand Down
86 changes: 54 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,29 @@ JSON file. This process creates a secure token.

```python
import zitadel_client as zitadel
from zitadel_client.exceptions import ApiError
from zitadel_client.models import (
UserServiceAddHumanUserRequest,
UserServiceSetHumanEmail,
UserServiceSetHumanProfile,
)

zitadel = zitadel.Zitadel.with_private_key("https://example.us1.zitadel.cloud", "path/to/jwt-key.json")

try:
response = zitadel.users.user_service_add_human_user({
"username": "john.doe",
"profile": {"givenName": "John", "familyName": "Doe"},
"email": {"email": "john@doe.com"}
})
request = UserServiceAddHumanUserRequest(
username="john.doe",
profile=UserServiceSetHumanProfile(
givenName="John",
familyName="Doe"
),
email=UserServiceSetHumanEmail(
email="john@doe.com"
),
)
response = zitadel.users.add_human_user(request)
print("User created:", response)
except Exception as e:
except ApiError as e:
print("Error:", e)
```

Expand All @@ -106,17 +118,29 @@ which is then used to authenticate.

```python
import zitadel_client as zitadel
from zitadel_client.exceptions import ApiError
from zitadel_client.models import (
UserServiceAddHumanUserRequest,
UserServiceSetHumanEmail,
UserServiceSetHumanProfile,
)

zitadel = zitadel.Zitadel.with_client_credentials("https://example.us1.zitadel.cloud", "id", "secret")

try:
response = zitadel.users.user_service_add_human_user({
"username": "john.doe",
"profile": {"givenName": "John", "familyName": "Doe"},
"email": {"email": "john@doe.com"}
})
request = UserServiceAddHumanUserRequest(
username="john.doe",
profile=UserServiceSetHumanProfile(
givenName="John",
familyName="Doe"
),
email=UserServiceSetHumanEmail(
email="john@doe.com"
),
)
response = zitadel.users.add_human_user(request)
print("User created:", response)
except Exception as e:
except ApiError as e:
print("Error:", e)
```

Expand All @@ -140,17 +164,29 @@ authenticate without exchanging credentials every time.

```python
import zitadel_client as zitadel
from zitadel_client.exceptions import ApiError
from zitadel_client.models import (
UserServiceAddHumanUserRequest,
UserServiceSetHumanEmail,
UserServiceSetHumanProfile,
)

zitadel = zitadel.Zitadel.with_access_token("https://example.us1.zitadel.cloud", "token")

try:
response = zitadel.users.user_service_add_human_user({
"username": "john.doe",
"profile": {"givenName": "John", "familyName": "Doe"},
"email": {"email": "john@doe.com"}
})
request = UserServiceAddHumanUserRequest(
username="john.doe",
profile=UserServiceSetHumanProfile(
givenName="John",
familyName="Doe"
),
email=UserServiceSetHumanEmail(
email="john@doe.com"
),
)
response = zitadel.users.add_human_user(request)
print("User created:", response)
except Exception as e:
except ApiError as e:
print("Error:", e)
```

Expand All @@ -160,20 +196,6 @@ Choose the authentication method that best suits your needs based on your
environment and security requirements. For more details, please refer to the
[Zitadel documentation on authenticating service users](https://zitadel.com/docs/guides/integrate/service-users/authenticate-service-users).

### Debugging

The SDK supports debug logging, which can be enabled for troubleshooting
and debugging purposes. You can enable debug logging by setting the `debug`
flag to `true` when initializing the `Zitadel` client, like this:

```python
zitadel = zitadel.Zitadel("your-zitadel-base-url", 'your-valid-token', lambda config: config.debug = True)
```

When enabled, the SDK will log additional information, such as HTTP request
and response details, which can be useful for identifying issues in the
integration or troubleshooting unexpected behavior.

## Design and Dependencies

This SDK is designed to be lean and efficient, focusing on providing a
Expand Down
6 changes: 3 additions & 3 deletions etc/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
restart: 'no'
networks:
- storage
image: 'ghcr.io/zitadel/zitadel:latest'
image: 'ghcr.io/zitadel/zitadel:v4.0.0-rc.1'
command: 'init --config /example-zitadel-config.yaml --config /example-zitadel-secrets.yaml'
depends_on:
db:
Expand All @@ -34,7 +34,7 @@ services:
restart: 'no'
networks:
- storage
image: 'ghcr.io/zitadel/zitadel:latest-debug'
image: 'ghcr.io/zitadel/zitadel:v4.0.0-rc.1-debug'
user: root
entrypoint: '/bin/bash'
command: [ "-c", "/app/zitadel setup --config /example-zitadel-config.yaml --config /example-zitadel-secrets.yaml --steps /example-zitadel-init-steps.yaml --masterkey \"my_test_masterkey_0123456789ABEF\" && echo \"--- ZITADEL SETUP COMPLETE ---\" && echo \"Personal Access Token (PAT) will be in ./zitadel_output/pat.txt on your host.\" && echo \"Service Account Key will be in ./zitadel_output/sa-key.json on your host.\" && echo \"OAuth Client ID and Secret will be in 'zitadel' service logs (grep for 'Application created').\"" ]
Expand All @@ -55,7 +55,7 @@ services:
networks:
- backend
- storage
image: 'ghcr.io/zitadel/zitadel:latest'
image: 'ghcr.io/zitadel/zitadel:v4.0.0-rc.1'
command: >
start --config /example-zitadel-config.yaml
--config /example-zitadel-secrets.yaml
Expand Down
Loading
Loading