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
The [Delinea](https://delinea.com/)[Secret Server](https://delinea.com/products/secret-server/) Python SDK contains classes that interact with Secret Server via the REST API.
8
+
9
+
The [Delinea](https://delinea.com/)[Secret Server](https://delinea.com/products/secret-server/) Python SDK contains classes that interact with Secret Server via their REST APIs.
10
+
11
+
## Authentication Support
12
+
13
+
This SDK supports both Secret Server and Platform authentication. You can use the same authorizer classes for both systems and instantiate either a Secret Server or Platform client as needed. For Secret Server, you need to create an application user with the required permissions for authentication. For Platform, you need to create a service user with the appropriate permissions for authentication.
9
14
10
15
## Install
11
16
@@ -26,17 +31,26 @@ There are three ways in which you can authorize the `SecretServer` and `SecretSe
26
31
27
32
#### Password Authorization
28
33
29
-
If using traditional `username` and `password` authentication to log in to your Secret Server, you can pass the `PasswordGrantAuthorizer` into the `SecretServer` class at instantiation. The `PasswordGrantAuthorizer` requires a `base_url`, `username`, and `password`. It optionally takes a `token_path_uri`, but defaults to `/oauth2/token`.
34
+
If using traditional `username` and `password` authentication to log in to your Secret Server either directly or through Platform, you can pass the `PasswordGrantAuthorizer` into the `SecretServer` class at instantiation. The `PasswordGrantAuthorizer` requires a `base_url`, `username`, and `password`. It optionally takes a `token_path_uri`, but defaults to `/oauth2/token` or `/identity/api/oauth2/token/xpmplatform`, depending on whether a secret server or platform is used for authentication.
30
35
36
+
##### With Secret Server
31
37
```python
32
38
from delinea.secrets.server import PasswordGrantAuthorizer
To use a domain credential, use the `DomainPasswordGrantAuthorizer`. It requires a `base_url`, `username`, `domain`, and`password`. It optionally takes a `token_path_uri`, but defaults to `/oauth2/token`.
53
+
To use a domain credential, use the `DomainPasswordGrantAuthorizer`. It requires a `base_url`, `username`, `domain`, and`password`. It optionally takes a `token_path_uri`, but defaults to `/oauth2/token`. It is applicable only when authentication is done using a secret server.
40
54
41
55
```python
42
56
from delinea.secrets.server import DomainPasswordGrantAuthorizer
The SDKAPI requires an `Authorizer`and a `tenant`.
73
+
The SDKAPI requires an `Authorizer`andeither a `tenant`or a `base_url`. In the case of plaform authentication, only a `base_url`is supported.
60
74
61
75
`tenant` simplifies the configuration when using Secret Server Cloud by assuming the default folder structure and creating the _base URL_from a template that takes the `tenant`and an optional top-level domain (TLD) that defaults to `com`, as parameters.
62
76
63
77
### Useage
64
78
65
-
Instantiate the `SecretServerCloud`classwith`tenant`andan `Authorizer` (optionally include a `tld`). To retrieve a secret, pass an integer `id` to `get_secret()` which will return the secret as a JSON encoded string.
79
+
Instantiate the `SecretServerCloud`classwith`tenant`or`base_url`, along withan `Authorizer` (when providing `tenant`, yoou may optionally include a `tld`). To retrieve a secret, pass an integer `id` to `get_secret()` which will return the secret as a JSON encoded string.
66
80
81
+
##### With Secret Server
67
82
```python
68
83
from delinea.secrets.server import SecretServerCloud
The SDKAPI also contains a `Secret``@dataclass` containing a subset of the Secret's attributes and a dictionary of all the fields keyed by the Secret's `slug`.
80
109
81
110
## Initializing SecretServer
@@ -86,12 +115,21 @@ The SDK API also contains a `Secret` `@dataclass` containing a subset of the Sec
86
115
87
116
To instantiate the `SecretServer`class, it requires a `base_url`, an `Authorizer`object (see above), and an optional `api_path_uri` (defaults to `"/api/v1"`)
0 commit comments