keyfactor

package module
v24.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

README

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 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 tab. If you want to contribute actual bug fixes or proposed enhancements, use the Pull requests tab.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

Installation

Install the following dependencies:

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

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

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 Go package.

Here is an example of configuring your API client:

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:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	V1 *v1.APIClient
	V2 *v2.APIClient
}

func NewAPIClient

func NewAPIClient(cfg *auth_providers.Server) (*APIClient, error)

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL