-
Notifications
You must be signed in to change notification settings - Fork 731
Expand file tree
/
Copy pathopenapi.yaml
More file actions
1326 lines (1279 loc) · 42.5 KB
/
Copy pathopenapi.yaml
File metadata and controls
1326 lines (1279 loc) · 42.5 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
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: CDP → Akrites External API
version: 0.1.0
description: >
Read-only external API exposing CDP package security data to the Akrites
service. Authenticated via Auth0 M2M client-credentials — CDP only
verifies the resulting access token; the assertion exchange happens
entirely between Akrites and Auth0.
Packages, Advisories and Contacts endpoints are implemented. Blast Radius
submit (2a) and poll (2b) are both implemented, backed by a 4-stage
Temporal pipeline (intel, dependents, reachability, report) for npm
packages; other ecosystems fail fast with ECOSYSTEM_NOT_SUPPORTED. The
7-day result cache is specced separately and not yet built.
TODO: scopes below (read:packages, read:stewardships) are the existing
internal CDP UI scopes, reused here for now. Swap for a dedicated
cdp:packages:read scope once Akrites gets its own Auth0 M2M scopes per
the akrites-external draft contract.
servers:
- url: https://cm.lfx.dev/api/v1
description: Production
security:
- M2MBearer:
- read:packages
- read:stewardships
tags:
- name: Packages
description: Package detail — requires read:packages and read:stewardships (see TODO above).
- name: Advisories
description: >
Security advisories for a package, split out of package detail. The draft
contract gates these behind a dedicated read:advisories scope; until Auth0
issues it, the implementation reuses read:packages (advisories need no
stewardship read). Confirm the final scope name (read:advisories vs
cdp:advisories:read) with Akrites/product.
- name: Contacts
description: >
Security contacts for a package — includes contact PII (e.g. reporter
emails). The contract gates these behind a dedicated cdp:maintainers:read
scope and forbids reaching them via the packages scope; until Auth0 issues
it, the implementation requires read:maintainer-roles (NOT read:packages).
The response shape is still under discussion upstream (reportingMethods /
reportingGuidelines / integrationHints are reserved and always null today).
- name: Blast Radius
description: >
Advisory reachability analysis — submit (2a) and poll (2b) are both
implemented. Submitting kicks off a Temporal workflow that runs the
npm reachability pipeline (other ecosystems fail fast with
ECOSYSTEM_NOT_SUPPORTED); poll returns job status and, once done,
results. Rate-limited independently of the other akrites-external
endpoints (default 5 requests/hour, configurable via
AKRITES_BLAST_RADIUS_RATE_LIMIT_MAX / _WINDOW_MS). Same interim scope
note as Advisories applies (read:packages, pending a dedicated
read:advisories scope).
components:
securitySchemes:
# Modeled as oauth2/clientCredentials (not http/bearer): OpenAPI only allows
# non-empty scope arrays in security requirements for oauth2 / openIdConnect
# schemes, and the operations below require read:packages + read:stewardships.
M2MBearer:
type: oauth2
description: >
Auth0 machine-to-machine client-credentials flow. Akrites exchanges its
client ID/secret with Auth0 for a JWT and sends it as
`Authorization: Bearer <token>`; CDP only verifies the resulting token.
flows:
clientCredentials:
tokenUrl: https://linuxfoundation.auth0.com/oauth/token
scopes:
read:packages: Read package detail
read:stewardships: Read package stewardship data
read:maintainer-roles: Read security contacts (interim scope for Contacts; see the Contacts tag)
schemas:
Error:
type: object
required: [error]
properties:
error:
type: object
required: [code, message]
properties:
code:
type: string
example: BAD_REQUEST
message:
type: string
Ecosystem:
type: string
example: npm
HealthBand:
type: string
enum: [excellent, healthy, fair, concerning, critical]
description: >
Health band on the internal scale (best→worst), returned verbatim —
no external crosswalk.
PackageDetail:
type: object
required:
- purl
- name
- ecosystem
- latestVersion
- versionCount
- health
- impact
- riskSignals
- security
- provenance
- supplyChainIntegrity
properties:
purl:
type: string
name:
type: string
ecosystem:
$ref: '#/components/schemas/Ecosystem'
latestVersion:
type: string
nullable: true
versionCount:
type: integer
nullable: true
health:
type: object
required: [score, band, subScores, signalCoverageHealth]
properties:
score:
type: integer
nullable: true
minimum: 0
maximum: 100
band:
$ref: '#/components/schemas/HealthBand'
subScores:
type: object
required: [maintainerHealth, securitySupplyChain, developmentActivity]
properties:
maintainerHealth:
type: number
nullable: true
securitySupplyChain:
type: number
nullable: true
developmentActivity:
type: number
nullable: true
signalCoverageHealth:
type: object
nullable: true
additionalProperties: true
impact:
type: object
required:
[
score,
downloadsLast30Days,
dependentPackagesCount,
dependentReposCount,
transitiveReach,
]
properties:
score:
type: integer
nullable: true
minimum: 0
maximum: 100
downloadsLast30Days:
type: string
nullable: true
description: Raw registry count string, not normalized.
dependentPackagesCount:
type: integer
nullable: true
dependentReposCount:
type: integer
nullable: true
transitiveReach:
type: integer
nullable: true
description: Always null for now — reserved for future computation.
riskSignals:
type: object
required:
- lifecycle
- maintainerBusFactor
- lastReleaseAt
- hasSecurityFile
- hasSecurityPolicy
- branchProtectionEnabled
- openssfScorecardScore
properties:
lifecycle:
type: string
enum: [active, stable, declining, abandoned, archived, null]
nullable: true
description: >
Lifecycle stage on the internal scale, returned verbatim — no
external crosswalk. Null when unknown or unrecognized.
maintainerBusFactor:
type: integer
nullable: true
lastReleaseAt:
type: string
format: date-time
nullable: true
hasSecurityFile:
type: boolean
nullable: true
hasSecurityPolicy:
type: boolean
nullable: true
branchProtectionEnabled:
type: boolean
nullable: true
openssfScorecardScore:
type: number
format: float
minimum: 0
maximum: 10
nullable: true
security:
type: object
required:
[
securityPolicyUrl,
vulnerabilityReportingUrl,
bugBountyUrl,
pvrEnabled,
criticalVulnerabilityFlag,
]
properties:
securityPolicyUrl:
type: string
nullable: true
vulnerabilityReportingUrl:
type: string
nullable: true
bugBountyUrl:
type: string
nullable: true
pvrEnabled:
type: boolean
nullable: true
criticalVulnerabilityFlag:
type: boolean
nullable: true
provenance:
type: object
required:
[
resolvedRepositoryUrl,
declaredRepositoryUrl,
mappingConfidenceScore,
mappingConfidenceLabel,
lastCommitAt,
]
properties:
resolvedRepositoryUrl:
type: string
nullable: true
description: >
Best available repository URL. Preferred source is the
confidence-ranked package_repos → repos join — the repo CDP has
actually resolved and enriched (scorecard, branch protection,
etc.). When the package has no package_repos link yet, this
falls back to the canonical repository_url on the package row,
which is NOT confidence-resolved or enriched. Use
mappingConfidenceScore / mappingConfidenceLabel to tell the two
apart: both are null when the fallback URL is returned.
declaredRepositoryUrl:
type: string
nullable: true
description: Raw repository URL as declared in the package's own metadata.
mappingConfidenceScore:
type: number
format: float
minimum: 0
maximum: 1
nullable: true
mappingConfidenceLabel:
type: string
enum: [High, Medium, Low, null]
nullable: true
lastCommitAt:
type: string
format: date-time
nullable: true
supplyChainIntegrity:
type: object
required: [buildProvenance, signedReleases]
properties:
buildProvenance:
type: string
nullable: true
description: Always null for now — reserved.
signedReleases:
type: string
nullable: true
description: Always null for now — reserved.
PackageDetailBulkEntry:
type: object
required: [requestedPurl, found, package]
properties:
requestedPurl:
type: string
found:
type: boolean
package:
type: object
nullable: true
allOf:
- $ref: '#/components/schemas/PackageDetail'
Advisory:
type: object
required: [osvId, severity, resolution, isCritical]
properties:
osvId:
type: string
example: GHSA-xxxx-xxxx-xxxx
severity:
type: string
enum: [critical, high, moderate, low, null]
nullable: true
description: >
Lowercased advisory severity. Any stored value outside this enum is
returned as null rather than echoed verbatim.
resolution:
type: string
enum: [open, patched, null]
nullable: true
description: >
Whether the package's latest version is still affected. Null when it
can't be determined (no latest version, or no affected ranges recorded).
isCritical:
type: boolean
nullable: true
description: cvss >= 7.0. Null when the advisory has no CVSS score.
AdvisoryDetail:
type: object
required: [purl, advisories]
properties:
purl:
type: string
advisories:
type: array
items:
$ref: '#/components/schemas/Advisory'
AdvisoryDetailBulkEntry:
type: object
required: [requestedPurl, found, advisories]
properties:
requestedPurl:
type: string
found:
type: boolean
advisories:
type: object
nullable: true
allOf:
- $ref: '#/components/schemas/AdvisoryDetail'
BlastRadiusJobRequest:
type: object
required: [advisoryId, ecosystem]
properties:
advisoryId:
type: string
pattern: '^(GHSA-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}|CVE-\d{4}-\d{4,})$'
description: >
GHSA or CVE identifier. Any other format, including free-text
strings, is rejected with a 400.
example: GHSA-jf85-cpcp-j695
ecosystem:
type: string
enum: [npm]
description: >
Required. The reachability pipeline is npm-only today — any other
value, or a missing ecosystem, is rejected with a 400.
example: npm
package:
type: string
nullable: true
description: >
Optional. Full purl or bare package name. If omitted, the analysis
is advisory-wide: reachability is evaluated across every package
the advisory affects, returned as one aggregate result — not one
job per affected package.
force:
type: boolean
default: false
description: Bypasses the 7-day cache and always triggers a new run. Use sparingly.
BlastRadiusJobEntry:
type: object
required: [analysisId, advisoryId, package, ecosystem, status]
description: Response body of 2a — one job per request, never wrapped in an array.
properties:
analysisId:
type: string
description: Opaque identifier for polling via 2b (GET .../jobs/{analysisId}).
advisoryId:
type: string
package:
type: string
nullable: true
description: Echoes the request's package. Null when the request omitted it.
ecosystem:
type: string
enum: [npm]
description: Echoes the request's ecosystem. Always present — the request requires it.
status:
type: string
enum: [pending, running, done, failed]
description: Always pending — the response is returned before the Temporal workflow runs.
BlastRadiusResultConfidence:
type: string
enum: [high, medium, low]
description: Crosswalk of the 0-1 reachability confidence score into bands (>=0.8 high, >=0.4 medium, else low).
BlastRadiusResultItem:
type: object
required: [dependent, affected, verdict, confidence, evidence, downloadsLast30Days]
properties:
dependent:
type: string
description: Purl of the analyzed dependent package.
affected:
type: boolean
description: True only when verdict is 'affected'. Kept for backwards compatibility — prefer verdict, since this field can't distinguish 'not_affected' from 'unclear'.
verdict:
type: string
enum: [affected, not_affected, unclear]
description: Raw reachability verdict. 'unclear' covers both a genuine ambiguous read and a persistent agent failure.
confidence:
$ref: '#/components/schemas/BlastRadiusResultConfidence'
evidence:
type: string
nullable: true
description: Flattened file:line — snippet evidence lines from the reachability agent, one per line.
downloadsLast30Days:
type: string
nullable: true
BlastRadiusAnalysisSummary:
type: object
required:
- totalDependentsInRange
- dependentsExcludedUpfront
- dependentsAnalyzed
- dependentsAffected
- affectedPercentage
- affectedDependents
properties:
totalDependentsInRange:
type: integer
description: Sum of dependentsAnalyzed and dependentsExcludedUpfront; the count of dependents that fell within the vulnerable version range (before top-N cutoff was applied).
dependentsExcludedUpfront:
type: integer
description: totalDependentsInRange minus dependentsAnalyzed.
dependentsAnalyzed:
type: integer
description: Number of dependents that received a reachability verdict.
dependentsAffected:
type: integer
affectedPercentage:
type: number
nullable: true
description: Rounded to 1 decimal. Null when dependentsAnalyzed is 0, to avoid a misleading 0%.
affectedDependents:
type: array
items:
type: string
BlastRadiusAnalysis:
type: object
required:
- analysisId
- status
- advisoryId
- package
- ecosystem
- submittedAt
- completedAt
- errorMessage
- summary
- results
description: Response body of 2b — poll for job status and, once done, results.
properties:
analysisId:
type: string
status:
type: string
enum: [pending, running, done, failed]
advisoryId:
type: string
package:
type: string
nullable: true
ecosystem:
type: string
enum: [npm]
submittedAt:
type: string
nullable: true
format: date-time
completedAt:
type: string
nullable: true
format: date-time
errorMessage:
type: string
nullable: true
summary:
type: object
nullable: true
allOf:
- $ref: '#/components/schemas/BlastRadiusAnalysisSummary'
description: Null until status is 'done'.
results:
type: array
nullable: true
description: Null until status is 'done'.
items:
$ref: '#/components/schemas/BlastRadiusResultItem'
ContactConfidenceBand:
type: string
enum: [PRIMARY, SECONDARY, FALLBACK, NONE]
description: Per-contact confidence — mirrors the internal SecurityContact confidence enum.
OverallConfidenceBand:
type: string
enum: [PRIMARY, SECONDARY, FALLBACK, NONE]
description: >
Aggregate confidence, derived from the highest-scoring contact. Uses the
internal SecurityContact confidence scale, returned verbatim — same scale
as ContactConfidenceBand, no external crosswalk. NONE when there are no
contacts.
SecurityContact:
type: object
required: [channel, value, role, confidenceBand, confidenceScore]
properties:
channel:
type: string
enum: [email, github-pvr, github-handle, url, web-form]
description: Mirrors the internal SecurityContact.channel enum; passed through verbatim.
value:
type: string
example: security@example.org
role:
type: string
enum: [security-team, maintainer, admin, committer, org-owner]
description: Mirrors the internal SecurityContact.role enum; passed through verbatim.
confidenceBand:
$ref: '#/components/schemas/ContactConfidenceBand'
confidenceScore:
type: number
format: float
minimum: 0
maximum: 1
ReportingMethod:
type: object
nullable: true
description: Reserved shape — always null until SECURITY.md parsing ships.
required: [methodId, type, status, description, actionRequired]
properties:
methodId:
type: integer
type:
type: string
status:
type: string
enum: [preferred, fallback]
recipient:
type: string
nullable: true
description:
type: string
actionRequired:
type: string
ReportingGuidelines:
type: object
nullable: true
description: Reserved shape — always null until SECURITY.md parsing ships.
required: [generalPrinciples, qualityRequirements]
properties:
generalPrinciples:
type: array
items:
type: string
qualityRequirements:
type: object
required: [avoid, recommend]
properties:
avoid:
type: array
items:
type: string
recommend:
type: array
items:
type: object
required: [scenario, action]
properties:
scenario:
type: string
action:
type: string
IntegrationHints:
type: object
nullable: true
description: Reserved shape — always null until computed.
required: [primaryEndpoint, fallbackEndpoint, validationHints]
properties:
primaryEndpoint:
type: object
nullable: true
required: [type, target]
properties:
type:
type: string
target:
type: string
fallbackEndpoint:
type: object
nullable: true
required: [type, target]
properties:
type:
type: string
target:
type: string
validationHints:
type: object
nullable: true
required: [falsePositiveRules, requirePocForSeverity, debounce]
properties:
falsePositiveRules:
type: array
items:
type: string
requirePocForSeverity:
type: array
items:
type: string
debounce:
type: string
nullable: true
ContactDetail:
type: object
description: >
NOTE: shape not final — still under discussion upstream, in particular
how reportingMethods / reportingGuidelines / integrationHints will be
derived from SECURITY.md parsing. Those three, plus targetOrganizationName
and bugBountyProgramFlag, are always null today (not stored). Expect this
schema to change before the contract is frozen.
required:
- purl
- name
- ecosystem
- overallConfidenceBand
- contacts
- securityPolicyUrl
- vulnerabilityReportingUrl
- bugBountyUrl
- pvrEnabled
- declaredRepositoryUrl
- resolvedRepositoryUrl
- repoMappingConfidence
- targetOrganizationName
- bugBountyProgramFlag
- reportingMethods
- reportingGuidelines
- integrationHints
properties:
purl:
type: string
name:
type: string
ecosystem:
$ref: '#/components/schemas/Ecosystem'
overallConfidenceBand:
$ref: '#/components/schemas/OverallConfidenceBand'
contacts:
type: array
items:
$ref: '#/components/schemas/SecurityContact'
securityPolicyUrl:
type: string
nullable: true
vulnerabilityReportingUrl:
type: string
nullable: true
bugBountyUrl:
type: string
nullable: true
pvrEnabled:
type: boolean
nullable: true
declaredRepositoryUrl:
type: string
nullable: true
description: Raw repository URL as declared in the package's own metadata.
resolvedRepositoryUrl:
type: string
nullable: true
description: >
Best available repository URL, resolved via the confidence-ranked
package_repos → repos join — the repo CDP has actually resolved and
enriched (scorecard, branch protection, etc.). Null when the
package has no package_repos link yet.
repoMappingConfidence:
type: number
format: float
minimum: 0
maximum: 1
nullable: true
description: >
Confidence score of the package_repos mapping used to resolve
resolvedRepositoryUrl. Null when the package has no package_repos
link yet.
targetOrganizationName:
type: string
nullable: true
description: Reserved — not stored today, always null.
bugBountyProgramFlag:
type: boolean
nullable: true
description: Reserved — not stored today, always null.
reportingMethods:
type: array
nullable: true
items:
$ref: '#/components/schemas/ReportingMethod'
reportingGuidelines:
$ref: '#/components/schemas/ReportingGuidelines'
integrationHints:
$ref: '#/components/schemas/IntegrationHints'
ContactDetailBulkEntry:
type: object
required: [requestedPurl, found, contact]
properties:
requestedPurl:
type: string
found:
type: boolean
contact:
type: object
nullable: true
allOf:
- $ref: '#/components/schemas/ContactDetail'
paths:
/akrites-external/packages/detail:
get:
operationId: getPackageDetail
summary: Get package detail by PURL
tags: [Packages]
security:
- M2MBearer:
- read:packages
- read:stewardships
parameters:
- name: purl
in: query
required: true
schema:
type: string
example: pkg:npm/%40angular/core
responses:
'200':
description: Package detail.
content:
application/json:
schema:
$ref: '#/components/schemas/PackageDetail'
'400':
description: Malformed purl.
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: Token missing read:packages or read:stewardships scope.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Package not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/akrites-external/packages/detail:batch:
post:
operationId: getPackageDetailBatch
summary: Bulk package detail lookup
tags: [Packages]
security:
- M2MBearer:
- read:packages
- read:stewardships
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [purls]
properties:
purls:
type: array
minItems: 1
maxItems: 100
items:
type: string
page:
type: integer
minimum: 1
default: 1
pageSize:
type: integer
minimum: 1
maximum: 100
default: 20
responses:
'200':
description: One page of results, in request order.
content:
application/json:
schema:
type: object
required: [page, pageSize, total, results]
properties:
page:
type: integer
pageSize:
type: integer
total:
type: integer
description: Total number of requested purls, across all pages.
results:
type: array
items:
$ref: '#/components/schemas/PackageDetailBulkEntry'
'400':
description: Validation error (empty array, >100 items, malformed purl).
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: Token missing read:packages or read:stewardships scope.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/akrites-external/advisories/detail:
get:
operationId: getAdvisoryDetail
summary: Get advisories for a package by PURL
tags: [Advisories]
security:
- M2MBearer:
- read:packages
parameters:
- name: purl
in: query
required: true
schema:
type: string
example: pkg:npm/%40angular/core
responses:
'200':
description: Advisories for the package (empty array when the package has none).
content:
application/json:
schema:
$ref: '#/components/schemas/AdvisoryDetail'
'400':
description: Malformed purl.
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: Token missing read:packages scope.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Package not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/akrites-external/advisories/detail:batch:
post:
operationId: getAdvisoryDetailBatch
summary: Bulk advisory lookup
tags: [Advisories]
security:
- M2MBearer:
- read:packages
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [purls]
properties:
purls:
type: array
minItems: 1
maxItems: 100
items:
type: string
page:
type: integer
minimum: 1
default: 1
pageSize:
type: integer
minimum: 1
maximum: 100
default: 20
responses:
'200':
description: One page of results, in request order.
content:
application/json:
schema:
type: object
required: [page, pageSize, total, results]
properties:
page:
type: integer
pageSize:
type: integer
total:
type: integer
description: Total number of requested purls, across all pages.
results:
type: array
items:
$ref: '#/components/schemas/AdvisoryDetailBulkEntry'
'400':
description: Validation error (empty array, >100 items, malformed purl).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':