Skip to content

A go client library for accessing DFIRTracks API using the OpenAPI-Standard

License

Notifications You must be signed in to change notification settings

dfirtrack/dfirtrackapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for dfirtrackapi

OpenAPI 3 - Documentation of DFIRTrack API

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: v2.4.1
  • Package version: 2.4.1
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import dfirtrackapi "github.com/dfirtrack/dfirtrackapi"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://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.

ctx := context.WithValue(context.Background(), dfirtrackapi.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.

ctx := context.WithValue(context.Background(), dfirtrackapi.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.

ctx := context.WithValue(context.Background(), dfirtrackapi.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), dfirtrackapi.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
ApiApi CreateArtifact Post /api/artifact/
ApiApi CreateArtifacttype Post /api/artifacttype/
ApiApi CreateAuthToken Post /api/token-auth/
ApiApi CreateCase Post /api/case/
ApiApi CreateCasetype Post /api/casetype/
ApiApi CreateCompany Post /api/company/
ApiApi CreateContact Post /api/contact/
ApiApi CreateDivision Post /api/division/
ApiApi CreateDnsname Post /api/dnsname/
ApiApi CreateDomain Post /api/domain/
ApiApi CreateDomainuser Post /api/domainuser/
ApiApi CreateHeadline Post /api/headline/
ApiApi CreateIp Post /api/ip/
ApiApi CreateLocation Post /api/location/
ApiApi CreateNote Post /api/note/
ApiApi CreateOs Post /api/os/
ApiApi CreateOsarch Post /api/osarch/
ApiApi CreateReason Post /api/reason/
ApiApi CreateRecommendation Post /api/recommendation/
ApiApi CreateReportitem Post /api/reportitem/
ApiApi CreateServiceprovider Post /api/serviceprovider/
ApiApi CreateSystem Post /api/system/
ApiApi CreateSystemtype Post /api/systemtype/
ApiApi CreateSystemuser Post /api/systemuser/
ApiApi CreateTag Post /api/tag/
ApiApi CreateTask Post /api/task/
ApiApi CreateTaskname Post /api/taskname/
ApiApi ListAnalysisstatus Get /api/analysisstatus/
ApiApi ListArtifactprioritys Get /api/artifactpriority/
ApiApi ListArtifacts Get /api/artifact/
ApiApi ListArtifactstatus Get /api/artifactstatus/
ApiApi ListArtifacttypes Get /api/artifacttype/
ApiApi ListCaseprioritys Get /api/casepriority/
ApiApi ListCases Get /api/case/
ApiApi ListCasestatus Get /api/casestatus/
ApiApi ListCasetypes Get /api/casetype/
ApiApi ListCompanys Get /api/company/
ApiApi ListContacts Get /api/contact/
ApiApi ListDivisions Get /api/division/
ApiApi ListDnsnames Get /api/dnsname/
ApiApi ListDomains Get /api/domain/
ApiApi ListDomainusers Get /api/domainuser/
ApiApi ListHeadlines Get /api/headline/
ApiApi ListIps Get /api/ip/
ApiApi ListLocations Get /api/location/
ApiApi ListNotes Get /api/note/
ApiApi ListNotestatus Get /api/notestatus/
ApiApi ListOs Get /api/os/
ApiApi ListOsarchs Get /api/osarch/
ApiApi ListReasons Get /api/reason/
ApiApi ListRecommendations Get /api/recommendation/
ApiApi ListReportitems Get /api/reportitem/
ApiApi ListServiceproviders Get /api/serviceprovider/
ApiApi ListSystems Get /api/system/
ApiApi ListSystemstatus Get /api/systemstatus/
ApiApi ListSystemtypes Get /api/systemtype/
ApiApi ListSystemusers Get /api/systemuser/
ApiApi ListTagcolors Get /api/tagcolor/
ApiApi ListTags Get /api/tag/
ApiApi ListTasknames Get /api/taskname/
ApiApi ListTaskprioritys Get /api/taskpriority/
ApiApi ListTasks Get /api/task/
ApiApi ListTaskstatus Get /api/taskstatus/
ApiApi PartialUpdateArtifact Patch /api/artifact/{artifact_id}/
ApiApi PartialUpdateArtifacttype Patch /api/artifacttype/{artifacttype_id}/
ApiApi PartialUpdateCase Patch /api/case/{case_id}/
ApiApi PartialUpdateCasetype Patch /api/casetype/{casetype_id}/
ApiApi PartialUpdateCompany Patch /api/company/{company_id}/
ApiApi PartialUpdateContact Patch /api/contact/{contact_id}/
ApiApi PartialUpdateDivision Patch /api/division/{division_id}/
ApiApi PartialUpdateDnsname Patch /api/dnsname/{dnsname_id}/
ApiApi PartialUpdateDomain Patch /api/domain/{domain_id}/
ApiApi PartialUpdateDomainuser Patch /api/domainuser/{domainuser_id}/
ApiApi PartialUpdateHeadline Patch /api/headline/{headline_id}/
ApiApi PartialUpdateIp Patch /api/ip/{ip_id}/
ApiApi PartialUpdateLocation Patch /api/location/{location_id}/
ApiApi PartialUpdateNote Patch /api/note/{note_id}/
ApiApi PartialUpdateOs Patch /api/os/{os_id}/
ApiApi PartialUpdateOsarch Patch /api/osarch/{osarch_id}/
ApiApi PartialUpdateReason Patch /api/reason/{reason_id}/
ApiApi PartialUpdateRecommendation Patch /api/recommendation/{recommendation_id}/
ApiApi PartialUpdateReportitem Patch /api/reportitem/{reportitem_id}/
ApiApi PartialUpdateServiceprovider Patch /api/serviceprovider/{serviceprovider_id}/
ApiApi PartialUpdateSystem Patch /api/system/{system_id}/
ApiApi PartialUpdateSystemtype Patch /api/systemtype/{systemtype_id}/
ApiApi PartialUpdateSystemuser Patch /api/systemuser/{systemuser_id}/
ApiApi PartialUpdateTag Patch /api/tag/{tag_id}/
ApiApi PartialUpdateTask Patch /api/task/{task_id}/
ApiApi PartialUpdateTaskname Patch /api/taskname/{taskname_id}/
ApiApi RetrieveAnalysisstatus Get /api/analysisstatus/{analysisstatus_id}/
ApiApi RetrieveArtifact Get /api/artifact/{artifact_id}/
ApiApi RetrieveArtifactpriority Get /api/artifactpriority/{artifactpriority_id}/
ApiApi RetrieveArtifactstatus Get /api/artifactstatus/{artifactstatus_id}/
ApiApi RetrieveArtifacttype Get /api/artifacttype/{artifacttype_id}/
ApiApi RetrieveCase Get /api/case/{case_id}/
ApiApi RetrieveCasepriority Get /api/casepriority/{casepriority_id}/
ApiApi RetrieveCasestatus Get /api/casestatus/{casestatus_id}/
ApiApi RetrieveCasetype Get /api/casetype/{casetype_id}/
ApiApi RetrieveCompany Get /api/company/{company_id}/
ApiApi RetrieveContact Get /api/contact/{contact_id}/
ApiApi RetrieveDivision Get /api/division/{division_id}/
ApiApi RetrieveDnsname Get /api/dnsname/{dnsname_id}/
ApiApi RetrieveDomain Get /api/domain/{domain_id}/
ApiApi RetrieveDomainuser Get /api/domainuser/{domainuser_id}/
ApiApi RetrieveHeadline Get /api/headline/{headline_id}/
ApiApi RetrieveIp Get /api/ip/{ip_id}/
ApiApi RetrieveLocation Get /api/location/{location_id}/
ApiApi RetrieveNote Get /api/note/{note_id}/
ApiApi RetrieveNotestatus Get /api/notestatus/{notestatus_id}/
ApiApi RetrieveOs Get /api/os/{os_id}/
ApiApi RetrieveOsarch Get /api/osarch/{osarch_id}/
ApiApi RetrieveReason Get /api/reason/{reason_id}/
ApiApi RetrieveRecommendation Get /api/recommendation/{recommendation_id}/
ApiApi RetrieveReportitem Get /api/reportitem/{reportitem_id}/
ApiApi RetrieveServiceprovider Get /api/serviceprovider/{serviceprovider_id}/
ApiApi RetrieveSystem Get /api/system/{system_id}/
ApiApi RetrieveSystemstatus Get /api/systemstatus/{systemstatus_id}/
ApiApi RetrieveSystemtype Get /api/systemtype/{systemtype_id}/
ApiApi RetrieveSystemuser Get /api/systemuser/{systemuser_id}/
ApiApi RetrieveTag Get /api/tag/{tag_id}/
ApiApi RetrieveTagcolor Get /api/tagcolor/{tagcolor_id}/
ApiApi RetrieveTask Get /api/task/{task_id}/
ApiApi RetrieveTaskname Get /api/taskname/{taskname_id}/
ApiApi RetrieveTaskpriority Get /api/taskpriority/{taskpriority_id}/
ApiApi RetrieveTaskstatus Get /api/taskstatus/{taskstatus_id}/
ApiApi UpdateArtifact Put /api/artifact/{artifact_id}/
ApiApi UpdateArtifacttype Put /api/artifacttype/{artifacttype_id}/
ApiApi UpdateCase Put /api/case/{case_id}/
ApiApi UpdateCasetype Put /api/casetype/{casetype_id}/
ApiApi UpdateCompany Put /api/company/{company_id}/
ApiApi UpdateContact Put /api/contact/{contact_id}/
ApiApi UpdateDivision Put /api/division/{division_id}/
ApiApi UpdateDnsname Put /api/dnsname/{dnsname_id}/
ApiApi UpdateDomain Put /api/domain/{domain_id}/
ApiApi UpdateDomainuser Put /api/domainuser/{domainuser_id}/
ApiApi UpdateHeadline Put /api/headline/{headline_id}/
ApiApi UpdateIp Put /api/ip/{ip_id}/
ApiApi UpdateLocation Put /api/location/{location_id}/
ApiApi UpdateNote Put /api/note/{note_id}/
ApiApi UpdateOs Put /api/os/{os_id}/
ApiApi UpdateOsarch Put /api/osarch/{osarch_id}/
ApiApi UpdateReason Put /api/reason/{reason_id}/
ApiApi UpdateRecommendation Put /api/recommendation/{recommendation_id}/
ApiApi UpdateReportitem Put /api/reportitem/{reportitem_id}/
ApiApi UpdateServiceprovider Put /api/serviceprovider/{serviceprovider_id}/
ApiApi UpdateSystem Put /api/system/{system_id}/
ApiApi UpdateSystemtype Put /api/systemtype/{systemtype_id}/
ApiApi UpdateSystemuser Put /api/systemuser/{systemuser_id}/
ApiApi UpdateTag Put /api/tag/{tag_id}/
ApiApi UpdateTask Put /api/task/{task_id}/
ApiApi UpdateTaskname Put /api/taskname/{taskname_id}/

Documentation For Models

Documentation For Authorization

basicAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

bearerAuth

  • Type: HTTP Bearer token authentication

Example

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

About

A go client library for accessing DFIRTracks API using the OpenAPI-Standard

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages