Skip to content

Latest commit

 

History

History
135 lines (105 loc) · 11.4 KB

README.md

File metadata and controls

135 lines (105 loc) · 11.4 KB

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