Skip to content

Commit 194a087

Browse files
committed
feat(config): Add validation for client config.
feat(tests): Add generated tests
1 parent 2fb837e commit 194a087

File tree

506 files changed

+4269
-2640
lines changed

Some content is hidden

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

506 files changed

+4269
-2640
lines changed

.gitignore

Lines changed: 838 additions & 1 deletion
Large diffs are not rendered by default.

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Go API client for keyfactor
1+
# Go API client for command
22

33
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.
44

@@ -20,12 +20,12 @@ go get "github.com/Keyfactor/keyfactor-go-client-sdk"
2020
Put the package under your project folder and add the following in import:
2121

2222
```golang
23-
import "github.com/Keyfactor/keyfactor-go-client-sdk/api/keyfactor"
23+
import "github.com/Keyfactor/keyfactor-go-client-sdk/api/command"
2424
```
2525

2626
## Configuration
2727

28-
The `keyfactor.NewConfiguration()` method is used to configure the Keyfactor Go Client SDK. The client can be configured
28+
The `command.NewConfiguration()` method is used to configure the Keyfactor Go Client SDK. The client can be configured
2929
by passing a map of configuration options to the `NewConfiguration()` method, or by passing a blank map and setting
3030
the configuration options individually on the returned `Configuration` object.
3131

@@ -40,8 +40,8 @@ config["domain"] = "example.com" // optional
4040
config["caCertificatePath"] = "/path/to/local/certificate" // optional
4141

4242
// Create a configuration object
43-
ejbcaConfiguration := keyfactor.NewConfiguration(config)
44-
if ejbcaConfiguration == nil {
43+
kfcmdConfiguration := command.NewConfiguration(config)
44+
if kfcmdConfiguration == nil {
4545
// handle error
4646
}
4747

@@ -56,36 +56,36 @@ or
5656

5757
```go
5858
// Create a configuration object
59-
ejbcaConfiguration := keyfactor.NewConfiguration(make(map[string]string))
59+
kfcmdConfiguration := command.NewConfiguration(make(map[string]string))
6060

6161
// Set configuration options individually
62-
ejbcaConfiguration.Host = "keyfactor.example.com"
63-
ejbcaConfiguration.BasicAuth.UserName = "admin"
64-
ejbcaConfiguration.BasicAuth.Password = "password"
65-
ejbcaConfiguration.CaCertificatePath = "/path/to/local/certificate" // optional
62+
kfcmdConfiguration.Host = "keyfactor.example.com"
63+
kfcmdConfiguration.BasicAuth.Username = "admin"
64+
kfcmdConfiguration.BasicAuth.Password = "password"
65+
kfcmdConfiguration.CaCertificatePath = "/path/to/local/certificate" // optional
6666

6767
// Create a client
68-
client := keyfactor.NewAPIClient(ejbcaConfiguration)
68+
client := keyfactor.NewAPIClient(kfcmdConfiguration)
6969
if client == nil {
7070
// handle error
7171
}
7272
```
7373

74-
The root CA certificate can also be configured by passing a slice of `*x509.Certificate` objects to the `ejbca.Configuration.SetCaCertificates()` method.
74+
The root CA certificate can also be configured by passing a slice of `*x509.Certificate` objects to the `kfcmd.Configuration.SetCaCertificates()` method.
7575
```go
7676
// Create a configuration object
77-
ejbcaConfiguration := keyfactor.NewConfiguration(make(map[string]string))
77+
kfcmdConfiguration := command.NewConfiguration(make(map[string]string))
7878

7979
// Set the root CA certificate
80-
ejbcaConfiguration.SetCaCertificates([]*x509.Certificate{caCertificate})
80+
kfcmdConfiguration.SetCaCertificates([]*x509.Certificate{caCertificate})
8181

8282
// Create a client
83-
client := keyfactor.NewAPIClient(ejbcaConfiguration)
83+
client := keyfactor.NewAPIClient(kfcmdConfiguration)
8484
```
8585

8686
## Documentation for API Endpoints
8787

88-
All URIs are relative to *http://keyfactor.example.com*
88+
All URIs are relative to *https://keyfactor.example.com*
8989

9090
Class | Method | HTTP request | Description
9191
------------ | ------------- | ------------- | -------------

api/command/api_agent.go

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/command/api_agent_blueprint.go

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/api_agent_blueprint_test.go renamed to api/command/api_agent_blueprint_test.go

Lines changed: 17 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/command/api_agent_pool.go

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/api_agent_pool_test.go renamed to api/command/api_agent_pool_test.go

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)