Skip to content

Create v24 SDK #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# v24.0.0

## Features
- Support for Keyfactor Command REST API endpoints up to 24.4
- Support for v1 and v2 REST API endpoints

## Fixes
- 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.

## Breaking Changes
- 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.
- 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.

# v2.0.0

## Features
Expand All @@ -9,4 +22,4 @@
- fix: `NewAPIClient` returns `(*APIClient, error)`

# v1.0.0
- Initial release
- Initial release
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# New SDK Version Available!

**This README corresponds to v1 of the Go Client SDK!**

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.

As of writing, the latest available SDK is [version 24](./v24).

# Go API client for keyfactor

This reference serves to document REST-based methods to manage and integrate with Keyfactor. In addition, an embedded
Expand Down
98 changes: 98 additions & 0 deletions v24/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Go API client for Keyfactor Command

This reference serves to document REST-based methods to manage and integrate with Keyfactor. In addition, an embedded
interface allows for the execution of calls against the current Keyfactor API instance.

This API client was generated against Command version 24.4.2.

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.

## Support for Keyfactor Command Go Client SDK

Keyfactor Command Go Client SDK is open source and supported on best effort level for this tool/library/client.
This means customers can report Bugs, Feature Requests, Documentation amendment or questions as well as requests for
customer information required for setup that needs Keyfactor access to obtain. Such requests do not follow normal SLA
commitments for response or resolution. If you have a support issue, please open a support ticket via the Keyfactor
Support Portal at https://support.keyfactor.com/

###### 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.

---

## Overview

This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using
the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.


## Installation

Install the following dependencies:

```shell
go get "github.com/Keyfactor/keyfactor-go-client-sdk/v24"
```

Put the package under your project folder and add the following in import:

```golang
package main

import "github.com/Keyfactor/keyfactor-go-client-sdk/api/keyfactor/v24"
```

## Configuration

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.

Here is an example of configuring your API client:

```go
import (
"context"
"os"
"github.com/Keyfactor/keyfactor-auth-client-go/auth_providers"
"github.com/Keyfactor/keyfactor-go-client-sdk/v24"
)

hostname := os.Getenv(auth_providers.EnvKeyfactorHostName)
apiPath := os.Getenv(auth_providers.EnvKeyfactorAPIPath)

clientId := os.Getenv(auth_providers.EnvKeyfactorClientID)
clientSecret := os.Getenv(auth_providers.EnvKeyfactorClientSecret)
tokenUrl := os.Getenv(auth_providers.EnvKeyfactorAuthTokenURL)

oAuthNoParamsConfig := auth_providers.CommandConfigOauth{}
oAuthNoParamsConfig.CommandAuthConfig.
WithCommandHostName(hostname).
WithCommandAPIPath(apiPath).
WithSkipVerify(false).
WithClientTimeout(10)
oAuthNoParamsConfig.
WithClientId(clientId).
WithClientSecret(clientSecret).
WithTokenUrl(tokenUrl).
Authenticate()

// Configure API client
client, err := keyfactor.NewAPIClient(oAuthNoParamsConfig.GetServerConfig())
ctx := context.Background()

// api := client.V1.ExampleApi // Access V1 API Service
// req := api.NewExampleRequest(ctx) // Generate request
// resp, http, err := req.Execute() // Execute request

// api := client.V2.ExampleApi // Access V2 API Service
// req := api.NewExampleRequest(ctx) // Generate request
// resp, http, err := req.Execute() // Execute request


```

## Documentation for API Endpoints

All documentation for the APIs can be found in its respective API directory:

- [v1 API Documentation](./api/keyfactor/v1/README.md)
- [v2 API Documentation](./api/keyfactor/v2/README.md)

Loading
Loading