sonatype-nexus-community / gonexus

Go API for provisioning and interacting with Sonatype's Nexus Repository Manager and Nexus IQ Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gonexus DepShield Badge CircleCI

Provides a go client library for connecting to, and interacting with, Sonatype Nexus applications such as Nexus Repository Manager and Nexus IQ Server.

Organization of this library

The library is broken into two packages. One for each application.

nexusrm GoDoc nexusrm coverage

Create a connection to an instance of Nexus Repository Manager

// import "github.com/sonatype-nexus-community/gonexus/rm"
rm, err := nexusrm.New("http://localhost:8081", "username", "password")
if err != nil {
    panic(err)
}

Supported RM Endpoints

Endpoint Status Min RM Version
Assets πŸŒ•
Blob Store πŸŒ‘ 3.19
Components πŸŒ–
Content Selectors πŸŒ‘ 3.19
Email πŸŒ‘ 3.19
IQ Server πŸŒ‘ 3.19
Licensing πŸŒ‘ 3.19
Lifecycle πŸŒ‘
Maintenance pro 🌘
Nodes pro πŸŒ‘
Read-Only πŸŒ•
Repositories πŸŒ•
Routing Rules πŸŒ‘ 3.17
Search πŸŒ–
Script πŸŒ•
Security Management πŸŒ‘ 3.19
Staging pro πŸŒ–
Status πŸŒ•
Support πŸŒ•
Tagging pro πŸŒ–
Tasks πŸŒ‘

Supported Provisioning API

API Status
Core πŸŒ‘
Security πŸŒ‘
Blob Store πŸŒ–
Repository πŸŒ–

Legend: πŸŒ• complete πŸŒ‘ untouched πŸŒ˜πŸŒ—πŸŒ– partial support

nexusiq GoDoc nexusiq coverage

Create a connection to an instance of Nexus IQ Server

// import "github.com/sonatype-nexus-community/gonexus/iq"
iq, err := nexusiq.New("http://localhost:8070", "username", "password")
if err != nil {
    panic(err)
}

Supported IQ Endpoints

Endpoint Status Min IQ Version
Application πŸŒ•
Authorization Configuration πŸŒ• r70
Component Details πŸŒ•
Component Evaluation πŸŒ•
Component Labels πŸŒ•
Component Remediation πŸŒ• r64
Component Search πŸŒ•
Component Versions πŸŒ•
Component Waivers πŸŒ‘ r76
Configuration πŸŒ‘ r65
Data Retention Policy πŸŒ•
Organization πŸŒ•
Policy Violation πŸŒ•
Policy Waiver πŸŒ‘ r71
Promote Scan πŸŒ‘
Report-related πŸŒ•
Role πŸŒ• r70
SAML πŸŒ‘ r74
Source Control πŸŒ•
Success Metrics Data πŸŒ•
Users πŸŒ• r70
User Token πŸŒ‘ r76
Vulnerability Details πŸŒ‘ r75
Webhooks πŸŒ•

Legend: πŸŒ• complete πŸŒ‘ untouched πŸŒ˜πŸŒ—πŸŒ– partial support

iqwebhooks GoDoc nexusiq webhooks coverage

The iq/iqwebhooks subpackage provides structs for all of the event types along with helper functions.

Most notably it provides a function called Listen which is an http.HandlerFunc that can be used as an endpoint handler for a server functioning as a webhook listener. The handler will place any webhook event it finds in a channel to be consumed at will.

An example of using the handler to listen for Application Evaluation events:

// import "github.com/sonatype-nexus-community/gonexus/iq/webhooks"
appEvals, _ := iqwebhooks.ApplicationEvaluationEvents()

go func() {
    for _ = range appEvals:
        log.Println("Received Application Evaluation event")
    }
}()

http.HandleFunc("/ingest", iqwebhooks.Listen)

See the documentation for a full example showing other event types.

The Fine Print

It is worth noting that this is NOT SUPPORTED by Sonatype, and is a contribution of @HokieGeek plus us to the open source community (read: you!)

Remember:

  • Use this contribution at the risk tolerance that you have
  • Do NOT file Sonatype support tickets related to this
  • DO file issues here on GitHub, so that the community can pitch in

About

Go API for provisioning and interacting with Sonatype's Nexus Repository Manager and Nexus IQ Server

License:Other


Languages

Language:Go 100.0%