-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
1910 lines (1547 loc) · 61.4 KB
/
types.go
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
// Package main provides primitives to interact with the openapi HTTP API.
package phylum
import (
"encoding/json"
"fmt"
"time"
openapi_types "github.com/deepmap/oapi-codegen/pkg/types"
)
const (
Phylum_CLI_TokenScopes = "Phylum_CLI_Token.Scopes"
)
// Defines values for Action.
const (
ActionBreak Action = "break"
ActionNone Action = "none"
ActionWarn Action = "warn"
)
// Defines values for IgnoredReason.
const (
False IgnoredReason = "false"
FalsePositive IgnoredReason = "falsePositive"
NotRelevant IgnoredReason = "notRelevant"
Other IgnoredReason = "other"
)
// Defines values for IngestionSource.
const (
CLI IngestionSource = "CLI"
GitHubIntegration IngestionSource = "GitHub Integration"
GitLabIntegration IngestionSource = "GitLab Integration"
)
// Defines values for PackageType.
const (
Maven PackageType = "maven"
Npm PackageType = "npm"
Nuget PackageType = "nuget"
Pypi PackageType = "pypi"
Rubygems PackageType = "rubygems"
)
// Defines values for PaginateDirection.
const (
Backward PaginateDirection = "Backward"
Forward PaginateDirection = "Forward"
)
// Defines values for ProjectField.
const (
CreatedAt ProjectField = "CreatedAt"
Ecosystem ProjectField = "Ecosystem"
Group ProjectField = "Group"
Name ProjectField = "Name"
UpdatedAt ProjectField = "UpdatedAt"
)
// Defines values for RiskDomain.
const (
RiskDomainAuthor RiskDomain = "author"
RiskDomainEngineering RiskDomain = "engineering"
RiskDomainLicense RiskDomain = "license"
RiskDomainMaliciousCode RiskDomain = "malicious_code"
RiskDomainVulnerability RiskDomain = "vulnerability"
)
// Defines values for RiskLevel.
const (
Critical RiskLevel = "critical"
High RiskLevel = "high"
Info RiskLevel = "info"
Low RiskLevel = "low"
Medium RiskLevel = "medium"
)
// Defines values for RiskType.
const (
AuthorsRisk RiskType = "authorsRisk"
EngineeringRisk RiskType = "engineeringRisk"
LicenseRisk RiskType = "licenseRisk"
MaliciousCodeRisk RiskType = "maliciousCodeRisk"
TotalRisk RiskType = "totalRisk"
Vulnerabilities RiskType = "vulnerabilities"
)
// Defines values for SortDirection.
const (
Ascending SortDirection = "Ascending"
Descending SortDirection = "Descending"
)
// Defines values for Status.
const (
Complete Status = "complete"
Incomplete Status = "incomplete"
)
// Defines values for ThresholdViolationAction.
const (
ThresholdViolationActionBreak ThresholdViolationAction = "break"
ThresholdViolationActionNone ThresholdViolationAction = "none"
ThresholdViolationActionWarn ThresholdViolationAction = "warn"
)
// Defines values for ValidatedGroupNameError.
const (
Invalid ValidatedGroupNameError = "Invalid"
)
// When a job is completed, and some requirement is not met ( such as quality level ), what action should be taken? In the case of the CLI, the value of this result is used to determine if the CLI should print a warning, or exit with a non-zero exit code.
type Action string
// Represents a response that summarizes the output of all current jobs
type AllJobsStatusResponse struct {
Count uint32 `json:"count"`
// A description of the latest jobs
Jobs []JobDescriptor `json:"jobs"`
// Total jobs run
TotalJobs uint32 `json:"total_jobs"`
}
// Author information
type Author struct {
AvatarUrl string `json:"avatarUrl"`
Email string `json:"email"`
Name string `json:"name"`
ProfileUrl string `json:"profileUrl"`
}
// CreateGroupResponse defines model for CreateGroupResponse.
type CreateGroupResponse struct {
GroupName string `json:"group_name"`
OwnerEmail string `json:"owner_email"`
}
// Rquest to create a project
type CreateProjectRequest struct {
GroupName *string `json:"group_name"`
Name string `json:"name"`
}
// DependenciesCounts defines model for DependenciesCounts.
type DependenciesCounts struct {
AboveThreshold uint32 `json:"aboveThreshold"`
BelowThreshold uint32 `json:"belowThreshold"`
NumIncomplete uint32 `json:"numIncomplete"`
Total uint32 `json:"total"`
}
// DependenciesStatsBlock defines model for DependenciesStatsBlock.
type DependenciesStatsBlock struct {
Counts DependenciesCounts `json:"counts"`
}
// Responsiveness of developers
type DeveloperResponsiveness struct {
OpenIssueAvgDuration *uint32 `json:"open_issue_avg_duration"`
OpenIssueCount *uint `json:"open_issue_count"`
OpenPullRequestAvgDuration *uint32 `json:"open_pull_request_avg_duration"`
OpenPullRequestCount *uint `json:"open_pull_request_count"`
TotalIssueCount *uint `json:"total_issue_count"`
TotalPullRequestCount *uint `json:"total_pull_request_count"`
}
// Information about a downloadable file.
type DownloadInfo struct {
// The canonical name of the file.
Filename string `json:"filename"`
// The URL at which the file is available.
Url string `json:"url"`
}
// The kind of error encountered
type ErrorKind interface{}
// Extended information about a package.
//
// This contains additional information and can only be requested for one package at a time.
type ExtendedPackage struct {
// An empty list.
//
// This is maintained for compatibility. Author data is retrieved via a separate API call.
Authors []interface{} `json:"authors"`
// True if the package has been processed.
Complete bool `json:"complete"`
// The declared dependencies of the package.
DepSpecs []PackageSpecifier `json:"depSpecs"`
// Details about the declared dependencies of the package.
Dependencies []FullPackage `json:"dependencies"`
// The description of the package, as provided by the package author.
Description *string `json:"description"`
// Metrics about developer reponsiveness to issues and pull requests.
DeveloperResponsiveness *struct {
OpenIssueAvgDuration *uint32 `json:"open_issue_avg_duration"`
OpenIssueCount *uint `json:"open_issue_count"`
OpenPullRequestAvgDuration *uint32 `json:"open_pull_request_avg_duration"`
OpenPullRequestCount *uint `json:"open_pull_request_count"`
TotalIssueCount *uint `json:"total_issue_count"`
TotalPullRequestCount *uint `json:"total_pull_request_count"`
} `json:"developerResponsiveness"`
// The number of times the package has been downloaded from its package registry.
DownloadCount uint32 `json:"downloadCount"`
// The Phylum-specific ID of the package version.
Id string `json:"id"`
// Whether our heuristics consider this package to be considered abandonware.
IsAbandonware *bool `json:"is_abandonware"`
// Statistics about how many issues exist at each impact level.
IssueImpacts struct {
Critical *uint32 `json:"critical,omitempty"`
High *uint32 `json:"high,omitempty"`
Low *uint32 `json:"low,omitempty"`
Medium *uint32 `json:"medium,omitempty"`
} `json:"issueImpacts"`
// The list of known issues for this package.
Issues []IssuesListItem `json:"issues"`
// The list of known issues for this package.
IssuesDetails []Issue `json:"issuesDetails"`
// The latest version of the package, as reported by the package registry.
LatestVersion *string `json:"latestVersion"`
// The license of the package.
License *string `json:"license"`
// Whether our heuristics consider this package to have recently changed maintainers.
MaintainersRecentlyChanged *bool `json:"maintainers_recently_changed"`
// The name of the package.
Name string `json:"name"`
// The date this version of the package was published.
PublishedDate string `json:"publishedDate"`
// The registry where the package is located.
Registry string `json:"registry"`
// Information about this package's different releases.
ReleaseData *struct {
FirstReleaseDate time.Time `json:"first_release_date"`
LastReleaseDate time.Time `json:"last_release_date"`
} `json:"releaseData"`
// The URL for the source code repository.
RepoUrl *string `json:"repoUrl"`
// The risk scores for this version of the package.
RiskScores struct {
Author float32 `json:"author"`
Engineering float32 `json:"engineering"`
License float32 `json:"license"`
MaliciousCode float32 `json:"malicious_code"`
Total float32 `json:"total"`
Vulnerability float32 `json:"vulnerability"`
} `json:"riskScores"`
// The version of the package.
Version string `json:"version"`
// The known versions of this package.
Versions []ScoredVersion `json:"versions"`
}
// Information about a package.
//
// This is available only to authenticated users.
type FullPackage struct {
// An empty list.
//
// This is maintained for compatibility. Author data is retrieved via a separate API call.
Authors []interface{} `json:"authors"`
// True if the package has been processed.
Complete bool `json:"complete"`
// The declared dependencies of the package.
DepSpecs []PackageSpecifier `json:"depSpecs"`
// The description of the package, as provided by the package author.
Description *string `json:"description"`
// Zero.
//
// This is left here for compatibility.
DownloadCount uint32 `json:"downloadCount"`
// The Phylum-specific ID of the package version.
Id string `json:"id"`
// Statistics about how many issues exist at each impact level.
IssueImpacts struct {
Critical *uint32 `json:"critical,omitempty"`
High *uint32 `json:"high,omitempty"`
Low *uint32 `json:"low,omitempty"`
Medium *uint32 `json:"medium,omitempty"`
} `json:"issueImpacts"`
// The list of known issues for this package.
Issues []IssuesListItem `json:"issues"`
// The list of known issues for this package.
IssuesDetails []Issue `json:"issuesDetails"`
// The license of the package.
License *string `json:"license"`
// The name of the package.
Name string `json:"name"`
// The date this version of the package was published.
PublishedDate string `json:"publishedDate"`
// The registry where the package is located.
Registry string `json:"registry"`
// The URL for the source code repository.
RepoUrl *string `json:"repoUrl"`
// The risk scores for this version of the package.
RiskScores struct {
Author float32 `json:"author"`
Engineering float32 `json:"engineering"`
License float32 `json:"license"`
MaliciousCode float32 `json:"malicious_code"`
Total float32 `json:"total"`
Vulnerability float32 `json:"vulnerability"`
} `json:"riskScores"`
// The version of the package.
Version string `json:"version"`
// An empty list.
//
// This is maintained for compatibility. Version data is only available on ExtendedPackage.
Versions []interface{} `json:"versions"`
}
// Information about a package.
//
// This is available only to authenticated users.
//
// This internal version is used inside the server. Use `FullPackage::from` to convert it into a `Package` compatible format for sending over the network.
//
// ```mermaid classDiagram FullPackageInternal <|-- FullPackage FullPackageInternal <|-- ExtendedPackageInternal link FullPackage "struct.FullPackage.html" link ExtendedPackageInternal "struct.ExtendedPackageInternal.html" ```
type FullPackageInternal struct {
// True if the package has been processed.
Complete bool `json:"complete"`
// The declared dependencies of the package.
DepSpecs []PackageSpecifier `json:"depSpecs"`
// The description of the package, as provided by the package author.
Description *string `json:"description"`
// The Phylum-specific ID of the package version.
Id string `json:"id"`
// Statistics about how many issues exist at each impact level.
IssueImpacts struct {
Critical *uint32 `json:"critical,omitempty"`
High *uint32 `json:"high,omitempty"`
Low *uint32 `json:"low,omitempty"`
Medium *uint32 `json:"medium,omitempty"`
} `json:"issueImpacts"`
// The list of known issues for this package.
Issues []IssuesListItem `json:"issues"`
// The list of known issues for this package.
IssuesDetails []Issue `json:"issuesDetails"`
// The license of the package.
License *string `json:"license"`
// The name of the package.
Name string `json:"name"`
// The date this version of the package was published.
PublishedDate string `json:"publishedDate"`
// The registry where the package is located.
Registry string `json:"registry"`
// The URL for the source code repository.
RepoUrl *string `json:"repoUrl"`
// The risk scores for this version of the package.
RiskScores struct {
Author float32 `json:"author"`
Engineering float32 `json:"engineering"`
License float32 `json:"license"`
MaliciousCode float32 `json:"malicious_code"`
Total float32 `json:"total"`
Vulnerability float32 `json:"vulnerability"`
} `json:"riskScores"`
// The version of the package.
Version string `json:"version"`
}
// GroupMember defines model for GroupMember.
type GroupMember struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
UserEmail string `json:"user_email"`
}
// GroupPreferences defines model for GroupPreferences.
type GroupPreferences struct {
// The default label to use when none is supplied (can be overridden per project).
DefaultLabel *string `json:"defaultLabel"`
// Group specific ignored issues (in addition to any project specific ignored issues).
IgnoredIssues *[]IgnoredIssue `json:"ignoredIssues"`
AdditionalProperties map[string]interface{} `json:"-"`
}
// The preferences for a given group which may contain several projects.
type GroupPreferencesResponse struct {
// The id of the group these preferences apply to.
GroupId openapi_types.UUID `json:"groupId"`
// The preference settings
Preferences struct {
// The default label to use when none is supplied (can be overridden per project).
DefaultLabel *string `json:"defaultLabel"`
// Group specific ignored issues (in addition to any project specific ignored issues).
IgnoredIssues *[]IgnoredIssue `json:"ignoredIssues"`
} `json:"preferences"`
}
// Health defines model for Health.
type Health struct {
Response string `json:"response"`
}
// Issues ignored from package score
type IgnoredIssue struct {
Id string `json:"id"`
Reason IgnoredReason `json:"reason"`
Tag string `json:"tag"`
}
// IgnoredReason defines model for IgnoredReason.
type IgnoredReason string
// How / where was the package ingested?
type IngestionSource string
// A single package issue.
type Issue struct {
Description string `json:"description"`
// Risk domains.
Domain RiskDomain `json:"domain"`
Id *string `json:"id"`
// Issue severity.
Severity RiskLevel `json:"severity"`
Tag *string `json:"tag"`
Title string `json:"title"`
}
// Count of issues for each severity.
type IssueImpacts struct {
Critical *uint32 `json:"critical,omitempty"`
High *uint32 `json:"high,omitempty"`
Low *uint32 `json:"low,omitempty"`
Medium *uint32 `json:"medium,omitempty"`
}
// IssueStatusCounts defines model for IssueStatusCounts.
type IssueStatusCounts struct {
Accept uint32 `json:"accept"`
NotRelevant uint32 `json:"notRelevant"`
Untagged uint32 `json:"untagged"`
WillFix uint32 `json:"willFix"`
}
// IssueStatusesStatsBlock defines model for IssueStatusesStatsBlock.
type IssueStatusesStatsBlock struct {
Counts IssueStatusCounts `json:"counts"`
}
// Issue description.
type IssuesListItem struct {
Description string `json:"description"`
Id *string `json:"id"`
Ignored IgnoredReason `json:"ignored"`
// Issue severity.
Impact RiskLevel `json:"impact"`
RiskType RiskType `json:"riskType"`
Score float32 `json:"score"`
Tag *string `json:"tag"`
Title string `json:"title"`
}
// Metadata about a job
type JobDescriptor struct {
Date string `json:"date"`
Ecosystem string `json:"ecosystem"`
JobId openapi_types.UUID `json:"job_id"`
Label string `json:"label"`
Msg string `json:"msg"`
NumDependencies uint32 `json:"num_dependencies"`
NumIncomplete *uint32 `json:"num_incomplete,omitempty"`
Packages []PackageDescriptor `json:"packages"`
Pass bool `json:"pass"`
Project string `json:"project"`
Score float64 `json:"score"`
}
// JobScore defines model for JobScore.
type JobScore struct {
// Whether or not all of the underlying job's packages have completed processing. Note that there is a stop-gap where packages with nonstandard versions are allowed to be missing from Redis and still be considered complete.
Complete bool `json:"complete"`
Value float32 `json:"value"`
}
// JobStatusResponseVariant defines model for JobStatusResponseVariant.
type JobStatusResponseVariant interface{}
// Data returned when querying the job status endpoint
type JobStatusResponseForPackageStatus struct {
// The action to take if the job fails
Action interface{} `json:"action"`
// The time the job started in epoch seconds
CreatedAt int64 `json:"created_at"`
// The language ecosystem TODO: How is this different than package type ( npm, etc ) or language?
Ecosystem string `json:"ecosystem"`
// The id of the job processing the top level package
JobId openapi_types.UUID `json:"job_id"`
// A label associated with this job, most often a branch name
Label *string `json:"label"`
// The last time the job metadata was updated
LastUpdated uint64 `json:"last_updated"`
Msg string `json:"msg"`
// Dependencies that have not completed processing
NumIncomplete *uint32 `json:"num_incomplete,omitempty"`
// The packages that are a part of this job
Packages []PackageStatus `json:"packages"`
Pass bool `json:"pass"`
// The id of the project associated with this job
Project string `json:"project"`
// The project name
ProjectName string `json:"project_name"`
// The current score
Score float64 `json:"score"`
// The job status
Status interface{} `json:"status"`
// The currently configured threshholds for this job. If the scores fall below these thresholds, then the client should undertake the action spelled out by the action field.
Thresholds struct {
Author float32 `json:"author"`
Engineering float32 `json:"engineering"`
License float32 `json:"license"`
Malicious float32 `json:"malicious"`
Total float32 `json:"total"`
Vulnerability float32 `json:"vulnerability"`
} `json:"thresholds"`
// The user email
UserEmail string `json:"user_email"`
// The id of the user submitting the job
UserId openapi_types.UUID `json:"user_id"`
}
// Data returned when querying the job status endpoint
type JobStatusResponseForPackageStatusExtended struct {
// The action to take if the job fails
Action interface{} `json:"action"`
// The time the job started in epoch seconds
CreatedAt int64 `json:"created_at"`
// The language ecosystem TODO: How is this different than package type ( npm, etc ) or language?
Ecosystem string `json:"ecosystem"`
// The id of the job processing the top level package
JobId openapi_types.UUID `json:"job_id"`
// A label associated with this job, most often a branch name
Label *string `json:"label"`
// The last time the job metadata was updated
LastUpdated uint64 `json:"last_updated"`
Msg string `json:"msg"`
// Dependencies that have not completed processing
NumIncomplete *uint32 `json:"num_incomplete,omitempty"`
// The packages that are a part of this job
Packages []PackageStatusExtended `json:"packages"`
Pass bool `json:"pass"`
// The id of the project associated with this job
Project string `json:"project"`
// The project name
ProjectName string `json:"project_name"`
// The current score
Score float64 `json:"score"`
// The job status
Status interface{} `json:"status"`
// The currently configured threshholds for this job. If the scores fall below these thresholds, then the client should undertake the action spelled out by the action field.
Thresholds struct {
Author float32 `json:"author"`
Engineering float32 `json:"engineering"`
License float32 `json:"license"`
Malicious float32 `json:"malicious"`
Total float32 `json:"total"`
Vulnerability float32 `json:"vulnerability"`
} `json:"thresholds"`
// The user email
UserEmail string `json:"user_email"`
// The id of the user submitting the job
UserId openapi_types.UUID `json:"user_id"`
}
// A document describing an error.
type JsonErrorResponse struct {
// Information about an error that occurred while servicing a request.
Error struct {
// The class of error.
ApiError interface{} `json:"apiError"`
// The HTTP error code.
Code uint16 `json:"code"`
// A general description of this class of error.
Description string `json:"description"`
// A unique ID for this error.
ErrorId string `json:"error_id"`
// A reason for the error.
Reason string `json:"reason"`
} `json:"error"`
}
// A description of an error that occurred while servicing a request.
type JsonErrorResponseBody struct {
// The class of error.
ApiError interface{} `json:"apiError"`
// The HTTP error code.
Code uint16 `json:"code"`
// A general description of this class of error.
Description string `json:"description"`
// A unique ID for this error.
ErrorId openapi_types.UUID `json:"error_id"`
// A reason for the error.
Reason string `json:"reason"`
}
// LicensesStatsBlock defines model for LicensesStatsBlock.
type LicensesStatsBlock struct {
Counts LicensesStatsBlock_Counts `json:"counts"`
}
// LicensesStatsBlock_Counts defines model for LicensesStatsBlock.Counts.
type LicensesStatsBlock_Counts struct {
AdditionalProperties map[string]uint32 `json:"-"`
}
// ListGroupMembersResponse defines model for ListGroupMembersResponse.
type ListGroupMembersResponse struct {
Members []GroupMember `json:"members"`
}
// ListUserGroupsResponse defines model for ListUserGroupsResponse.
type ListUserGroupsResponse struct {
Groups []UserGroup `json:"groups"`
}
// The maintainer information is (currently) sparser than the contributor data
type Maintainer struct {
Email string `json:"email"`
Username string `json:"username"`
}
// Metadata related to a particular pagination request. The values are ultimately influenced by the `FilterProjects` value (sorting / paging won't affect these values).
type Metadata struct {
// The distinct ecosystems across all projects satisfying the given query.
Ecosystems []PackageType `json:"ecosystems"`
// The groups that have existing projects satisfying the given query.
Groups Metadata_Groups `json:"groups"`
}
// The groups that have existing projects satisfying the given query.
type Metadata_Groups struct {
AdditionalProperties map[string]string `json:"-"`
}
// PackageAuthorsResponse defines model for PackageAuthorsResponse.
type PackageAuthorsResponse struct {
Contributors []Author `json:"contributors"`
Maintainers []Maintainer `json:"maintainers"`
}
// Describes a package in the system
type PackageDescriptor struct {
Name string `json:"name"`
// The package ecosystem
Type PackageType `json:"type"`
Version string `json:"version"`
}
// PackageReleaseData defines model for PackageReleaseData.
type PackageReleaseData struct {
FirstReleaseDate time.Time `json:"first_release_date"`
LastReleaseDate time.Time `json:"last_release_date"`
}
// PackageSearchListing defines model for PackageSearchListing.
type PackageSearchListing struct {
Description *string `json:"description"`
// Count of issues for each severity.
IssueImpacts IssueImpacts `json:"issueImpacts"`
Name string `json:"name"`
PublishedDate string `json:"publishedDate"`
Registry string `json:"registry"`
// Risk scores by domain.
RiskScores RiskScores `json:"riskScores"`
Version string `json:"version"`
}
// PackageSpecifier defines model for PackageSpecifier.
type PackageSpecifier struct {
Name string `json:"name"`
Registry string `json:"registry"`
Version string `json:"version"`
}
// Basic core package meta data
type PackageStatus struct {
// Last updates, as epoch seconds
LastUpdated uint64 `json:"last_updated"`
// Package license
License *string `json:"license"`
// Name of the package
Name string `json:"name"`
// Number of dependencies
NumDependencies uint32 `json:"num_dependencies"`
// Number of vulnerabilities found in this package and all transitive dependencies
NumVulnerabilities uint32 `json:"num_vulnerabilities"`
// The overall quality score of the package
PackageScore *float64 `json:"package_score"`
// Package processing status
Status interface{} `json:"status"`
// Package version
Version string `json:"version"`
}
// Package metadata with extended info info
type PackageStatusExtended struct {
// Dependencies of this package
Dependencies PackageStatusExtended_Dependencies `json:"dependencies"`
// Any issues found that may need action, but aren't in and of themselves vulnerabilities
Issues []Issue `json:"issues"`
// Last updates, as epoch seconds
LastUpdated uint64 `json:"last_updated"`
// Package license
License *string `json:"license"`
// Name of the package
Name string `json:"name"`
// Number of dependencies
NumDependencies uint32 `json:"num_dependencies"`
// Number of vulnerabilities found in this package and all transitive dependencies
NumVulnerabilities uint32 `json:"num_vulnerabilities"`
// The overall quality score of the package
PackageScore *float64 `json:"package_score"`
RiskVectors PackageStatusExtended_RiskVectors `json:"riskVectors"`
// Package processing status
Status interface{} `json:"status"`
// The package_type, npm, etc.
Type interface{} `json:"type"`
// Package version
Version string `json:"version"`
}
// Dependencies of this package
type PackageStatusExtended_Dependencies struct {
AdditionalProperties map[string]string `json:"-"`
}
// PackageStatusExtended_RiskVectors defines model for PackageStatusExtended.RiskVectors.
type PackageStatusExtended_RiskVectors struct {
AdditionalProperties map[string]float64 `json:"-"`
}
// The package ecosystem
type PackageType string
// Requests
type PaginateDirection string
// Responses
type PaginatedForProjectListEntryAndMetadata struct {
// Indication of whether the current query has more values past the last element in `values`.
HasMore bool `json:"has_more"`
// Optional metadata that can be sent about the result set, such as a total count estimate.
Metadata *struct {
// The distinct ecosystems across all projects satisfying the given query.
Ecosystems []PackageType `json:"ecosystems"`
// The groups that have existing projects satisfying the given query.
Groups PaginatedForProjectListEntryAndMetadata_Metadata_Groups `json:"groups"`
} `json:"metadata"`
// The curent page of values.
Values []ProjectListEntry `json:"values"`
}
// The groups that have existing projects satisfying the given query.
type PaginatedForProjectListEntryAndMetadata_Metadata_Groups struct {
AdditionalProperties map[string]string `json:"-"`
}
// The project fields on which users can sort.
type ProjectField string
// Project folder response format/data
type ProjectFolderResponse struct {
CreatedAt time.Time `json:"createdAt"`
Id openapi_types.UUID `json:"id"`
IsDefault bool `json:"isDefault"`
Name string `json:"name"`
Projects []ProjectListingResponse `json:"projects"`
UpdatedAt time.Time `json:"updatedAt"`
UserId openapi_types.UUID `json:"userId"`
}
// ProjectListEntry defines model for ProjectListEntry.
type ProjectListEntry struct {
// Project created time
CreatedAt time.Time `json:"created_at"`
// Project ecosystem (as of latest job run)
Ecosystem *interface{} `json:"ecosystem"`
// If this is a project belonging to the group, then the group name, otherwise None.
GroupName *string `json:"group_name"`
// Project id
Id openapi_types.UUID `json:"id"`
// Project name
Name string `json:"name"`
// The total risk score of the latest analysis job (if there is one).
TotalRiskScore *struct {
// Whether or not all of the underlying job's packages have completed processing. Note that there is a stop-gap where packages with nonstandard versions are allowed to be missing from Redis and still be considered complete.
Complete bool `json:"complete"`
Value float32 `json:"value"`
} `json:"total_risk_score"`
// Project updated time
UpdatedAt time.Time `json:"updated_at"`
}
// ProjectListingResponse defines model for ProjectListingResponse.
type ProjectListingResponse struct {
CreatedAt time.Time `json:"createdAt"`
GroupName *string `json:"groupName"`
Id openapi_types.UUID `json:"id"`
// How / where was the package ingested?
IngestionSource IngestionSource `json:"ingestionSource"`
// Count of issues for each severity.
IssueImpacts IssueImpacts `json:"issueImpacts"`
Issues []IssuesListItem `json:"issues"`
Label *string `json:"label"`
Name string `json:"name"`
Registry *string `json:"registry"`
Stats *struct {
Dependencies DependenciesStatsBlock `json:"dependencies"`
IssueStatuses IssueStatusesStatsBlock `json:"issueStatuses"`
Licenses LicensesStatsBlock `json:"licenses"`
} `json:"stats"`
TotalRiskScore float32 `json:"totalRiskScore"`
UpdatedAt *time.Time `json:"updatedAt"`
}
// ProjectPreferences defines model for ProjectPreferences.
type ProjectPreferences struct {
// The default label to use when none is supplied.
DefaultLabel *string `json:"defaultLabel"`
// Project specific ignored issues.
IgnoredIssues *[]IgnoredIssue `json:"ignoredIssues"`
// The risk thresholds to apply.
Thresholds struct {
// Capture the user threshold settings
Author ThresholdDescriptor `json:"author"`
// Capture the user threshold settings
Engineering ThresholdDescriptor `json:"engineering"`
// Capture the user threshold settings
License ThresholdDescriptor `json:"license"`
// Capture the user threshold settings
MaliciousCode ThresholdDescriptor `json:"maliciousCode"`
// Capture the user threshold settings
Total ThresholdDescriptor `json:"total"`
// Capture the user threshold settings
Vulnerability ThresholdDescriptor `json:"vulnerability"`
} `json:"thresholds"`
AdditionalProperties map[string]interface{} `json:"-"`
}
// The preferences for a given project.
type ProjectPreferencesResponse struct {
// The preference settings
Preferences struct {
// The default label to use when none is supplied.
DefaultLabel *string `json:"defaultLabel"`
// Project specific ignored issues.
IgnoredIssues *[]IgnoredIssue `json:"ignoredIssues"`
// The risk thresholds to apply.
Thresholds struct {
// Capture the user threshold settings
Author ThresholdDescriptor `json:"author"`
// Capture the user threshold settings
Engineering ThresholdDescriptor `json:"engineering"`
// Capture the user threshold settings
License ThresholdDescriptor `json:"license"`
// Capture the user threshold settings
MaliciousCode ThresholdDescriptor `json:"maliciousCode"`