Skip to content

Commit 903dd7c

Browse files
authored
Merge pull request #20 from Keyfactor/feat/AB#69179/sdk-v24
Create v24 SDK
2 parents e9d04a0 + f5293fc commit 903dd7c

File tree

1,130 files changed

+350012
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,130 files changed

+350012
-1
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# v24.0.0
2+
3+
## Features
4+
- Support for Keyfactor Command REST API endpoints up to 24.4
5+
- Support for v1 and v2 REST API endpoints
6+
7+
## Fixes
8+
- fix: Fixes an issue where API calls are hardcoded to `/KeyfactorAPI`. Now, the API clients can point to API subpaths defined in your authentication configuration.
9+
10+
## Breaking Changes
11+
- chore: Support for v1 and v2 REST endpoints results in new structure for calling APIs. The base API client exposes a `V1` and `V2` API client. Package names are different as a result.
12+
- chore: Changes in the OpenAPI specification results in different method and class names. Please refer to the [v1](./v24/api/keyfactor/v1/README.md#documentation-for-api-endpoints) and [v2](./v24/api/keyfactor/v2/README.md#documentation-for-api-endpoints) documentation for which class / method to use.
13+
114
# v2.0.0
215

316
## Features
@@ -9,4 +22,4 @@
922
- fix: `NewAPIClient` returns `(*APIClient, error)`
1023

1124
# v1.0.0
12-
- Initial release
25+
- Initial release

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# New SDK Version Available!
2+
3+
**This README corresponds to v1 of the Go Client SDK!**
4+
5+
All instructions in this document are relevant to v1 of the SDK. For information on the latest available SDK (and how to install it), please review the README for that SDK version.
6+
7+
As of writing, the latest available SDK is [version 24](./v24).
8+
19
# Go API client for keyfactor
210

311
This reference serves to document REST-based methods to manage and integrate with Keyfactor. In addition, an embedded

v24/README.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Go API client for Keyfactor Command
2+
3+
This reference serves to document REST-based methods to manage and integrate with Keyfactor. In addition, an embedded
4+
interface allows for the execution of calls against the current Keyfactor API instance.
5+
6+
This API client was generated against Command version 24.4.2.
7+
8+
Please reference the [Keyfactor Command API Change Log](https://software.keyfactor.com/Core-OnPrem/Current/Content/WebAPI/ChangeLogs/APIChangeLog.htm) for information about API endpoint support for your specific version of Keyfactor Command.
9+
10+
## Support for Keyfactor Command Go Client SDK
11+
12+
Keyfactor Command Go Client SDK is open source and supported on best effort level for this tool/library/client.
13+
This means customers can report Bugs, Feature Requests, Documentation amendment or questions as well as requests for
14+
customer information required for setup that needs Keyfactor access to obtain. Such requests do not follow normal SLA
15+
commitments for response or resolution. If you have a support issue, please open a support ticket via the Keyfactor
16+
Support Portal at https://support.keyfactor.com/
17+
18+
###### To report a problem or suggest a new feature, use the **[Issues](../../issues)** tab. If you want to contribute actual bug fixes or proposed enhancements, use the **[Pull requests](../../pulls)** tab.
19+
20+
---
21+
22+
## Overview
23+
24+
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using
25+
the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
26+
27+
28+
## Installation
29+
30+
Install the following dependencies:
31+
32+
```shell
33+
go get "github.com/Keyfactor/keyfactor-go-client-sdk/v24"
34+
```
35+
36+
Put the package under your project folder and add the following in import:
37+
38+
```golang
39+
package main
40+
41+
import "github.com/Keyfactor/keyfactor-go-client-sdk/api/keyfactor/v24"
42+
```
43+
44+
## Configuration
45+
46+
Configuration of the API client is done through the [github.com/Keyfactor/keyfactor-auth-client-go/auth_providers](https://github.com/Keyfactor/keyfactor-auth-client-go) Go package.
47+
48+
Here is an example of configuring your API client:
49+
50+
```go
51+
import (
52+
"context"
53+
"os"
54+
"github.com/Keyfactor/keyfactor-auth-client-go/auth_providers"
55+
"github.com/Keyfactor/keyfactor-go-client-sdk/v24"
56+
)
57+
58+
hostname := os.Getenv(auth_providers.EnvKeyfactorHostName)
59+
apiPath := os.Getenv(auth_providers.EnvKeyfactorAPIPath)
60+
61+
clientId := os.Getenv(auth_providers.EnvKeyfactorClientID)
62+
clientSecret := os.Getenv(auth_providers.EnvKeyfactorClientSecret)
63+
tokenUrl := os.Getenv(auth_providers.EnvKeyfactorAuthTokenURL)
64+
65+
oAuthNoParamsConfig := auth_providers.CommandConfigOauth{}
66+
oAuthNoParamsConfig.CommandAuthConfig.
67+
WithCommandHostName(hostname).
68+
WithCommandAPIPath(apiPath).
69+
WithSkipVerify(false).
70+
WithClientTimeout(10)
71+
oAuthNoParamsConfig.
72+
WithClientId(clientId).
73+
WithClientSecret(clientSecret).
74+
WithTokenUrl(tokenUrl).
75+
Authenticate()
76+
77+
// Configure API client
78+
client, err := keyfactor.NewAPIClient(oAuthNoParamsConfig.GetServerConfig())
79+
ctx := context.Background()
80+
81+
// api := client.V1.ExampleApi // Access V1 API Service
82+
// req := api.NewExampleRequest(ctx) // Generate request
83+
// resp, http, err := req.Execute() // Execute request
84+
85+
// api := client.V2.ExampleApi // Access V2 API Service
86+
// req := api.NewExampleRequest(ctx) // Generate request
87+
// resp, http, err := req.Execute() // Execute request
88+
89+
90+
```
91+
92+
## Documentation for API Endpoints
93+
94+
All documentation for the APIs can be found in its respective API directory:
95+
96+
- [v1 API Documentation](./api/keyfactor/v1/README.md)
97+
- [v2 API Documentation](./api/keyfactor/v2/README.md)
98+

0 commit comments

Comments
 (0)