This repository contains an AUXO API wrapper in GO.
AUXO API documentation: https://api.on2it.net/v3/doc
Check the tags for the most current version.
Version 2 introduces breaking changes that require code modifications when upgrading from v1.x:
Key Changes:
- Context Support: All functions that make HTTP calls now require a
context.Contextas the first parameter - Timeout Control: Timeout is now controlled via context instead of client timeout
- Better Cancellation: HTTP requests can be cancelled using context cancellation
Migration from v1.x to v2.x:
- Add
contextas the first parameter to all API calls - Update your imports to include
"context" - Use
nilfor default behavior or pass your own context for custom timeout/cancellation
Before (v1.x):
protectSurfaces, err := auxoClient.ZeroTrust.GetProtectSurfaces()After (v2.x):
// Using nil (default behavior)
protectSurfaces, err := auxoClient.ZeroTrust.GetProtectSurfaces(nil)
// Using custom context with timeout
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
protectSurfaces, err := auxoClient.ZeroTrust.GetProtectSurfaces(ctx)Version 1.x is the legacy version without context support. Use v1.x tags if you need the old API without breaking changes.
- Address of the AUXO portal (API)
- Security token
When using modules, initiate your (new) project;
go mod init github.com/projectnameAdd the API module to go.mod, it is recommended to specificly specify the version
module github.com/projectname
go 1.24
require (
github.com/on2itsecurity/go-auxo/v2 v2.0.0
)Download the package.
go mod vendor-
Include the library in your projects in the Import.
import ( "context" "time" "github.com/on2itsecurity/go-auxo/v2" )
-
Create the APIClient object with Token and Address to connect to.
auxoClient := auxo.NewClient(address, token, debug)
-
Call the functions, i.e.
// Using default context allProtectSurfaces, err := auxoClient.ZeroTrust.GetProtectSurfaces(nil) // Using context with timeout ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() allProtectSurfaces, err := auxoClient.ZeroTrust.GetProtectSurfaces(ctx)
The aim is to support all Auxo API endpoints, currently;
- Asset
- CaseIntegration
- CRM
- Eventflow
- ZeroTrust
- ZTReadiness
These different endpoints can be called with the same client, i.e.;
auxoClient.Asset.<action>
auxoClient.CaseIntegration.<action>
auxoClient.CRM.<action>
auxoClient.Eventflow.<action>
auxoClient.ZeroTrust.<action>
auxoClient.ZTReadiness.<action>