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: README.md
+46-96Lines changed: 46 additions & 96 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,25 +20,27 @@ from splitapiclient.main import get_client
20
20
client = get_client({'apikey': 'ADMIN API KEY'})
21
21
```
22
22
23
-
###Harness Mode
23
+
##Using in Harness Mode
24
24
25
-
Split has been acquired by Harness. This client now supports a 'harness_mode' which uses a different authentication mechanism and provides access to Harness-specific resources.
25
+
Starting with version 3.5.0, the Split API client supports operating in "harness mode" to interact with both Split and Harness Feature Flags APIs.
26
26
27
-
#### Authentication
27
+
For detailed information about Harness Feature Flags API endpoints, please refer to the [official Harness API documentation](https://apidocs.harness.io/).
28
28
29
-
In harness mode, authentication can be configured in two ways:
30
-
- Use `harness_token` for Harness endpoints and `apikey` for Split endpoints
31
-
- If `harness_token` is not provided, `apikey` will be used for all operations
29
+
### Authentication in Harness Mode
32
30
33
-
Harness endpoints use the 'x-api-key' header instead of the standard Split authentication.
31
+
The client supports multiple authentication scenarios:
34
32
35
-
#### Base URLs and Endpoints
33
+
1. Harness-specific endpoints always use the 'x-api-key' header format
34
+
2. Split endpoints will use the 'x-api-key' header when using the harness_token
35
+
3. Split endpoints will use the normal 'Authorization' header when using the apikey
36
+
4. If both harness_token and apikey are provided, the client will use the harness_token for Harness endpoints and the apikey for Split endpoints
37
+
38
+
### Base URLs and Endpoints
36
39
37
40
- Existing, non-deprecated Split endpoints continue to use the Split base URLs
38
41
- New Harness-specific endpoints use the Harness base URL (https://app.harness.io/)
39
-
- There is no v3 version for the Harness API
40
42
41
-
####Deprecated Endpoints
43
+
### Deprecated Endpoints
42
44
43
45
The following endpoints are deprecated and cannot be used in harness mode:
44
46
-`/workspaces`: POST, PATCH, DELETE, PUT verbs are deprecated
@@ -47,7 +49,7 @@ The following endpoints are deprecated and cannot be used in harness mode:
47
49
-`/groups`: all verbs are deprecated
48
50
-`/restrictions`: all verbs are deprecated
49
51
50
-
####Basic Usage
52
+
### Basic Usage
51
53
52
54
To use the client in harness mode:
53
55
@@ -58,17 +60,20 @@ from splitapiclient.main import get_client
58
60
client = get_client({
59
61
'harness_mode': True,
60
62
'harness_token': 'YOUR_HARNESS_TOKEN', # Used for Harness-specific endpoints
61
-
'apikey': 'YOUR_SPLIT_API_KEY'# Used for existing Split endpoints
63
+
'apikey': 'YOUR_SPLIT_API_KEY', # Used for existing Split endpoints
64
+
'account_identifier': 'YOUR_HARNESS_ACCOUNT_ID'# Required for Harness operations
62
65
})
63
66
64
-
# Option 2: Use apikey for all operations (if harness_token is not provided)
67
+
# Option 2: Use harness_token for all operations (if apikey is not provided)
65
68
client = get_client({
66
69
'harness_mode': True,
67
-
'apikey': 'YOUR_API_KEY'# Used for both Split and Harness endpoints
70
+
'harness_token': 'YOUR_HARNESS_TOKEN', # Used for both Harness and Split endpoints
71
+
'account_identifier': 'YOUR_HARNESS_ACCOUNT_ID'
68
72
})
73
+
69
74
```
70
75
71
-
####Working with Split Resources in Harness Mode
76
+
### Working with Split Resources in Harness Mode
72
77
73
78
You can still access standard Split resources with some restrictions:
If you don't provide the account_identifier either during initialization or with each API call, the client will raise a ValueError when you try to access Harness resources.
183
-
184
-
You can still override the account_identifier for specific calls even if you provided it during initialization:
185
-
186
-
```python
187
-
# Override the default account_identifier for a specific call
The account identifier can be found in your Harness account settings or through the Harness UI. It is typically in the format of a unique string identifying your organization in the Harness platform.
192
-
193
143
### Testing API Endpoints
194
144
195
145
#### Example: Creating and Managing Split Resources
0 commit comments