/
types.go
315 lines (279 loc) · 8.05 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
package CxSASTClientGo
import (
"net/http"
"time"
"github.com/sirupsen/logrus"
)
type SASTClient struct {
restClient *http.Client
soapClient *http.Client
baseUrl string
logger *logrus.Logger
CurrentUser *User
}
type ApplicationVersion struct {
ApplicationVersion string
EnginePack string
HotFix int
}
type AuthenticationProvider struct {
ID uint64
Name string
ProviderID uint64
ProviderType string
IsExternal bool
Active bool
}
const (
PreScanAction = "SOURCE_CONTROL_COMMAND"
PostScanAction = "POST_SCAN_COMMAND"
)
type CustomTask struct {
ID uint64
Name string
Type string
Data string
}
type EngineConfiguration struct {
ID uint64
Name string
}
type IssueTracker struct {
ID uint64
Name string
Type string
URL string
}
type Link struct {
Rel string `json:"rel"`
URI string `json:"uri"`
}
type Links struct {
Report Link `json:"report"`
Status Link `json:"status"`
}
type OIDCClaim struct {
Type string `json:"type"`
Value string `json:"value"`
}
type OIDCClient struct {
ID uint64 `json:"id"`
UpdateAccessTokenClaimsOnRefresh bool `json:"updateAccessTokenClaimsOnRefresh"`
AccessTokenType uint64 `json:"accessTokenType"`
IncludeJwtID bool `json:"includeJwtId"`
AlwaysIncludeUserClaimsInIDToken bool `json:"alwaysIncludeUserClaimsInIdToken"`
ClientID string `json:"clientId"`
ClientName string `json:"clientName"`
AllowOfflineAccess bool `json:"allowOfflineAccess"`
ClientSecrets []string `json:"clientSecrets"`
AllowedGrantTypes []string `json:"allowedGrantTypes"`
AllowedScopes []string `json:"allowedScopes"`
Enabled bool `json:"enabled"`
RequireClientSecret bool `json:"requireClientSecret"`
RedirectUris []string `json:"redirectUris"`
PostLogoutRedirectUris []string `json:"postLogoutRedirectUris"`
FrontChannelLogoutUri *string `json:"frontChannelLogoutUri"`
FrontChannelLogoutSessionRequired bool `json:"frontChannelLogoutSessionRequired"`
BackChannelLogoutUri *string `json:"backChannelLogoutUri"`
BackChannelLogoutSessionRequired bool `json:"backChannelLogoutSessionRequired"`
IdentityTokenLifetime uint64 `json:"identityTokenLifetime"`
AccessTokenLifetime uint64 `json:"accessTokenLifetime"`
AuthorizationCodeLifetime uint64 `json:"authorizationCodeLifetime"`
AbsoluteRefreshTokenLifetime uint64 `json:"absoluteRefreshTokenLifetime"`
SlidingRefreshTokenLifetime uint64 `json:"slidingRefreshTokenLifetime"`
RefreshTokenUsage uint64 `json:"refreshTokenUsage"`
RefreshTokenExpiration uint64 `json:"refreshTokenExpiration"`
AllowedCorsOrigins []string `json:"allowedCorsOrigins"`
AllowAccessTokensViaBrowser bool `json:"allowAccessTokensViaBrowser"`
Claims []OIDCClaim `json:"claims"`
ClientClaimsPrefix string `json:"clientClaimsPrefix"`
RequirePkce bool `json:"requirePkce"`
}
type PathNode struct {
FileName string
Line uint64
Column uint64
Name string
Length uint64
}
type Preset struct {
PresetID uint64 `json:"id"`
Name string
QueryIDs []uint64
Filled bool `json:"-"`
Queries []Query `json:"-"`
}
type Project struct {
ProjectID uint64 `json:"id"`
TeamID uint64
Name string
IsPublic bool
SourceType string
Settings *ProjectSettings
Repo *ProjectRepo
Filters *SourceFilters
CustomFields []ProjectCustomField
}
type ProjectCustomField struct {
ID uint `json:"id"`
Value string `json:"value"`
Name string `json:"name"`
}
type ProjectRepo struct {
URL string
Branch string
UseSSH bool
}
type ProjectSettings struct {
ProjectID uint64
PresetID uint64
PresetName string
EngineConfigurationID uint64
PostScanAction int64
EmailNotifications struct {
FailedScan []string
BeforeScan []string
AfterScan []string
}
}
type Query struct {
Name string
QueryID uint64 `xml:"QueryId"`
BaseQueryID uint64
CWE uint64 `xml:"Cwe"`
Severity int
PackageID uint64 `xml:"PackageId"`
Language string
Group string
IsExecutable bool `xml:"IsExecutable"`
}
type QueryGroup struct {
Name string
PackageID uint64
Queries []Query
Language string `xml:"languageName"`
OwningProjectID uint64 `xml:"ProjectId"`
PackageType string `xml:"PackageTypeName"`
OwningTeamID uint64 `xml:"OwningTeam"`
}
type QueryLanguage struct {
Name string
LanguageID uint64
QueryGroups []QueryGroup
}
type QueryCollection struct {
QueryLanguages []QueryLanguage
}
type Report struct {
ReportID uint64 `json:"reportId"`
Links Links `json:"links"`
}
// ReportStatusResponse - ReportStatusResponse Structure
type ReportStatusResponse struct {
Location string `json:"location"`
ContentType string `json:"contentType"`
Status ReportStatus `json:"status"`
}
// ReportStatus - ReportStatus Structure
type ReportStatus struct {
ID int `json:"id"`
Value string `json:"value"`
}
type ResultState struct {
Name string `xml:"ResultName"`
ID uint `xml:"ResultID"`
Permission string `xml:"ResultPermission"`
IsCustom bool
}
type Role struct {
RoleID uint64 `json:"id"`
IsSystemRole bool
Name string
Description string
PermissionIDs []uint64
}
type Scan struct {
ScanID uint64 `json:"id"`
Project struct {
ID uint64
Name string
}
Status struct {
ID uint64
Name string
}
ScanState struct {
SourceID string `json:"sourceId"`
}
FinishTime time.Time
}
type ScanResult struct {
QueryName string
QueryID uint64
PathID uint64
Line uint64
Column uint64
DetectionDate string
Filename string
DeepLink string
Status string
Severity string
State string
SimilarityID int64
SourceMethod string
DestinationMethod string
Group string
Language string
Nodes []PathNode
}
type ScanResultStatusSummary struct {
ToVerify uint64
NotExploitable uint64
Confirmed uint64
ProposedNotExploitable uint64
Urgent uint64
}
type ScanResultSummary struct {
High ScanResultStatusSummary
Medium ScanResultStatusSummary
Low ScanResultStatusSummary
Information ScanResultStatusSummary
}
type ScanSettings struct {
ProjectID uint64 `json:"projectID"`
OverrideProjectSetting bool `json:"overrideProjectSetting"`
IsIncremental bool `json:"isIncremental"`
IsPublic bool `json:"isPublic"`
ForceScan bool `json:"forceScan"`
Comment string `json:"comment"`
PresetID uint64 `json:"presetId"`
EngineConfigurationID uint64 `json:"engineConfigurationId"`
ZippedSource *[]byte `json:"zippedSource,omitempty"`
}
type SourceFilters struct {
ProjectID uint64 `json:"projectId"`
FoldersPattern string `json:"excludeFoldersPattern"`
FilesPattern string `json:"excludeFilesPattern"`
PathPattern string `json:"pathFilter"`
}
type Team struct {
TeamID uint64 `json:"id"`
Name string
FullName string
ParentID uint64
Projects []*Project
Users []uint64
InheritedUsers []uint64
}
type User struct {
UserID uint64 `json:"id"`
FirstName string
LastName string
UserName string
LastLoginDate string
Email string
IDPID uint64 `json:"authenticationProviderId"`
RoleIDs []uint64
TeamIDs []uint64
AccessToUI bool `json:"accessToUi"`
}