Skip to content

Commit f325171

Browse files
author
Ricky White
committed
Updated Docs (Fixes #40)
1 parent 3e79534 commit f325171

1 file changed

Lines changed: 27 additions & 24 deletions

File tree

README.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,9 @@ The [Thycotic](https://thycotic.com/) [Secret Server](https://thycotic.com/produ
1010
python -m pip install python-tss-sdk
1111
```
1212

13-
## Secret Server Cloud
14-
15-
The SDK API requires a `username`, `password`, and a `tenant`.
16-
17-
`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.
18-
19-
### Use
20-
21-
Instantiate the `SecretServerCloud` class with `tenant` , `username` and `password` and (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.
22-
23-
```python
24-
from thycotic.secrets.server import SecretServerCloud
13+
## Secret Server Authentication
2514

26-
secret_server = SecretServerCloud("mytenant", "myusername", "mypassword")
27-
28-
secret = secret_server.get_secret(1)
29-
```
30-
31-
The SDK API 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`.
32-
33-
## Secret Server
34-
35-
There are three ways in which you can authorize the `SecretServer` class to fetch secrets.
15+
There are three ways in which you can authorize the `SecretServer` and `SecretServerCloud` classes to fetch secrets.
3616

3717
- Password Authorization (with `PasswordGrantAuthorizer`)
3818
- Domain Authorization (with `DomainPasswordGrantAuthorizer`)
@@ -70,11 +50,33 @@ from thycotic.secrets.server import AccessTokenAuthorizer
7050
authorizer = AccessTokenAuthorizer("AgJ1slfZsEng9bKsssB-tic0Kh8I...")
7151
```
7252

73-
### Initializing SecretServer
53+
## Secret Server Cloud
54+
55+
The SDK API requires an `Authorizer` and a `tenant`.
56+
57+
`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.
58+
59+
### Useage
60+
61+
Instantiate the `SecretServerCloud` class with `tenant` and an `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.
62+
63+
```python
64+
from thycotic.secrets.server import SecretServerCloud
65+
66+
secret_server = SecretServerCloud("mytenant", authorizer)
67+
68+
secret = secret_server.get_secret(1)
69+
```
70+
71+
The SDK API 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`.
72+
73+
## Initializing SecretServer
74+
75+
### Useage
7476

7577
> NOTE: In v1.0.0 `SecretServer` replaces `SecretServerV1`. However, `SecretServerV0` is available to use instead, for backwards compatibility with v0.0.5 and v0.0.6.
7678
77-
To instantiate the `SecretServer` class, it requires a `base_url`, `authorizer` object (see above), and an optional `api_path_uri` (defaults to `"/api/v1"`)
79+
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"`)
7880

7981
```python
8082
from thycotic.secrets.server import SecretServer
@@ -141,6 +143,7 @@ export TSS_USERNAME=myusername
141143
export TSS_PASSWORD=mysecretpassword
142144
export TSS_TENANT=mytenant
143145
export SECRET_ID=42
146+
export SECRET_PATH=\Test Secrets\SecretName
144147
```
145148

146149
The tests assume that the user associated with the specified `TSS_USERNAME` and `TSS_PASSWORD` can read the secret to be fetched, and that the Secret itself contains `username` and `password` fields.

0 commit comments

Comments
 (0)