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
Upgrade from `skyflow-python` v1 using the dedicated guide in [docs/migrate_to_v2.md](docs/migrate_to_v2.md).
170
170
@@ -646,6 +646,8 @@ The SDK accepts one of several types of credentials object.
646
646
JSON-formatted string containing service account credentials. Use when integrating with secret management systems or when credentials are passed programmatically.
@@ -717,7 +719,7 @@ Digitally sign data tokens with a service account's private key to add an extra
717
719
718
720
## Logging
719
721
720
-
The SDK provides logging using python's inbuilt `logging` library. By default the logging level of the SDK is set to `LogLevel.ERROR`. This can be changed by using `set_log_level(log_level)` as shown below:
722
+
The SDK provides logging using Python's inbuilt `logging` library. By default the logging level of the SDK is set to `LogLevel.ERROR`. This can be changed by using `set_log_level(log_level)` as shown below:
721
723
722
724
Currently, the following five log levels are supported:
723
725
@@ -737,7 +739,15 @@ When `LogLevel.ERROR` is passed, only ERROR logs will be printed.
737
739
### Example: Setting LogLevel to INFO
738
740
739
741
```python
740
-
from skyflow import Skyflow, LogLevel
742
+
from skyflow import Skyflow, LogLevel, Env
743
+
744
+
# Define vault configuration
745
+
vault_config = {
746
+
'vault_id': '<VAULT_ID>',
747
+
'cluster_id': '<CLUSTER_ID>',
748
+
'env': Env.PROD,
749
+
'credentials': {'api_key': '<API_KEY>'}
750
+
}
741
751
742
752
skyflow_client = (
743
753
Skyflow.builder()
@@ -754,6 +764,8 @@ skyflow_client = (
754
764
Wrap your calls to the Skyflow SDK in try/except blocks as a best practice. Use the `SkyflowError` class to identify errors coming from Skyflow versus general request/response errors.
Copy file name to clipboardExpand all lines: docs/auth_credentials.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
@@ -1,6 +1,6 @@
1
1
# Authentication credentials options
2
2
3
-
> **Note:** Only one type of credential can be used at a time. If multiple credentials are provided, the order of precedence depends on how they are passed to the configuration.
3
+
> **Note:** Only one type of credential can be used at a time. If multiple credentials are provided, the last one added takes precedence.
4
4
5
5
1.**API keys**
6
6
A unique identifier used to authenticate and authorize requests to an API.
@@ -41,4 +41,4 @@
41
41
```
42
42
43
43
5.**Environment variables**
44
-
If no credentials are explicitly provided the SDK automatically looks for the SKYFLOW_CREDENTIALS environment variable. This variable must return an object like one of the examples above.
44
+
If no credentials are explicitly provided, the SDK automatically looks for the `SKYFLOW_CREDENTIALS` environment variable. This variable must contain a JSON string like one of the examples above.
Copy file name to clipboardExpand all lines: docs/migrate_to_v2.md
+28-26Lines changed: 28 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
# Migrate from V1 to V2
1
+
# Migrate from v1 to v2
2
2
3
-
This guide outlines the steps required to migrate the Skyflow Python SDK from version 1 (V1) to version 2 (V2).
3
+
This guide outlines the steps required to migrate the Skyflow Python SDK from version 1 (v1) to version 2 (v2).
4
4
5
5
## Authentication
6
6
7
-
In V2, multiple authentication options have been introduced. You can now provide credentials in the following ways:
7
+
In v2, multiple authentication options have been introduced. You can now provide credentials in the following ways:
8
8
9
9
-**Passing credentials in ENV** (`SKYFLOW_CREDENTIALS`) (**Recommended**)
10
10
-**API Key**
@@ -14,7 +14,7 @@ In V2, multiple authentication options have been introduced. You can now provide
14
14
15
15
These options allow you to choose the authentication method that best suits your use case.
16
16
17
-
### V1 (Old): Passing the token provider function below as a parameter to the Configuration.
17
+
### v1 (Old): Passing the token provider function below as a parameter to the Configuration.
18
18
19
19
```python
20
20
# User defined function to provide access token to the vault apis
@@ -26,7 +26,7 @@ def token_provider():
26
26
return bearer_token
27
27
```
28
28
29
-
#### V2 (New): Passing one of the following:
29
+
#### v2 (New): Passing one of the following:
30
30
31
31
```python
32
32
# Option 1: API Key (Recommended)
@@ -60,23 +60,23 @@ credentials = {
60
60
61
61
### Initializing the client
62
62
63
-
In V2, we have introduced a Builder design pattern for client initialization and added support for multi-vault. This allows you to configure multiple vaults during client initialization.
63
+
In v2, we have introduced a Builder design pattern for client initialization and added support for multi-vault. This allows you to configure multiple vaults during client initialization.
64
64
65
65
During client initialization, you can pass the following parameters:
66
66
67
67
-**`vault_id`** and **`cluster_id`**: These values are derived from the vault ID & vault URL.
68
68
-**`env`**: Specify the environment (e.g., SANDBOX or PROD).
69
69
-**`credentials`**: The necessary authentication credentials.
70
70
71
-
#### V1 (Old):
71
+
#### v1 (Old):
72
72
73
73
```python
74
74
# Initializing a Skyflow Client instance with a SkyflowConfiguration object
0 commit comments