-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hayden Roszell
committed
Feb 13, 2023
1 parent
b813a7c
commit 333a7b3
Showing
122 changed files
with
26,962 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
*.o | ||
*.a | ||
*.so | ||
|
||
# Folders | ||
_obj | ||
_test | ||
|
||
# Architecture specific extensions/prefixes | ||
*.[568vq] | ||
[568vq].out | ||
|
||
*.cgo1.go | ||
*.cgo2.c | ||
_cgo_defun.c | ||
_cgo_gotypes.go | ||
_cgo_export.* | ||
|
||
_testmain.go | ||
|
||
*.exe | ||
*.test | ||
*.prof | ||
|
||
# GoLand | ||
.idea/ | ||
.openapi-generator | ||
*.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
GO_PACKAGE_NAME = ejbca | ||
GIT_USER_ID = Keyfactor | ||
GIT_REPO_NAME = ejbca-go-client-sdk | ||
OPENAPI_YAML = ejbca-7.10.0.1-patched.yaml | ||
OPENAPI_GENERATOR_VERSION = 6.3.0 | ||
|
||
generate: clean | ||
@echo "Initializing..." | ||
@wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/$(OPENAPI_GENERATOR_VERSION)/openapi-generator-cli-$(OPENAPI_GENERATOR_VERSION).jar -O openapi-generator-cli.jar | ||
@echo "Generating..." | ||
@java -jar openapi-generator-cli.jar generate -i $(OPENAPI_YAML) -p packageName=$(GO_PACKAGE_NAME) $(OPENAPI_ARGS) -g go -p isGoSubmodule=true -p disallowAdditionalPropertiesIfNotPresent=false --git-user-id $(GIT_USER_ID) --git-repo-id $(GIT_REPO_NAME) | ||
@mkdir ./api/$(GO_PACKAGE_NAME) || (echo /api/$(GO_PACKAGE_NAME) exists) | ||
@mv ./*.go ./api/$(GO_PACKAGE_NAME) -f || (echo no files to move) | ||
@rm .travis.yml || (echo no .travis.yml to remove) | ||
@rm .openapi-generator-ignore || (echo no .openapi-generator-ignore to remove) | ||
@rm git_push.sh || (echo no git_push.sh to remove) | ||
@echo "Cleaning up..." | ||
@rm openapi-generator-cli.jar | ||
@echo "Done." | ||
|
||
clean: | ||
@echo "Cleaning..." | ||
@rm -rf ./api/$(GO_PACKAGE_NAME) || (echo no ./api/$(GO_PACKAGE_NAME) to remove) | ||
@rm -rf ./go.mod || (echo no ./go.mod to remove) | ||
@rm -rf ./go.sum || (echo no ./go.sum to remove) | ||
@rm -rf ./docs || (echo no ./docs to remove) | ||
@rm -rf ./test || (echo no ./test to remove) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
# Go API client for ejbca | ||
|
||
API reference documentation. | ||
|
||
## 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. | ||
|
||
- API version: 1.0 | ||
- Package version: 1.0.0 | ||
- Build package: org.openapitools.codegen.languages.GoClientCodegen | ||
|
||
## Installation | ||
|
||
Install the following dependencies: | ||
|
||
```shell | ||
go get github.com/stretchr/testify/assert | ||
go get golang.org/x/net/context | ||
``` | ||
|
||
Put the package under your project folder and add the following in import: | ||
|
||
```golang | ||
import ejbca "github.com/Keyfactor/ejbca-go-client-sdk/ejbca" | ||
``` | ||
|
||
To use a proxy, set the environment variable `HTTP_PROXY`: | ||
|
||
```golang | ||
os.Setenv("HTTP_PROXY", "http:https://proxy_name:proxy_port") | ||
``` | ||
|
||
## Configuration of Server URL | ||
|
||
Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. | ||
|
||
### Select Server Configuration | ||
|
||
For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. | ||
|
||
```golang | ||
ctx := context.WithValue(context.Background(), ejbca.ContextServerIndex, 1) | ||
``` | ||
|
||
### Templated Server URL | ||
|
||
Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. | ||
|
||
```golang | ||
ctx := context.WithValue(context.Background(), ejbca.ContextServerVariables, map[string]string{ | ||
"basePath": "v2", | ||
}) | ||
``` | ||
|
||
Note, enum values are always validated and all unused variables are silently ignored. | ||
|
||
### URLs Configuration per Operation | ||
|
||
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. | ||
An operation is uniquely identified by `"{classname}Service.{nickname}"` string. | ||
Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. | ||
|
||
```golang | ||
ctx := context.WithValue(context.Background(), ejbca.ContextOperationServerIndices, map[string]int{ | ||
"{classname}Service.{nickname}": 2, | ||
}) | ||
ctx = context.WithValue(context.Background(), ejbca.ContextOperationServerVariables, map[string]map[string]string{ | ||
"{classname}Service.{nickname}": { | ||
"port": "8443", | ||
}, | ||
}) | ||
``` | ||
|
||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *http:https://localhost/ejbca/ejbca-rest-api* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*V1CaApi* | [**CreateCrl**](docs/V1CaApi.md#createcrl) | **Post** /v1/ca/{issuer_dn}/createcrl | Create CRL(main, partition and delta) issued by this CA | ||
*V1CaApi* | [**GetCertificateAsPem**](docs/V1CaApi.md#getcertificateaspem) | **Get** /v1/ca/{subject_dn}/certificate/download | Get PEM file with the active CA certificate chain | ||
*V1CaApi* | [**GetLatestCrl**](docs/V1CaApi.md#getlatestcrl) | **Get** /v1/ca/{issuer_dn}/getLatestCrl | Returns the latest CRL issued by this CA | ||
*V1CaApi* | [**ImportCrl**](docs/V1CaApi.md#importcrl) | **Post** /v1/ca/{issuer_dn}/importcrl | Import a certificate revocation list (CRL) for a CA | ||
*V1CaApi* | [**ListCas**](docs/V1CaApi.md#listcas) | **Get** /v1/ca | Returns the Response containing the list of CAs with general information per CA as Json | ||
*V1CaApi* | [**Status1**](docs/V1CaApi.md#status1) | **Get** /v1/ca/status | Get the status of this REST Resource | ||
*V1CaManagementApi* | [**Activate**](docs/V1CaManagementApi.md#activate) | **Put** /v1/ca_management/{ca_name}/activate | Activate a CA | ||
*V1CaManagementApi* | [**Deactivate**](docs/V1CaManagementApi.md#deactivate) | **Put** /v1/ca_management/{ca_name}/deactivate | Deactivate a CA | ||
*V1CaManagementApi* | [**Status**](docs/V1CaManagementApi.md#status) | **Get** /v1/ca_management/status | Get the status of this REST Resource | ||
*V1CertificateApi* | [**CertificateRequest**](docs/V1CertificateApi.md#certificaterequest) | **Post** /v1/certificate/certificaterequest | Enrollment with client generated keys for an existing End Entity | ||
*V1CertificateApi* | [**EnrollKeystore**](docs/V1CertificateApi.md#enrollkeystore) | **Post** /v1/certificate/enrollkeystore | Keystore enrollment | ||
*V1CertificateApi* | [**EnrollPkcs10Certificate**](docs/V1CertificateApi.md#enrollpkcs10certificate) | **Post** /v1/certificate/pkcs10enroll | Enrollment with client generated keys, using CSR subject | ||
*V1CertificateApi* | [**FinalizeEnrollment**](docs/V1CertificateApi.md#finalizeenrollment) | **Post** /v1/certificate/{request_id}/finalize | Finalize enrollment | ||
*V1CertificateApi* | [**GetCertificatesAboutToExpire**](docs/V1CertificateApi.md#getcertificatesabouttoexpire) | **Get** /v1/certificate/expire | Get a list of certificates that are about to expire | ||
*V1CertificateApi* | [**RevocationStatus**](docs/V1CertificateApi.md#revocationstatus) | **Get** /v1/certificate/{issuer_dn}/{certificate_serial_number}/revocationstatus | Checks revocation status of the specified certificate | ||
*V1CertificateApi* | [**RevokeCertificate**](docs/V1CertificateApi.md#revokecertificate) | **Put** /v1/certificate/{issuer_dn}/{certificate_serial_number}/revoke | Revokes the specified certificate | ||
*V1CertificateApi* | [**SearchCertificates**](docs/V1CertificateApi.md#searchcertificates) | **Post** /v1/certificate/search | Searches for certificates confirming given criteria. | ||
*V1CertificateApi* | [**Status2**](docs/V1CertificateApi.md#status2) | **Get** /v1/certificate/status | Get the status of this REST Resource | ||
*V1ConfigdumpApi* | [**GetJsonConfigdump**](docs/V1ConfigdumpApi.md#getjsonconfigdump) | **Get** /v1/configdump | Get the configuration in JSON. | ||
*V1ConfigdumpApi* | [**GetJsonConfigdumpForType**](docs/V1ConfigdumpApi.md#getjsonconfigdumpfortype) | **Get** /v1/configdump/{type} | Get the configuration for type in JSON. | ||
*V1ConfigdumpApi* | [**GetJsonConfigdumpForTypeAndSetting**](docs/V1ConfigdumpApi.md#getjsonconfigdumpfortypeandsetting) | **Get** /v1/configdump/{type}/{setting} | Get the configuration for a type and setting in JSON. | ||
*V1ConfigdumpApi* | [**GetZipExport**](docs/V1ConfigdumpApi.md#getzipexport) | **Get** /v1/configdump/configdump.zip | Get the configuration as a ZIP file. | ||
*V1ConfigdumpApi* | [**PostJsonImport**](docs/V1ConfigdumpApi.md#postjsonimport) | **Post** /v1/configdump | Put the configuration in JSON. | ||
*V1ConfigdumpApi* | [**PostZipImport**](docs/V1ConfigdumpApi.md#postzipimport) | **Post** /v1/configdump/configdump.zip | Put the configuration as a ZIP file. | ||
*V1ConfigdumpApi* | [**Status4**](docs/V1ConfigdumpApi.md#status4) | **Get** /v1/configdump/status | Get the status of this REST Resource | ||
*V1CryptotokenApi* | [**Activate1**](docs/V1CryptotokenApi.md#activate1) | **Put** /v1/cryptotoken/{cryptotoken_name}/activate | Activate a Crypto Token | ||
*V1CryptotokenApi* | [**Deactivate1**](docs/V1CryptotokenApi.md#deactivate1) | **Put** /v1/cryptotoken/{cryptotoken_name}/deactivate | Deactivate a Crypto Token | ||
*V1CryptotokenApi* | [**GenerateKeys**](docs/V1CryptotokenApi.md#generatekeys) | **Post** /v1/cryptotoken/{cryptotoken_name}/generatekeys | Generate keys | ||
*V1CryptotokenApi* | [**RemoveKeys**](docs/V1CryptotokenApi.md#removekeys) | **Post** /v1/cryptotoken/{cryptotoken_name}/{key_pair_alias}/removekeys | Remove keys | ||
*V1CryptotokenApi* | [**Status5**](docs/V1CryptotokenApi.md#status5) | **Get** /v1/cryptotoken/status | Get the status of this REST Resource | ||
*V1EndentityApi* | [**Add**](docs/V1EndentityApi.md#add) | **Post** /v1/endentity | Add new end entity, if it does not exist | ||
*V1EndentityApi* | [**Delete**](docs/V1EndentityApi.md#delete) | **Delete** /v1/endentity/{endentity_name} | Deletes end entity | ||
*V1EndentityApi* | [**Revoke**](docs/V1EndentityApi.md#revoke) | **Put** /v1/endentity/{endentity_name}/revoke | Revokes all end entity certificates | ||
*V1EndentityApi* | [**Search**](docs/V1EndentityApi.md#search) | **Post** /v1/endentity/search | Searches for end entity confirming given criteria. | ||
*V1EndentityApi* | [**Setstatus**](docs/V1EndentityApi.md#setstatus) | **Post** /v1/endentity/{endentity_name}/setstatus | Edits end entity setting new status | ||
*V1EndentityApi* | [**Status6**](docs/V1EndentityApi.md#status6) | **Get** /v1/endentity/status | Get the status of this REST Resource | ||
*V1SshApi* | [**Pubkey**](docs/V1SshApi.md#pubkey) | **Get** /v1/ssh/{ca_name}/pubkey | Retrieves a CA's public key in SSH format. | ||
*V1SshApi* | [**Status8**](docs/V1SshApi.md#status8) | **Get** /v1/ssh/status | Get the status of this REST Resource | ||
*V2CertificateApi* | [**GetCertificateProfileInfo**](docs/V2CertificateApi.md#getcertificateprofileinfo) | **Get** /v2/certificate/profile/{profile_name} | Get Certificate Profile Info. | ||
*V2CertificateApi* | [**SearchCertificates1**](docs/V2CertificateApi.md#searchcertificates1) | **Post** /v2/certificate/search | Searches for certificates confirming given criteria and pagination. | ||
*V2CertificateApi* | [**Status3**](docs/V2CertificateApi.md#status3) | **Get** /v2/certificate/status | Get the status of this REST Resource | ||
*V2EndentityApi* | [**GetAuthorizedEndEntityProfiles**](docs/V2EndentityApi.md#getauthorizedendentityprofiles) | **Get** /v2/endentity/profiles/authorized | List of authorized end entity profiles for the current admin. | ||
*V2EndentityApi* | [**Profile**](docs/V2EndentityApi.md#profile) | **Get** /v2/endentity/profile/{endentity_profile_name} | Get End Entity Profile content | ||
*V2EndentityApi* | [**SortedSearch**](docs/V2EndentityApi.md#sortedsearch) | **Post** /v2/endentity/search | Searches and sorts for end entity conforming given criteria. | ||
*V2EndentityApi* | [**Status7**](docs/V2EndentityApi.md#status7) | **Get** /v2/endentity/status | Get the status of this REST Resource | ||
|
||
|
||
## Documentation For Models | ||
|
||
- [AddEndEntityRestRequest](docs/AddEndEntityRestRequest.md) | ||
- [AuthorizedEEPsRestResponse](docs/AuthorizedEEPsRestResponse.md) | ||
- [CaInfoRestResponse](docs/CaInfoRestResponse.md) | ||
- [CaInfosRestResponse](docs/CaInfosRestResponse.md) | ||
- [CertificateProfileInfoRestResponseV2](docs/CertificateProfileInfoRestResponseV2.md) | ||
- [CertificateRequestRestRequest](docs/CertificateRequestRestRequest.md) | ||
- [CertificateRestResponse](docs/CertificateRestResponse.md) | ||
- [CertificateRestResponseV2](docs/CertificateRestResponseV2.md) | ||
- [CertificatesRestResponse](docs/CertificatesRestResponse.md) | ||
- [ConfigdumpResults](docs/ConfigdumpResults.md) | ||
- [CreateCrlRestResponse](docs/CreateCrlRestResponse.md) | ||
- [CrlRestResponse](docs/CrlRestResponse.md) | ||
- [CryptoTokenActivationRestRequest](docs/CryptoTokenActivationRestRequest.md) | ||
- [CryptoTokenKeyGenerationRestRequest](docs/CryptoTokenKeyGenerationRestRequest.md) | ||
- [EndEntityProfileResponse](docs/EndEntityProfileResponse.md) | ||
- [EndEntityProfileRestResponse](docs/EndEntityProfileRestResponse.md) | ||
- [EndEntityRestResponse](docs/EndEntityRestResponse.md) | ||
- [EndEntityRevocationRestRequest](docs/EndEntityRevocationRestRequest.md) | ||
- [EnrollCertificateRestRequest](docs/EnrollCertificateRestRequest.md) | ||
- [ExpiringCertificatesRestResponse](docs/ExpiringCertificatesRestResponse.md) | ||
- [ExtendedInformationRestRequestComponent](docs/ExtendedInformationRestRequestComponent.md) | ||
- [ExtendedInformationRestResponseComponent](docs/ExtendedInformationRestResponseComponent.md) | ||
- [FinalizeRestRequest](docs/FinalizeRestRequest.md) | ||
- [KeyStoreRestRequest](docs/KeyStoreRestRequest.md) | ||
- [Pagination](docs/Pagination.md) | ||
- [PaginationRestResponseComponent](docs/PaginationRestResponseComponent.md) | ||
- [PaginationSummary](docs/PaginationSummary.md) | ||
- [RestResourceStatusRestResponse](docs/RestResourceStatusRestResponse.md) | ||
- [RevokeStatusRestResponse](docs/RevokeStatusRestResponse.md) | ||
- [SearchCertificateCriteriaRestRequest](docs/SearchCertificateCriteriaRestRequest.md) | ||
- [SearchCertificateSortRestRequest](docs/SearchCertificateSortRestRequest.md) | ||
- [SearchCertificatesRestRequest](docs/SearchCertificatesRestRequest.md) | ||
- [SearchCertificatesRestRequestV2](docs/SearchCertificatesRestRequestV2.md) | ||
- [SearchCertificatesRestResponse](docs/SearchCertificatesRestResponse.md) | ||
- [SearchCertificatesRestResponseV2](docs/SearchCertificatesRestResponseV2.md) | ||
- [SearchEndEntitiesRestRequest](docs/SearchEndEntitiesRestRequest.md) | ||
- [SearchEndEntitiesRestRequestV2](docs/SearchEndEntitiesRestRequestV2.md) | ||
- [SearchEndEntitiesRestResponse](docs/SearchEndEntitiesRestResponse.md) | ||
- [SearchEndEntitiesSortRestRequest](docs/SearchEndEntitiesSortRestRequest.md) | ||
- [SearchEndEntityCriteriaRestRequest](docs/SearchEndEntityCriteriaRestRequest.md) | ||
- [SetEndEntityStatusRestRequest](docs/SetEndEntityStatusRestRequest.md) | ||
- [SshPublicKeyRestResponse](docs/SshPublicKeyRestResponse.md) | ||
|
||
|
||
## Documentation For Authorization | ||
|
||
|
||
|
||
### bearerAuth | ||
|
||
- **Type**: HTTP Bearer token authentication | ||
|
||
Example | ||
|
||
```golang | ||
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING") | ||
r, err := client.Service.Operation(auth, args) | ||
``` | ||
|
||
|
||
## Documentation for Utility Methods | ||
|
||
Due to the fact that model structure members are all pointers, this package contains | ||
a number of utility functions to easily obtain pointers to values of basic types. | ||
Each of these functions takes a value of the given basic type and returns a pointer to it: | ||
|
||
* `PtrBool` | ||
* `PtrInt` | ||
* `PtrInt32` | ||
* `PtrInt64` | ||
* `PtrFloat` | ||
* `PtrFloat32` | ||
* `PtrFloat64` | ||
* `PtrString` | ||
* `PtrTime` | ||
|
||
## Author | ||
|
||
|
||
|
Oops, something went wrong.