-
Notifications
You must be signed in to change notification settings - Fork 731
Expand file tree
/
Copy pathopenapi.yaml
More file actions
858 lines (832 loc) · 26.1 KB
/
Copy pathopenapi.yaml
File metadata and controls
858 lines (832 loc) · 26.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
openapi: 3.1.0
info:
title: CDP Public API — Packages & Stewardship
version: 1.0.0
description: >
Read-only endpoints for the OSSPREY Self Serve program.
**Authentication:** OAuth 2.0 M2M bearer token.
Package endpoints require `read:packages` or `read:stewardships`.
The batch stewardship endpoint requires `read:stewardships` only.
**V1 constraints:** All stewardship rows are `unassigned`.
Write endpoints and state transitions are deferred to v2.
servers:
- url: https://cm.lfx.dev/api/v1
description: Production
- url: https://lf-staging.crowd.dev/api/v1
description: Staging
tags:
- name: Packages
description: Package list and detail.
- name: Stewardship
description: Stewardship state — individual and batch.
components:
securitySchemes:
M2MBearer:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
# ── Shared ───────────────────────────────────────────────────────────────────
Error:
type: object
required: [error]
properties:
error:
type: object
required: [code, message]
properties:
code:
type: string
example: NOT_FOUND
message:
type: string
example: Package not found.
OpenVulns:
type: object
description: Open vulnerability counts by severity from advisory_packages + advisories.
required: [low, medium, high, critical]
properties:
low:
type: integer
example: 0
medium:
type: integer
example: 0
high:
type: integer
example: 1
critical:
type: integer
example: 0
# ── Stewardship ─────────────────────────────────────────────────────────────
StewardshipStatus:
type: string
enum:
- unassigned
- open
- assessing
- active
- needs_attention
- escalated
- blocked
- inactive
Steward:
type: object
required: [userId, role, assignedAt]
properties:
userId:
type: string
description: Auth0 sub of the assigned steward.
example: abc123
username:
type:
- string
- 'null'
description: Username of the steward. Null if not available.
example: jrodriguez
displayName:
type:
- string
- 'null'
description: Display name of the steward. Null if not available.
example: Jonathan R.
role:
type: string
enum: [lead, co_steward]
assignedAt:
type: string
format: date-time
# Lean shape used in batch response and list items.
StewardshipSummary:
type: object
description: Null if the purl is not found in CDP.
required:
[name, ecosystem, stewardship, stewards, openVulns, lastActivityAt, lastActivityDescription]
properties:
name:
type: string
example: lodash
ecosystem:
type: string
example: npm
lifecycle:
type:
- string
- 'null'
enum: [active, stable, declining, abandoned, null]
health:
type:
- integer
- 'null'
example: 52
impact:
type:
- integer
- 'null'
example: 94
openVulns:
oneOf:
- $ref: '#/components/schemas/OpenVulns'
- type: 'null'
stewardship:
$ref: '#/components/schemas/StewardshipStatus'
stewards:
description: Assigned stewards or null. Empty in v1.
oneOf:
- type: array
items:
$ref: '#/components/schemas/Steward'
- type: 'null'
lastActivityAt:
type:
- string
- 'null'
format: date-time
description: Null in v1.
lastActivityDescription:
type:
- string
- 'null'
description: Null in v1.
# ── Package list item ────────────────────────────────────────────────────────
PackageListItem:
type: object
required: [purl, name, ecosystem]
properties:
purl:
type: string
description: Used to call GET /packages/detail?purl= when a row is clicked.
example: pkg:npm/lodash
name:
type: string
example: lodash
ecosystem:
type: string
example: npm
health:
type: object
required: [score, label]
properties:
score:
type:
- integer
- 'null'
description: Health score (0–100) derived from OpenSSF Scorecard. Null if no repo is linked.
example: 18
label:
type: string
enum: [healthy, fair, concerning, critical]
description: 'Derived from score: healthy ≥70, fair 50–69, concerning 30–49, critical <30 or null.'
example: critical
impact:
type:
- integer
- 'null'
example: 71
lifecycle:
type:
- string
- 'null'
enum: [active, stable, declining, abandoned, null]
maintainerBusFactor:
type:
- integer
- 'null'
example: 1
openVulns:
oneOf:
- $ref: '#/components/schemas/OpenVulns'
- type: 'null'
stewardshipId:
type:
- string
- 'null'
description: Stewardship ID. Required to call mutation endpoints (assign/escalate/status). Null if no stewardship row exists.
example: '42'
stewardship:
$ref: '#/components/schemas/StewardshipStatus'
stewards:
description: Assigned stewards. Empty array if none.
type: array
items:
$ref: '#/components/schemas/Steward'
# ── Package detail ───────────────────────────────────────────────────────────
Advisory:
type: object
required: [osvId, severity]
properties:
osvId:
type: string
description: GHSA or CVE identifier.
example: CVE-2021-44906
severity:
type: string
enum: [critical, high, medium, low]
resolution:
type:
- string
- 'null'
description: Resolution status. TBD.
SecurityContact:
type: object
required: [name]
properties:
name:
type:
- string
- 'null'
email:
type:
- string
- 'null'
format: email
PackageDetail:
type: object
required: [purl, name, ecosystem, general, assessment, security, provenance, history]
properties:
purl:
type: string
example: pkg:npm/lodash
name:
type: string
example: lodash
ecosystem:
type: string
example: npm
general:
type: object
properties:
healthScore:
type:
- integer
- 'null'
description: Composite health score (0–100). Tinybird-enriched when available, null otherwise.
example: 18
healthScoreDetails:
type:
- object
- 'null'
description: Breakdown of the composite health score. Null until Tinybird enrichment runs.
properties:
total:
type:
- integer
- 'null'
example: 18
label:
type:
- string
- 'null'
example: Good
maintainerHealth:
type:
- integer
- 'null'
example: 4
securitySupplyChain:
type:
- integer
- 'null'
example: 8
developmentActivity:
type:
- integer
- 'null'
example: 6
healthBand:
type:
- string
- 'null'
enum: [healthy, fair, concerning, critical, null]
description: Derived from Tinybird health score when available, OpenSSF Scorecard otherwise.
example: concerning
impact:
type:
- object
- 'null'
properties:
impactScore:
type:
- integer
- 'null'
example: 71
downloadsLastMonth:
type:
- integer
- 'null'
description: Null for Maven (Sonatype data not yet ingested).
example: 52142891
dependentPackages:
type:
- integer
- 'null'
example: 142312
dependentRepos:
type:
- integer
- 'null'
example: 39104
transitiveReach:
type:
- string
- 'null'
example: 'Top 0.4%'
riskSignals:
type:
- object
- 'null'
properties:
lifecycle:
type:
- string
- 'null'
enum: [active, stable, declining, abandoned, null]
maintainerBusFactor:
type:
- integer
- 'null'
example: 1
lastRelease:
type:
- string
- 'null'
format: date-time
hasSecurityFile:
type:
- boolean
- 'null'
openSSFScorecard:
type:
- number
- 'null'
format: float
example: 5.2
assessment:
type: object
description: Stewardship assessment data. Empty in v1 — assessment flow deferred to v2.
security:
type: object
properties:
securityContacts:
type:
- array
- 'null'
items:
$ref: '#/components/schemas/SecurityContact'
advisories:
type: array
items:
$ref: '#/components/schemas/Advisory'
cvd:
type: object
description: Coordinated Vulnerability Disclosure readiness signals.
properties:
isPvrEnabled:
type:
- boolean
- 'null'
description: Private Vulnerability Reporting enabled. Null in v1.
hasSecurityPolicyEnabled:
type:
- boolean
- 'null'
description: SECURITY.md present in repo. Null until enricher captures this.
tier0Steward:
type:
- string
- 'null'
description: Name of the Tier 0 steward if assigned. Null in v1.
criticalVulnerabilityFlag:
type:
- boolean
- 'null'
description: True if any open advisory has cvss >= 7.0.
provenance:
type: object
properties:
repositoryMapping:
type:
- object
- 'null'
properties:
declaredRepo:
type:
- string
- 'null'
format: uri
example: https://github.com/lodash/lodash
mappingConfidence:
type:
- number
- 'null'
format: float
example: 0.98
lastCommitAt:
type:
- string
- 'null'
format: date-time
supplyChainIntegrity:
type: object
description: All fields null in v1 — separate ingestion workstream required.
properties:
buildProvenance:
type:
- string
- 'null'
signedReleases:
type:
- string
- 'null'
stewardship:
type: object
description: Stewardship state.
properties:
id:
type:
- string
- 'null'
description: Stewardship ID. Required to call mutation endpoints (assign/escalate/status).
example: '42'
status:
$ref: '#/components/schemas/StewardshipStatus'
stewards:
description: Assigned stewards or null.
oneOf:
- type: array
items:
$ref: '#/components/schemas/Steward'
- type: 'null'
lastActivityAt:
type:
- string
- 'null'
format: date-time
resolutionPath:
type:
- string
- 'null'
description: Set on `escalated` status. Null for all other statuses.
statusNote:
type:
- string
- 'null'
description: Free-text note for the current status.
history:
type: object
description: Package history data. Empty in v1.
signalCoverageHealth:
type:
- object
- 'null'
description: Signal coverage health data enriched by Tinybird. Null until enriched.
additionalProperties: true
# ── Metrics ──────────────────────────────────────────────────────────────────
PackagesMetrics:
type: object
required: [totalPackages, criticalPackages]
properties:
totalPackages:
type: integer
example: 0
criticalPackages:
type: integer
example: 0
# ──────────────────────────────────────────────────────────────────────────────
# Paths
# ──────────────────────────────────────────────────────────────────────────────
paths:
/packages:
get:
operationId: listPackages
summary: List packages
tags:
- Packages
security:
- M2MBearer:
- read:packages
- read:stewardships
parameters:
- name: page
in: query
schema:
type: integer
minimum: 1
default: 1
- name: pageSize
in: query
schema:
type: integer
minimum: 1
maximum: 100
default: 20
- name: ecosystem
in: query
schema:
type: string
- name: lifecycle
in: query
schema:
type: string
enum: [active, stable, declining, abandoned]
- name: busFactor1Only
in: query
schema:
type: boolean
default: false
description: Return only packages with bus factor = 1.
- name: staleOnly
in: query
schema:
type: boolean
default: false
description: Return only packages with no release in >= 18 months.
- name: unstewardedOnly
in: query
schema:
type: boolean
default: false
description: Return only packages with stewardship = unassigned.
- name: sortBy
in: query
schema:
type: string
enum: [name, health, impact, openVulns]
default: name
- name: sortDir
in: query
schema:
type: string
enum: [asc, desc]
default: asc
responses:
'200':
description: Paginated list of packages.
content:
application/json:
schema:
type: object
required: [page, pageSize, total, filters, sort, packages]
properties:
page:
type: integer
pageSize:
type: integer
total:
type: integer
filters:
type: object
properties:
ecosystem:
type:
- string
- 'null'
lifecycle:
type:
- string
- 'null'
busFactor1Only:
type: boolean
staleOnly:
type: boolean
unstewardedOnly:
type: boolean
sort:
type: object
properties:
by:
type: string
dir:
type: string
packages:
type: array
items:
$ref: '#/components/schemas/PackageListItem'
'400':
description: Validation error (e.g. invalid query parameters).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Missing or invalid bearer token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scopes.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/packages/metrics:
get:
operationId: getPackagesMetrics
summary: Overview metrics for the list page header
tags:
- Packages
security:
- M2MBearer:
- read:packages
- read:stewardships
responses:
'200':
description: Aggregate package metrics.
content:
application/json:
schema:
$ref: '#/components/schemas/PackagesMetrics'
'401':
description: Missing or invalid bearer token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scopes.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/packages/detail:
get:
operationId: getPackage
summary: Get full package detail
description: >
Returns data for the drawer's Overview, Security, and Provenance tabs.
Pass the canonical purl as a query parameter — no URL-encoding needed.
Example: `?purl=pkg:npm/lodash@4.17.21`.
tags:
- Packages
security:
- M2MBearer:
- read:packages
- read:stewardships
parameters:
- name: purl
in: query
required: true
schema:
type: string
example: 'pkg:npm/lodash@4.17.21'
responses:
'200':
description: Package found.
content:
application/json:
schema:
$ref: '#/components/schemas/PackageDetail'
example:
purl: pkg:npm/lodash
name: lodash
ecosystem: npm
general:
healthScore: 18
healthScoreDetails:
total: 18
label: critical
maintainerHealth: 4
securitySupplyChain: 8
developmentActivity: 6
healthBand: critical
impact:
impactScore: 71
downloadsLastMonth: 52142891
dependentPackages: 142312
dependentRepos: 39104
transitiveReach: 'Top 0.4%'
riskSignals:
lifecycle: declining
maintainerBusFactor: 1
lastRelease: '2021-02-20T00:00:00Z'
hasSecurityFile: null
openSSFScorecard: 5.2
assessment: {}
security:
securityContacts: null
advisories:
- osvId: CVE-2021-44906
severity: high
resolution: null
cvd:
isPvrEnabled: null
hasSecurityPolicyEnabled: null
tier0Steward: null
criticalVulnerabilityFlag: true
provenance:
repositoryMapping:
declaredRepo: https://github.com/lodash/lodash
mappingConfidence: 0.98
lastCommitAt: '2024-09-14T00:00:00Z'
supplyChainIntegrity:
buildProvenance: null
signedReleases: null
stewardship:
status: unassigned
stewards: null
lastActivityAt: null
history: {}
'404':
description: Package not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Missing or invalid bearer token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scopes.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/packages:batch-stewardship:
post:
operationId: batchGetStewardship
summary: Batch stewardship state for a list of purls
description: >
Returns lean stewardship state for up to 100 purls in one request.
Purls not found in CDP return `null`.
tags:
- Stewardship
security:
- M2MBearer:
- read:stewardships
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [purls]
properties:
purls:
type: array
items:
type: string
minItems: 1
maxItems: 100
example:
- pkg:npm/lodash
- pkg:npm/express
- pkg:pypi/requests
responses:
'200':
description: >
Stewardship state keyed by purl.
Unknown or invalid purls return `null`.
content:
application/json:
schema:
type: object
required: [packages]
properties:
packages:
type: object
additionalProperties:
oneOf:
- $ref: '#/components/schemas/StewardshipSummary'
- type: 'null'
example:
packages:
pkg:npm/lodash@4.17.21:
name: lodash
ecosystem: npm
lifecycle: declining
health:
score: 18
label: critical
impact: 71
openVulns:
low: 0
medium: 0
high: 1
critical: 0
stewardship: unassigned
stewards: null
lastActivityAt: null
lastActivityDescription: null
pkg:pypi/requests: null
'400':
description: Validation error (e.g. more than 100 purls).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Missing or invalid bearer token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scopes.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'