You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,12 @@ Use filesystem navigation tools to explore the codebase structure as needed.
14
14
15
15
## Code Style & Quality Standards
16
16
17
+
### Commenting policy — explain why, not what
18
+
- Use comments to document intent, trade‑offs, constraints, invariants, and tricky edge cases—i.e., why the code is this way—rather than narrating changes. Prefer self‑explanatory code; add comments only where extra context is needed. Write for a reader 6+ months later.
19
+
- Use for: complex logic/algorithms, non‑obvious design decisions, business rules/constraints, API purpose/contracts, edge cases.
20
+
- Avoid: change‑tracking comments (“Updated from previous version”, “New implementation”, “Changed to use X instead of Y”, “Refactored this section”).
21
+
- Avoid simple explanatory comments, where it is already clear from the code itself.
22
+
17
23
### Formatting and Linting
18
24
- Format code with: `bash scripts/format.sh` (requires Python environment with dev dependencies)
19
25
- Run this before every commit to ensure proper formatting
Copy file name to clipboardExpand all lines: CLAUDE.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,12 @@ Note: The MCP server indexes the latest released docs, not the develop branch. F
24
24
25
25
## Code Style & Quality Standards
26
26
27
+
### Commenting policy — explain why, not what
28
+
- Use comments to document intent, trade‑offs, constraints, invariants, and tricky edge cases—i.e., why the code is this way—rather than narrating changes. Prefer self‑explanatory code; add comments only where extra context is needed. Write for a reader 6+ months later.
29
+
- Use for: complex logic/algorithms, non‑obvious design decisions, business rules/constraints, API purpose/contracts, edge cases.
30
+
- Avoid: change‑tracking comments (“Updated from previous version”, “New implementation”, “Changed to use X instead of Y”, “Refactored this section”).
31
+
- Avoid simple explanatory comments, where it is already clear from the code itself.
32
+
27
33
### Formatting and Linting
28
34
- Format code with: `bash scripts/format.sh` (requires Python environment with dev dependencies)
29
35
- Run this before every commit to ensure proper formatting
@@ -297,4 +303,4 @@ When tackling complex tasks:
297
303
---
298
304
299
305
*This document is maintained to help Claude Code work effectively with the
300
-
ZenML codebase. For human contributors, see CONTRIBUTING.md.*
306
+
ZenML codebase. For human contributors, see CONTRIBUTING.md.*
Copy file name to clipboardExpand all lines: docs/book/api-docs/oss-api/oss-api/getting-started.md
+54-11Lines changed: 54 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,9 +38,10 @@ Choosing a method:
38
38
39
39
### Using a short-lived API token
40
40
41
-
You can generate a short-lived (1 hour) API token from your ZenML dashboard. This is useful when you need a fast way to make authenticated HTTP requests to the ZenML API endpoints and you don't need a long-term solution.
41
+
You can generate a short-lived API token using the CLI or the ZenML UI. This is useful when you need a fast way to make authenticated HTTP requests to the ZenML API endpoints and you don't need a long-term solution.
42
+
43
+
1. Generate a short-lived API token through the API Tokens page under your ZenML UI server settings, or the `zenml token` CLI command, as documented in the [Using an API token](../../../how-to/manage-zenml-server/connecting-to-zenml/connect-with-an-api-token.md) guide.
42
44
43
-
1. Generate a short-lived API token through the API Tokens page under your ZenML dashboard server settings, as documented in the [Using an API token](../../../how-to/manage-zenml-server/connecting-to-zenml/connect-with-an-api-token.md) guide.
44
45
2. Use the API token as the bearer token in your HTTP requests. For example, you can use the following command to check your current user:
45
46
* using `curl`:
46
47
@@ -67,24 +68,63 @@ You can generate a short-lived (1 hour) API token from your ZenML dashboard. Thi
67
68
{% hint style="info" %}
68
69
**Important Notes**
69
70
70
-
* API tokens expire after 1 hour and cannot be retrieved after the initial generation
71
-
* Tokens are scoped to your user account and inherit your permissions
72
-
* For long-term programmatic access, it is instead recommended to [set up a service account and an API key](./#using-a-service-account-and-an-api-key)
71
+
* API tokens expire after the configured expiration time (default 1 hour) and need to be renewed periodically.
72
+
* individual API tokens cannot be revoked after they are generated. If a token is compromised, you may need to lock the user account or service account to prevent further access.
73
+
* Tokens are scoped to the user account or service account that was used to generate them and inherit their permissions.
74
+
* For long-term programmatic access, it is instead recommended to [set up a service account API key](./#using-a-service-account-and-an-api-key).
73
75
{% endhint %}
74
76
75
77
### Using a service account and an API key
76
78
77
-
You can use a service account's API key to obtain short-lived API tokens for programmatic access to the ZenML server's REST API. This is particularly useful when you need a long-term, secure way to make authenticated HTTP requests to the ZenML API endpoints.
79
+
You can use a service account's API key to authenticate to the ZenML server's REST API programmatically. This is particularly useful when you need a long-term, secure way to make authenticated HTTP requests to the ZenML API endpoints.
78
80
79
-
1. Create a [service account](https://docs.zenml.io/how-to/manage-zenml-server/connecting-to-zenml/connect-with-a-service-account):
81
+
Start by [creating a service account and an API key](https://docs.zenml.io/how-to/manage-zenml-server/connecting-to-zenml/connect-with-a-service-account), e.g.:
80
82
81
83
```shell
82
84
zenml service-account create myserviceaccount
83
85
```
84
86
85
-
This will print out the `<ZENML_API_KEY>`, you can use in the next steps.
87
+
Then, there are two methods to authenticate with the API using the API key - one is simpler but less secure, the other is secure and recommended but more complex:
88
+
89
+
{% tabs %}
90
+
{% tab title="Direct API key authentication" %}
91
+
92
+
{% hint style="warning" %}
93
+
This approach, albeit simple, is not recommended because the long-lived API key is exposed with every API request, which makes it easier to be compromised. Use it only in low-risk circumstances.
94
+
{% endhint %}
95
+
96
+
Use the API key directly to authenticate your API requests by including it in the `Authorization` header. For example, you can use the following command to check your current user:
86
97
87
-
2. To obtain an API token using your API key, send a POST request to the `/api/v1/login` endpoint. Here are examples using common HTTP clients:
Reduce the risk of API key exposure by periodically exchanging the API key for a short-lived API access token.
126
+
127
+
1. To obtain an API access token using your API key, send a POST request to the `/api/v1/login` endpoint. Here are examples using common HTTP clients:
88
128
* using curl:
89
129
90
130
```bash
@@ -112,7 +152,7 @@ This will print out the `<ZENML_API_KEY>`, you can use in the next steps.
112
152
print(response.json())
113
153
```
114
154
115
-
This will return a response like this:
155
+
This will return a response like this (the API token is the `access_token` field):
116
156
117
157
```json
118
158
{
@@ -124,7 +164,7 @@ This will return a response like this:
124
164
}
125
165
```
126
166
127
-
3. Once you have obtained an API token, you can use it to authenticate your API requests by including it in the `Authorization` header. For example, you can use the following command to check your current user:
167
+
2. Once you have obtained an API token, you can use it to authenticate your API requests by including it in the `Authorization` header. When the token expires, simply repeat the steps above to obtain a new token. For example, you can use the following command to check your current user:
128
168
* using curl:
129
169
130
170
```bash
@@ -148,6 +188,9 @@ This will return a response like this:
4. Simply use the API token as the bearer token in your HTTP requests. For example, you can use the following command to check your current user:
@@ -85,8 +85,9 @@ To generate a new API token for the ZenML Pro API:
85
85
{% hint style="info" %}
86
86
**Important Notes**
87
87
88
-
* API tokens expire after 1 hour and cannot be retrieved after initial generation
89
-
* Tokens are scoped to your user account and inherit your permissions
88
+
* API tokens expire after 1 hour and need to be renewed periodically.
89
+
* individual API tokens cannot be revoked after they are generated. If a token is compromised, you may need to lock the user account or service account to prevent further access.
90
+
* Tokens are scoped to the user account or service account that was used to generate them and inherit their permissions.
90
91
* As an alternative to API tokens, you can use [service accounts and API keys](./#programmatic-access-with-service-accounts-and-api-keys) for long-term access.
91
92
{% endhint %}
92
93
@@ -100,22 +101,9 @@ To generate a new API token for the ZenML Pro API:
100
101
* Follow the migration guide in [Migration of workspace level service accounts](https://docs.zenml.io/pro/core-concepts/service-accounts#migration-of-workspace-level-service-accounts) to learn how to migrate from your existing service accounts.
101
102
{% endhint %}
102
103
103
-
Organization‑level service accounts and API keys can be used to authenticate to the ZenML Pro API and to obtain short‑lived tokens forthe Workspace API across all workspaces. See [Service Accounts](https://docs.zenml.io/pro/core-concepts/service-accounts) for setup and examples.
104
+
Organization‑level service accounts and API keys can be used to authenticate to the ZenML Pro API and the Workspace API across all workspacesin your organization. See [Service Accounts](https://docs.zenml.io/pro/core-concepts/service-accounts) for setup and examples.
104
105
105
-
{% hint style="warning" %}
106
-
Which credentials should you use?
107
-
108
-
- For organization/workspace/user management on the Pro management API (`cloudapi.zenml.io`), use short‑lived Pro API tokens (no service accounts).
109
-
- For pipeline/run‑template operations on your Workspace API (your workspace URL), use temporary user tokens or—recommended for automation—service accounts + API keys.
110
-
111
-
See the high‑level overview: [Connect to a server](https://docs.zenml.io/how-to/manage-zenml-server/connecting-to-zenml#choose-how-to-connect).
112
-
{% endhint %}
113
-
114
-
## Workspace API Authentication
115
-
116
-
The **Workspace API** is different from the ZenML Pro API and supports different authentication methods. This is the API you'll use for running snapshots and other pipeline operations.
117
-
118
-
### When to Use Which API
106
+
## When to Use Which API
119
107
120
108
| Task | Use This API | Authentication Method |
121
109
|------|-------------|----------------------|
@@ -124,6 +112,12 @@ The **Workspace API** is different from the ZenML Pro API and supports different
124
112
| Running snapshots, pipeline operations |**Workspace API** (your workspace URL) | Service accounts + API keys (recommended for automation) |
125
113
| Pipeline development, artifact management |**Workspace API** (your workspace URL) | Temporary API tokens or service accounts |
126
114
115
+
See the high‑level overview: [Connect to a server](https://docs.zenml.io/how-to/manage-zenml-server/connecting-to-zenml#choose-how-to-connect).
116
+
117
+
## Workspace API Authentication
118
+
119
+
The **Workspace API** is different from the ZenML Pro API and supports different authentication methods. This is the API you'll use for running snapshots and other pipeline operations.
120
+
127
121
### Workspace API Authentication Methods
128
122
129
123
Programmatic access to the ZenML Pro workspace API is achieved mostly the same way as the ZenML OSS server API. This is because the Workspace API in ZenML Pro is an extension of the OSS API with some additional endpoints. The only exception is that workspace level service accounts and API keys are disabled and organization level service accounts and API keys are used instead (see [Service Accounts](https://docs.zenml.io/pro/core-concepts/service-accounts)).
Copy file name to clipboardExpand all lines: docs/book/getting-started/zenml-pro/secrets-stores.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ This operation has two main stages:
17
17
18
18
## AWS Secrets Manager
19
19
20
-
The authentication used by the AWS secrets store is built on the [ZenML Service Connector](https://docs.zenml.io/stacks/service-connectors/overview) of the same type as the secrets store. This means that you can use any of the [authentication methods supported by the Service Connector](https://docs.zenml.io/stacks/service-connectors/connector-types/aws-service-connector#authentication-methods) to authenticate with the secrets store.
20
+
The authentication used by the AWS secrets store is built on the [ZenML Service Connector](https://docs.zenml.io/stacks/service-connectors/auth-management) of the same type as the secrets store. This means that you can use any of the [authentication methods supported by the Service Connector](https://docs.zenml.io/stacks/service-connectors/connector-types/aws-service-connector#authentication-methods) to authenticate with the secrets store.
21
21
22
22
The recommended authentication method documented here is to use the [implicit authentication method](https://docs.zenml.io/stacks/service-connectors/connector-types/aws-service-connector#implicit-authentication), because this doesn't need any sensitive credentials to be exchanged with the ZenML Pro support team.
23
23
@@ -236,4 +236,4 @@ After your workspace is updated, you will see the following changes in the works
0 commit comments