You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

security-hotspots.ts 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2020 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. export enum RiskExposure {
  21. LOW = 'LOW',
  22. MEDIUM = 'MEDIUM',
  23. HIGH = 'HIGH'
  24. }
  25. export enum HotspotStatus {
  26. TO_REVIEW = 'TO_REVIEW',
  27. REVIEWED = 'REVIEWED'
  28. }
  29. export enum HotspotResolution {
  30. FIXED = 'FIXED',
  31. SAFE = 'SAFE'
  32. }
  33. export enum HotspotStatusFilter {
  34. FIXED = 'FIXED',
  35. SAFE = 'SAFE',
  36. TO_REVIEW = 'TO_REVIEW'
  37. }
  38. export enum HotspotStatusOption {
  39. FIXED = 'FIXED',
  40. SAFE = 'SAFE',
  41. TO_REVIEW = 'TO_REVIEW'
  42. }
  43. export interface HotspotFilters {
  44. assignedToMe: boolean;
  45. sinceLeakPeriod: boolean;
  46. status: HotspotStatusFilter;
  47. }
  48. export interface RawHotspot {
  49. assignee?: string;
  50. author?: string;
  51. component: string;
  52. creationDate: string;
  53. key: string;
  54. line?: number;
  55. message: string;
  56. project: string;
  57. resolution?: HotspotResolution;
  58. rule: string;
  59. securityCategory: string;
  60. status: HotspotStatus;
  61. subProject?: string;
  62. updateDate: string;
  63. vulnerabilityProbability: RiskExposure;
  64. }
  65. export interface Hotspot {
  66. assignee?: string;
  67. assigneeUser?: T.UserBase;
  68. author: string;
  69. authorUser: T.UserBase;
  70. canChangeStatus: boolean;
  71. changelog: T.IssueChangelog[];
  72. comment: HotspotComment[];
  73. component: T.Component;
  74. creationDate: string;
  75. key: string;
  76. line?: number;
  77. message: string;
  78. project: T.Component;
  79. resolution?: HotspotResolution;
  80. rule: HotspotRule;
  81. status: HotspotStatus;
  82. textRange?: T.TextRange;
  83. updateDate: string;
  84. users: T.UserBase[];
  85. }
  86. export interface HotspotUpdateFields {
  87. status: HotspotStatus;
  88. resolution?: HotspotResolution;
  89. }
  90. export interface HotspotUpdate extends HotspotUpdateFields {
  91. key: string;
  92. }
  93. export interface HotspotRule {
  94. fixRecommendations?: string;
  95. key: string;
  96. name: string;
  97. riskDescription?: string;
  98. securityCategory: string;
  99. vulnerabilityDescription?: string;
  100. vulnerabilityProbability: RiskExposure;
  101. }
  102. export interface HotspotComment {
  103. key: string;
  104. htmlText: string;
  105. markdown: string;
  106. updatable: boolean;
  107. createdAt: string;
  108. login: string;
  109. user: T.UserBase;
  110. }
  111. export interface ReviewHistoryElement {
  112. type: ReviewHistoryType;
  113. date: string;
  114. user: Pick<T.UserBase, 'active' | 'avatar' | 'name'>;
  115. diffs?: T.IssueChangelogDiff[];
  116. html?: string;
  117. key?: string;
  118. updatable?: boolean;
  119. markdown?: string;
  120. }
  121. export enum ReviewHistoryType {
  122. Creation,
  123. Diff,
  124. Comment
  125. }
  126. export interface HotspotSearchResponse {
  127. components?: { key: string; qualifier: string; name: string }[];
  128. hotspots: RawHotspot[];
  129. paging: T.Paging;
  130. }
  131. export interface HotspotSetStatusRequest {
  132. status: HotspotStatus;
  133. resolution?: HotspotResolution;
  134. comment?: string;
  135. }
  136. export interface HotspotAssignRequest {
  137. assignee: string;
  138. comment?: string;
  139. }