Skip to content

on2itsecurity/go-auxo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Go Reference

Introduction

This repository contains an AUXO API wrapper in GO.

AUXO API documentation: https://api.on2it.net/v3/doc

Versions

Check the tags for the most current version.

Version 2.x (Breaking Changes)

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.Context as 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:

  1. Add context as the first parameter to all API calls
  2. Update your imports to include "context"
  3. Use nil for 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 (Legacy)

Version 1.x is the legacy version without context support. Use v1.x tags if you need the old API without breaking changes.

Using the Auxo API wrapper

Requirements

  • Address of the AUXO portal (API)
  • Security token

Go MOD

When using modules, initiate your (new) project;

go mod init github.com/projectname

Add 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

Adding the package to your project

  1. Include the library in your projects in the Import.

    import (
    	"context"
    	"time"
    	"github.com/on2itsecurity/go-auxo/v2"
    )
  2. Create the APIClient object with Token and Address to connect to.

     auxoClient := auxo.NewClient(address, token, debug)
  3. 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)

Structure

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>

About

Golang API wrapper for AUXO

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages