@@ -18,38 +18,91 @@ func TestProjectKeysService_List(t *testing.T) {
18
18
assertMethod (t , "GET" , r )
19
19
w .Header ().Set ("Content-Type" , "application/json" )
20
20
w .Header ().Set ("Link" , "</api/0/projects/the-interstellar-jurisdiction/pump-station/keys/?&cursor=0:0:1>; rel=\" previous\" ; results=\" true\" ; cursor=\" 0:0:1\" , </api/0/projects/the-interstellar-jurisdiction/pump-station/keys/?&cursor=1584513610301:0:1>; rel=\" next\" ; results=\" false\" ; cursor=\" 1584513610301:0:1\" " )
21
- fmt .Fprint (w , `[{
22
- "browserSdk": {
23
- "choices": [
24
- [
25
- "latest",
26
- "latest"
27
- ],
28
- [
29
- "4.x",
30
- "4.x"
21
+ fmt .Fprint (w , `[
22
+ {
23
+ "id": "60120449b6b1d5e45f75561e6dabd80b",
24
+ "name": "Liked Pegasus",
25
+ "label": "Liked Pegasus",
26
+ "public": "60120449b6b1d5e45f75561e6dabd80b",
27
+ "secret": "189485c3b8ccf582bf5e12c530ef8858",
28
+ "projectId": 4505281256090153,
29
+ "isActive": true,
30
+ "rateLimit": {
31
+ "window": 7200,
32
+ "count": 1000
33
+ },
34
+ "dsn": {
35
+ "secret": "https://a785682ddda742d7a8a4088810e67701:bcd99b3790b3441c85ce4b1eaa854f66@o4504765715316736.ingest.sentry.io/4505281256090153",
36
+ "public": "https://a785682ddda742d7a8a4088810e67791@o4504765715316736.ingest.sentry.io/4505281256090153",
37
+ "csp": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/csp-report/?sentry_key=a785682ddda719b7a8a4011110d75598",
38
+ "security": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/security/?sentry_key=a785682ddda719b7a8a4011110d75598",
39
+ "minidump": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/minidump/?sentry_key=a785682ddda719b7a8a4011110d75598",
40
+ "nel": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/nel/?sentry_key=a785682ddda719b7a8a4011110d75598",
41
+ "unreal": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/unreal/a785682ddda719b7a8a4011110d75598/",
42
+ "cdn": "https://js.sentry-cdn.com/a785682ddda719b7a8a4011110d75598.min.js",
43
+ "crons": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/crons/___MONITOR_SLUG___/a785682ddda719b7a8a4011110d75598/"
44
+ },
45
+ "browserSdkVersion": "7.x",
46
+ "browserSdk": {
47
+ "choices": [
48
+ [
49
+ "latest",
50
+ "latest"
51
+ ],
52
+ [
53
+ "7.x",
54
+ "7.x"
55
+ ]
31
56
]
32
- ]
57
+ },
58
+ "dateCreated": "2023-06-21T19:50:26.036254Z",
59
+ "dynamicSdkLoaderOptions": {
60
+ "hasReplay": true,
61
+ "hasPerformance": true,
62
+ "hasDebug": true
63
+ }
33
64
},
34
- "browserSdkVersion": "4.x",
35
- "dateCreated": "2018-09-20T15:48:07.397Z",
36
- "dsn": {
37
- "cdn": "https://sentry.io/js-sdk-loader/cfc7b0341c6e4f6ea1a9d256a30dba00.min.js",
38
- "csp": "https://sentry.io/api/2/csp-report/?sentry_key=cfc7b0341c6e4f6ea1a9d256a30dba00",
39
- "minidump": "https://sentry.io/api/2/minidump/?sentry_key=cfc7b0341c6e4f6ea1a9d256a30dba00",
40
- "public": "https://[email protected] /2",
41
- "secret": "https://cfc7b0341c6e4f6ea1a9d256a30dba00:[email protected] /2",
42
- "security": "https://sentry.io/api/2/security/?sentry_key=cfc7b0341c6e4f6ea1a9d256a30dba00"
43
- },
44
- "id": "cfc7b0341c6e4f6ea1a9d256a30dba00",
45
- "isActive": true,
46
- "label": "Fabulous Key",
47
- "name": "Fabulous Key",
48
- "projectId": 2,
49
- "public": "cfc7b0341c6e4f6ea1a9d256a30dba00",
50
- "rateLimit": null,
51
- "secret": "a07dcd97aa56481f82aeabaed43ca448"
52
- }]` )
65
+ {
66
+ "id": "da8d69cb17e80677b76e08fde4656b93",
67
+ "name": "Bold Oarfish",
68
+ "label": "Bold Oarfish",
69
+ "public": "da8d69cb17e80677b76e08fde4656b93",
70
+ "secret": "5c241ebc42ccfbec281cbefbedc7ab96",
71
+ "projectId": 4505281256090153,
72
+ "isActive": true,
73
+ "rateLimit": null,
74
+ "dsn": {
75
+ "secret": "https://a785682ddda742d7a8a4088810e67701:bcd99b3790b3441c85ce4b1eaa854f66@o4504765715316736.ingest.sentry.io/4505281256090153",
76
+ "public": "https://a785682ddda742d7a8a4088810e67791@o4504765715316736.ingest.sentry.io/4505281256090153",
77
+ "csp": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/csp-report/?sentry_key=a785682ddda719b7a8a4011110d75598",
78
+ "security": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/security/?sentry_key=a785682ddda719b7a8a4011110d75598",
79
+ "minidump": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/minidump/?sentry_key=a785682ddda719b7a8a4011110d75598",
80
+ "nel": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/nel/?sentry_key=a785682ddda719b7a8a4011110d75598",
81
+ "unreal": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/unreal/a785682ddda719b7a8a4011110d75598/",
82
+ "cdn": "https://js.sentry-cdn.com/a785682ddda719b7a8a4011110d75598.min.js",
83
+ "crons": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/crons/___MONITOR_SLUG___/a785682ddda719b7a8a4011110d75598/"
84
+ },
85
+ "browserSdkVersion": "7.x",
86
+ "browserSdk": {
87
+ "choices": [
88
+ [
89
+ "latest",
90
+ "latest"
91
+ ],
92
+ [
93
+ "7.x",
94
+ "7.x"
95
+ ]
96
+ ]
97
+ },
98
+ "dateCreated": "2023-06-21T19:50:26.036254Z",
99
+ "dynamicSdkLoaderOptions": {
100
+ "hasReplay": true,
101
+ "hasPerformance": true,
102
+ "hasDebug": true
103
+ }
104
+ }
105
+ ]` )
53
106
})
54
107
55
108
ctx := context .Background ()
@@ -58,22 +111,63 @@ func TestProjectKeysService_List(t *testing.T) {
58
111
59
112
expected := []* ProjectKey {
60
113
{
61
- ID : "cfc7b0341c6e4f6ea1a9d256a30dba00 " ,
62
- Name : "Fabulous Key " ,
63
- Label : "Fabulous Key " ,
64
- Public : "cfc7b0341c6e4f6ea1a9d256a30dba00 " ,
65
- Secret : "a07dcd97aa56481f82aeabaed43ca448 " ,
66
- ProjectID : json .Number ("2 " ),
114
+ ID : "60120449b6b1d5e45f75561e6dabd80b " ,
115
+ Name : "Liked Pegasus " ,
116
+ Label : "Liked Pegasus " ,
117
+ Public : "60120449b6b1d5e45f75561e6dabd80b " ,
118
+ Secret : "189485c3b8ccf582bf5e12c530ef8858 " ,
119
+ ProjectID : json .Number ("4505281256090153 " ),
67
120
IsActive : true ,
121
+ RateLimit : & ProjectKeyRateLimit {
122
+ Window : 7200 ,
123
+ Count : 1000 ,
124
+ },
68
125
DSN : ProjectKeyDSN {
69
- Secret :
"https://cfc7b0341c6e4f6ea1a9d256a30dba00:[email protected] /2" ,
70
- Public :
"https://[email protected] /2" ,
71
- CSP : "https://sentry.io/api/2/csp-report/?sentry_key=cfc7b0341c6e4f6ea1a9d256a30dba00" ,
72
- Security : "https://sentry.io/api/2/security/?sentry_key=cfc7b0341c6e4f6ea1a9d256a30dba00" ,
73
- Minidump : "https://sentry.io/api/2/minidump/?sentry_key=cfc7b0341c6e4f6ea1a9d256a30dba00" ,
74
- CDN : "https://sentry.io/js-sdk-loader/cfc7b0341c6e4f6ea1a9d256a30dba00.min.js" ,
126
+ Secret : "https://a785682ddda742d7a8a4088810e67701:bcd99b3790b3441c85ce4b1eaa854f66@o4504765715316736.ingest.sentry.io/4505281256090153" ,
127
+ Public : "https://a785682ddda742d7a8a4088810e67791@o4504765715316736.ingest.sentry.io/4505281256090153" ,
128
+ CSP : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/csp-report/?sentry_key=a785682ddda719b7a8a4011110d75598" ,
129
+ Security : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/security/?sentry_key=a785682ddda719b7a8a4011110d75598" ,
130
+ Minidump : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/minidump/?sentry_key=a785682ddda719b7a8a4011110d75598" ,
131
+ NEL : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/nel/?sentry_key=a785682ddda719b7a8a4011110d75598" ,
132
+ Unreal : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/unreal/a785682ddda719b7a8a4011110d75598/" ,
133
+ CDN : "https://js.sentry-cdn.com/a785682ddda719b7a8a4011110d75598.min.js" ,
134
+ Crons : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/crons/___MONITOR_SLUG___/a785682ddda719b7a8a4011110d75598/" ,
135
+ },
136
+ BrowserSDKVersion : "7.x" ,
137
+ DateCreated : mustParseTime ("2023-06-21T19:50:26.036254Z" ),
138
+ DynamicSDKLoaderOptions : ProjectKeyDynamicSDKLoaderOptions {
139
+ HasReplay : true ,
140
+ HasPerformance : true ,
141
+ HasDebugFiles : true ,
142
+ },
143
+ },
144
+ {
145
+ ID : "da8d69cb17e80677b76e08fde4656b93" ,
146
+ Name : "Bold Oarfish" ,
147
+ Label : "Bold Oarfish" ,
148
+ Public : "da8d69cb17e80677b76e08fde4656b93" ,
149
+ Secret : "5c241ebc42ccfbec281cbefbedc7ab96" ,
150
+ ProjectID : json .Number ("4505281256090153" ),
151
+ IsActive : true ,
152
+ RateLimit : nil ,
153
+ DSN : ProjectKeyDSN {
154
+ Secret : "https://a785682ddda742d7a8a4088810e67701:bcd99b3790b3441c85ce4b1eaa854f66@o4504765715316736.ingest.sentry.io/4505281256090153" ,
155
+ Public : "https://a785682ddda742d7a8a4088810e67791@o4504765715316736.ingest.sentry.io/4505281256090153" ,
156
+ CSP : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/csp-report/?sentry_key=a785682ddda719b7a8a4011110d75598" ,
157
+ Security : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/security/?sentry_key=a785682ddda719b7a8a4011110d75598" ,
158
+ Minidump : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/minidump/?sentry_key=a785682ddda719b7a8a4011110d75598" ,
159
+ NEL : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/nel/?sentry_key=a785682ddda719b7a8a4011110d75598" ,
160
+ Unreal : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/unreal/a785682ddda719b7a8a4011110d75598/" ,
161
+ CDN : "https://js.sentry-cdn.com/a785682ddda719b7a8a4011110d75598.min.js" ,
162
+ Crons : "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/crons/___MONITOR_SLUG___/a785682ddda719b7a8a4011110d75598/" ,
163
+ },
164
+ BrowserSDKVersion : "7.x" ,
165
+ DateCreated : mustParseTime ("2023-06-21T19:50:26.036254Z" ),
166
+ DynamicSDKLoaderOptions : ProjectKeyDynamicSDKLoaderOptions {
167
+ HasReplay : true ,
168
+ HasPerformance : true ,
169
+ HasDebugFiles : true ,
75
170
},
76
- DateCreated : mustParseTime ("2018-09-20T15:48:07.397Z" ),
77
171
},
78
172
}
79
173
assert .Equal (t , expected , projectKeys )
@@ -145,7 +239,8 @@ func TestProjectKeysService_Create(t *testing.T) {
145
239
Minidump : "https://sentry.io/api/2/minidump/?sentry_key=cfc7b0341c6e4f6ea1a9d256a30dba00" ,
146
240
CDN : "https://sentry.io/js-sdk-loader/cfc7b0341c6e4f6ea1a9d256a30dba00.min.js" ,
147
241
},
148
- DateCreated : mustParseTime ("2018-09-20T15:48:07.397Z" ),
242
+ BrowserSDKVersion : "4.x" ,
243
+ DateCreated : mustParseTime ("2018-09-20T15:48:07.397Z" ),
149
244
}
150
245
assert .Equal (t , expected , projectKey )
151
246
}
@@ -216,7 +311,8 @@ func TestProjectKeysService_Update(t *testing.T) {
216
311
Minidump : "https://sentry.io/api/2/minidump/?sentry_key=cfc7b0341c6e4f6ea1a9d256a30dba00" ,
217
312
CDN : "https://sentry.io/js-sdk-loader/cfc7b0341c6e4f6ea1a9d256a30dba00.min.js" ,
218
313
},
219
- DateCreated : mustParseTime ("2018-09-20T15:48:07.397Z" ),
314
+ BrowserSDKVersion : "4.x" ,
315
+ DateCreated : mustParseTime ("2018-09-20T15:48:07.397Z" ),
220
316
}
221
317
assert .Equal (t , expected , projectKey )
222
318
}
@@ -300,7 +396,8 @@ func TestProjectKeysService_Update_RateLimit(t *testing.T) {
300
396
Minidump : "https://sentry.io/api/2/minidump/?sentry_key=cfc7b0341c6e4f6ea1a9d256a30dba00" ,
301
397
CDN : "https://sentry.io/js-sdk-loader/cfc7b0341c6e4f6ea1a9d256a30dba00.min.js" ,
302
398
},
303
- DateCreated : mustParseTime ("2018-09-20T15:48:07.397Z" ),
399
+ BrowserSDKVersion : "4.x" ,
400
+ DateCreated : mustParseTime ("2018-09-20T15:48:07.397Z" ),
304
401
}
305
402
assert .Equal (t , expected , projectKey )
306
403
}
0 commit comments