https://github.com/patrickcping/pingone-go-sdk-v2
PingOne GO SDK from code generator
https://github.com/patrickcping/pingone-go-sdk-v2
golang ping-identity pingone sdk-go
Last synced: about 2 months ago
JSON representation
PingOne GO SDK from code generator
- Host: GitHub
- URL: https://github.com/patrickcping/pingone-go-sdk-v2
- Owner: patrickcping
- License: bsd-3-clause
- Created: 2022-07-16T07:19:43.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2026-04-08T08:45:15.000Z (2 months ago)
- Last Synced: 2026-04-08T10:28:50.254Z (2 months ago)
- Topics: golang, ping-identity, pingone, sdk-go
- Language: Go
- Homepage:
- Size: 15.5 MB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# PingOne Administration GO SDK
The PingOne GO SDK provides a set of functions and stucts that help with interacting with the PingOne public cloud API.
The code is intended to be delivered as a sample, until an official GO SDK is released from Ping Identity. As such, the code is highly likely to change significantly between releases.
Code for each service is generated with the help of the [OpenAPI Generator](https://openapi-generator.tech/).
## Packages
The SDK provides a core package, and a package per PingOne service, each with their own directory off the root of the project:
* **authorize** - [Documentation](https://pkg.go.dev/github.com/patrickcping/pingone-go-sdk-v2/authorize) - for the PingOne Authorize service
* **credentials** - [Documentation](https://pkg.go.dev/github.com/patrickcping/pingone-go-sdk-v2/credentials) - for the PingOne Credentials service, part of PingOne Neo
* **management** - [Documentation](https://pkg.go.dev/github.com/patrickcping/pingone-go-sdk-v2/management) - for the PingOne platform common and SSO services
* **mfa** - [Documentation](https://pkg.go.dev/github.com/patrickcping/pingone-go-sdk-v2/mfa) - for the PingOne MFA service
* **risk** - [Documentation](https://pkg.go.dev/github.com/patrickcping/pingone-go-sdk-v2/risk) - for the PingOne Protect service
* **verify** - [Documentation](https://pkg.go.dev/github.com/patrickcping/pingone-go-sdk-v2/verify) - for the PingOne Verify service, part of PingOne Neo
## Getting Started
The client can be invoked using the following syntax:
```go
...
import (
"context"
"github.com/patrickcping/pingone-go-sdk-v2/pingone"
)
...
config := &pingone.Config{
ClientID: clientId,
ClientSecret: clientSecret,
EnvironmentID: environmentId,
AccessToken: accessToken,
RegionCode: regionCode,
}
client, err := config.APIClient(ctx)
if err != nil {
return nil, err
}
```
The result is an object with clients initialised for each service:
* `client.AuthorizeAPIClient`
* `client.CredentialsAPIClient`
* `client.ManagementAPIClient`
* `client.MFAAPIClient`
* `client.RiskAPIClient`
* `client.VerifyAPIClient`
In the above, if an `AccessToken` is provided, this will be verified and used. If the `AccessToken` is not provided, the SDK will retrieve an access token from the provided `ClientID`, `ClientSecret`, `EnvironmentID` and `RegionCode` parameters.
The client SDK defaults to production hostnames, and the `RegionCode` is used to add the relevant suffix to the hostname. For example, `EU` as a `RegionCode` value with suffix the service hostname with `.eu`. Hostnames can be overridden with the optional `APIHostnameOverride`, and `AuthHostnameOverride` parameters.
An API call can be made against the API objects, as in the following example to get all environments in a tenant:
```go
...
resp, r, err := client.ManagementAPIClient.EnvironmentsApi.ReadAllEnvironments(ctx).Execute()
if err != nil {
return nil, err
}
...
```
## Contributing
Each package is generated from an underlying OpenAPI 3 specification. Currently the OpenAPI 3 specification is stored in the `./<>/generate/pingone-<>.yml` file, although this will be subject to change in the future.
* [**authorize** OpenAPI 3 Specification file](./authorize/generate/pingone-authorize.yml)
* [**credentials** OpenAPI 3 Specification file](./credentials/generate/pingone-credentials.yml)
* [**management** OpenAPI 3 Specification file](./management/generate/pingone-management.yml)
* [**mfa** OpenAPI 3 Specification file](./mfa/generate/pingone-mfa.yml)
* [**risk** OpenAPI 3 Specification file](./risk/generate/pingone-risk.yml)
* [**verify** OpenAPI 3 Specification file](./verify/generate/pingone-verify.yml)
Once this file has been updated, from the module directory itself run `make generate`. This will generate the required `api_*.go` files, `model_*.go` files and associated documentation.
Before raising a Pull request, the resulting code can be checked using the `make devcheck` command. This will build, lint and verify the code.