Skip to content

Commit 3003f4a

Browse files
authored
Merge pull request #177 from SSHcom/docs-update-readme-part-2
docs(2.38.0): update readme docs
2 parents 3ff5d17 + 220ffa0 commit 3003f4a

File tree

1 file changed

+49
-9
lines changed

1 file changed

+49
-9
lines changed

README.md

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,21 @@ PrivX is a lean and modern privileged access management solution to automate you
1111
**Jump To**:
1212
[PrivX REST API Reference](https://privx.docs.ssh.com/reference)
1313

14+
## Table of Contents
15+
- [Getting Started](#getting-started)
16+
- [Instantiate SDK Client](#instantiate-sdk-client)
17+
- [SDK Configuration Providers](#sdk-configuration-providers)
18+
- [Identity and Access Management](#identity-and-access-management)
19+
- [How to Use the Filters Package](#how-to-use-the-filters-package)
20+
- [Bugs](#bugs)
21+
- [How to Contribute](#how-to-contribute)
22+
- [License](#license)
23+
1424
## Getting Started
1525

1626
The latest version of SDK is available at `master` branch of the repository. All development, including new features and bug fixes, take place on the `master` branch using forking and pull requests as described in contribution guidelines.
1727

18-
### Instantiate SDK Client
28+
## Instantiate SDK Client
1929

2030
PrivX SDK composes API client from three independent layers:
2131
* `restapi` generic HTTPS transport layer
@@ -63,7 +73,7 @@ func curl() restapi.Connector {
6373
roleStore := rolestore.New(curl())
6474
```
6575

66-
### SDK Configuration providers
76+
## SDK Configuration Providers
6777

6878
As application developers you have three options to configure PrivX SDK
6979
* explicitly
@@ -136,7 +146,7 @@ export PRIVX_API_OAUTH_CLIENT_ID=privx-external
136146
export PRIVX_API_OAUTH_CLIENT_SECRET=another-random-base64
137147
```
138148

139-
### Identity and Access Management
149+
## Identity And Access Management
140150

141151
Usage of PrivX SDK requires API credential, which are available from your PrivX deployment: Settings > API Clients > Add API Client. Authorizer implement OAuth2 Resource Owner Password Grant
142152

@@ -155,6 +165,35 @@ If your app needs to implement a flexible auth strategy that supports both. Use
155165
auth := oauth.With(/* ... */)
156166
```
157167

168+
## How To Use The Filters Package
169+
170+
The `filters` package simplifies handling of query parameters by providing helper functions for commonly used parameters.
171+
172+
#### **Example Usage**
173+
```go
174+
c.SearchSomething(&searchObject, filters.Paging(0, 5), filters.Sort("id", "ASC"))
175+
c.SearchSomething(&searchObject, filters.Limit(50))
176+
```
177+
178+
You can also set custom query parameters:
179+
```go
180+
c.SearchSomething(&searchObject, filters.SetCustomParams("customKey", "customValue"))
181+
```
182+
183+
We also introduced struct based query parameter handling, allowing you to define parameters using a struct with a `url` tag.
184+
```go
185+
type ExampleParams struct {
186+
Example bool `url:"example"`
187+
}
188+
189+
q := ExampleParams{
190+
Example: true,
191+
}
192+
193+
c.SearchSomething(&searchObject, filters.SetStructParams(q))
194+
```
195+
Predefined parameter structs are available in the model files of the respective service packages.
196+
158197
## Bugs
159198

160199
If you experience any issues with the library, please let us know via [GitHub issues](https://github.com/SSHcom/privx-sdk-go/issues). We appreciate detailed and accurate reports that help us to identity and replicate the issue.
@@ -166,12 +205,13 @@ If you experience any issues with the library, please let us know via [GitHub is
166205
* **Reveal** the steps you took to reproduce the problem, include code snippet or links to your project.
167206

168207

169-
## How To Contribute to SDK Version 1
208+
## How To Contribute
170209

171210
The project is [Apache 2.0](LICENSE) licensed and accepts contributions via GitHub pull requests:
172211

173-
1. Fork it
174-
2. Create your feature branch
212+
1. Before contributing, please read the [style guide](styleguide.md)
213+
2. Fork it
214+
3. Create your feature branch
175215
- For SDK v2:
176216
```sh
177217
git switch -c my-new-feature
@@ -181,15 +221,15 @@ The project is [Apache 2.0](LICENSE) licensed and accepts contributions via GitH
181221
git switch v1
182222
git switch -c my-new-feature
183223
```
184-
3. Commit your changes
224+
4. Commit your changes
185225
```sh
186226
git commit -am Added some feature
187227
```
188-
4. Push to the branch
228+
5. Push to the branch
189229
```sh
190230
git push origin my-new-feature
191231
```
192-
5. Create new Pull Request
232+
6. Create new Pull Request
193233
If the change is for SDK v1, update the base branch to `v1` when creating the PR.
194234

195235

0 commit comments

Comments
 (0)