![Page 1: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/1.jpg)
Hub APIs
Integrating Black Duck into Your Environment
![Page 2: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/2.jpg)
• Common Scenarios for using Hub APIs
• Introduction to the Hub APIs
• Currently Available Hub APIs
• Detailed Examples
• Future Directions
Overview
2Black Duck Customer Conference
![Page 3: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/3.jpg)
• CI/Build Systems
• Issue Trackers
• Internal Dashboard
Common Scenarios for using Hub APIs
3Black Duck Customer Conference
![Page 4: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/4.jpg)
• Reporting – Components, Vulnerabilities, Notices
• Input to Internal Systems
• Other Third Party Tools
Common Scenarios for using Hub APIs
4Black Duck Customer Conference
![Page 5: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/5.jpg)
5Black Duck Customer Conference
Hub API Introduction
![Page 6: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/6.jpg)
Richardson Maturity Model• Level 0
• Level 1: Resources
• Level 2: Verbs
• Level 3: Hypermedia Controls
Styles of REST
6Black Duck Customer Conference
![Page 7: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/7.jpg)
Hub APIs are Hypermedia REST APIs• All Resources are linked
• Links indicate what can be done next
• Permissions are determined by Links + Allow Headers
• Only initial URLs should be constructed by clients
• Versioned via Media Types
Introduction to the Hub APIs
7Black Duck Customer Conference
![Page 8: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/8.jpg)
Visual Example
Introduction to the Hub APIs
8Black Duck Customer Conference
/api/projects/{id}/versions
/api/../versions/{id}/repo
rts
/api/projects
![Page 9: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/9.jpg)
Overall Structure• All Request/Response Body Formats are JSON
• Each response that represents a resource will have metadata
• Metadata comprises of allow headers and links (also in response headers)
Introduction to the Hub APIs
9Black Duck Customer Conference
![Page 10: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/10.jpg)
• Paging – offset, limit
• Sorting - sort
• Searching - q
• Filtering – filter (not used often yet)
• Use of Headers – Allow, Location (POST result)
Hub REST API Patterns
10Black Duck Customer Conference
![Page 11: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/11.jpg)
Introduction to the Hub APIs
11Black Duck Customer Conference
Live Example: Structure
![Page 12: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/12.jpg)
12Black Duck Customer Conference
Available Hub APIs
![Page 13: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/13.jpg)
• General APIs (Most APIs fall into this category)
• Report APIs
• Notification APIs
• Extension APIs
General Categories
13Black Duck Customer Conference
![Page 14: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/14.jpg)
• Project/Version
• Component/Version
• License
• Vulnerability
• Users
• User Roles/Groups
• Code Location
• Scan Summary
• Policy
• Risk Profile
• Vulnerable Component
• Matched Files
General APIs
14Black Duck Customer Conference
![Page 15: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/15.jpg)
There are a small set of APIs to facilitate reporting
• Reporting of Components/Licenses/Files in a Project Version
• Reporting of Vulnerabilities
• Generations of Notices
Report APIs
15Black Duck Customer Conference
![Page 16: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/16.jpg)
Report REST APIs – General Interactions
16Black Duck Customer Conference
REST API Client
Hub Server
1. Request Report Creation
2. Poll for Completion
3. Request Completed Report
![Page 17: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/17.jpg)
Retrieve Notification of Events in the System
• Vulnerabilities
• Policy Violation
• License Limits (not all of them yet)
Notification APIs
17Black Duck Customer Conference
![Page 18: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/18.jpg)
Notification REST APIs – General Interactions
18Black Duck Customer Conference
REST API Client
Hub Server
1. Request Notifications, Paged
2. Request Additional Details
3. Request Notification Set
![Page 19: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/19.jpg)
• Allows an External System to Integrate with the Hub/UI
• Used by the Email Notification System
• Limited Set of Hub/UI Integration Points (will grow)
Extension APIs
19Black Duck Customer Conference
![Page 20: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/20.jpg)
Extensions REST APIs – General Interactions
20Black Duck Customer Conference
Extension Service
Hub Server
1. Register Extension
2. Request Configuration Options
3. Request Configuration Values
4. Request Other REST API Data
5. Take Other Actions
![Page 21: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/21.jpg)
Available Hub APIs
21Black Duck Customer Conference
Demo of APIs
![Page 22: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/22.jpg)
22Black Duck Customer Conference
Detailed Example
![Page 23: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/23.jpg)
• Improved REST API Documentation
• Many new APIs – BOM (read-write), Vuln Remediation APIs
• Two-Way APIs for Integrations
• Enhanced Extension Integration Points
Future Directions/Enhancements
23Black Duck Customer Conference
![Page 24: Integrating Black Duck into Your Environment with Hub APIs](https://reader031.vdocuments.mx/reader031/viewer/2022022203/5873f4d61a28abb1528b5eaf/html5/thumbnails/24.jpg)
24Black Duck Customer Conference
Questions