6
6
7
7
import static io .airbyte .commons .auth .AuthRoleConstants .ADMIN ;
8
8
import static io .airbyte .commons .auth .AuthRoleConstants .EDITOR ;
9
+ import static io .airbyte .commons .auth .AuthRoleConstants .ORGANIZATION_EDITOR ;
10
+ import static io .airbyte .commons .auth .AuthRoleConstants .ORGANIZATION_READER ;
9
11
import static io .airbyte .commons .auth .AuthRoleConstants .READER ;
12
+ import static io .airbyte .commons .auth .AuthRoleConstants .WORKSPACE_EDITOR ;
13
+ import static io .airbyte .commons .auth .AuthRoleConstants .WORKSPACE_READER ;
10
14
11
15
import io .airbyte .api .generated .ConnectionApi ;
12
16
import io .airbyte .api .model .generated .ActorDefinitionRequestBody ;
@@ -76,15 +80,14 @@ public ConnectionApiController(final ConnectionsHandler connectionsHandler,
76
80
@ Override
77
81
@ Post (uri = "/auto_disable" )
78
82
@ Secured ({ADMIN })
79
- @ SecuredWorkspace
80
83
@ ExecuteOn (AirbyteTaskExecutors .IO )
81
84
public InternalOperationResult autoDisableConnection (@ Body final ConnectionIdRequestBody connectionIdRequestBody ) {
82
85
return ApiHelper .execute (() -> connectionsHandler .autoDisableConnection (connectionIdRequestBody .getConnectionId ()));
83
86
}
84
87
85
88
@ Override
86
89
@ Post (uri = "/create" )
87
- @ Secured ({EDITOR })
90
+ @ Secured ({EDITOR , WORKSPACE_EDITOR , ORGANIZATION_EDITOR })
88
91
@ SecuredWorkspace
89
92
@ ExecuteOn (AirbyteTaskExecutors .SCHEDULER )
90
93
public ConnectionRead createConnection (@ Body final ConnectionCreate connectionCreate ) {
@@ -93,7 +96,7 @@ public ConnectionRead createConnection(@Body final ConnectionCreate connectionCr
93
96
94
97
@ Override
95
98
@ Post (uri = "/update" )
96
- @ Secured ({EDITOR })
99
+ @ Secured ({EDITOR , WORKSPACE_EDITOR , ORGANIZATION_EDITOR })
97
100
@ SecuredWorkspace
98
101
@ ExecuteOn (AirbyteTaskExecutors .IO )
99
102
public ConnectionRead updateConnection (@ Body final ConnectionUpdate connectionUpdate ) {
@@ -102,7 +105,7 @@ public ConnectionRead updateConnection(@Body final ConnectionUpdate connectionUp
102
105
103
106
@ Override
104
107
@ Post (uri = "/list" )
105
- @ Secured ({READER })
108
+ @ Secured ({READER , WORKSPACE_READER , ORGANIZATION_READER })
106
109
@ SecuredWorkspace
107
110
@ ExecuteOn (AirbyteTaskExecutors .IO )
108
111
public ConnectionReadList listConnectionsForWorkspace (@ Body final WorkspaceIdRequestBody workspaceIdRequestBody ) {
@@ -111,7 +114,7 @@ public ConnectionReadList listConnectionsForWorkspace(@Body final WorkspaceIdReq
111
114
112
115
@ SuppressWarnings ("LineLength" )
113
116
@ Post (uri = "/list_paginated" )
114
- @ Secured ({READER })
117
+ @ Secured ({READER , WORKSPACE_READER , ORGANIZATION_READER })
115
118
@ SecuredWorkspace
116
119
@ ExecuteOn (AirbyteTaskExecutors .IO )
117
120
@ Override
@@ -122,7 +125,7 @@ public ConnectionReadList listConnectionsForWorkspacesPaginated(
122
125
123
126
@ Override
124
127
@ Post (uri = "/list_all" )
125
- @ Secured ({READER })
128
+ @ Secured ({READER , WORKSPACE_READER , ORGANIZATION_READER })
126
129
@ SecuredWorkspace
127
130
@ ExecuteOn (AirbyteTaskExecutors .IO )
128
131
public ConnectionReadList listAllConnectionsForWorkspace (@ Body final WorkspaceIdRequestBody workspaceIdRequestBody ) {
@@ -145,7 +148,7 @@ public ConnectionReadList searchConnections(@Body final ConnectionSearch connect
145
148
146
149
@ Override
147
150
@ Post (uri = "/get" )
148
- @ Secured ({READER })
151
+ @ Secured ({READER , WORKSPACE_READER , ORGANIZATION_READER })
149
152
@ SecuredWorkspace
150
153
@ ExecuteOn (AirbyteTaskExecutors .IO )
151
154
public ConnectionRead getConnection (@ Body final ConnectionIdRequestBody connectionIdRequestBody ) {
@@ -154,7 +157,7 @@ public ConnectionRead getConnection(@Body final ConnectionIdRequestBody connecti
154
157
155
158
@ Override
156
159
@ Post (uri = "/history/data" )
157
- @ Secured ({READER })
160
+ @ Secured ({READER , WORKSPACE_READER , ORGANIZATION_READER })
158
161
@ SecuredWorkspace
159
162
@ ExecuteOn (AirbyteTaskExecutors .IO )
160
163
public List <ConnectionDataHistoryReadItem > getConnectionDataHistory (ConnectionDataHistoryRequestBody connectionDataHistoryRequestBody ) {
@@ -163,7 +166,7 @@ public List<ConnectionDataHistoryReadItem> getConnectionDataHistory(ConnectionDa
163
166
164
167
@ Override
165
168
@ Post (uri = "/connections/status" )
166
- @ Secured ({READER })
169
+ @ Secured ({READER , WORKSPACE_READER , ORGANIZATION_READER })
167
170
@ SecuredWorkspace
168
171
@ ExecuteOn (AirbyteTaskExecutors .IO )
169
172
public List <ConnectionStatusRead > getConnectionStatuses (@ Body final ConnectionStatusesRequestBody connectionStatusesRequestBody ) {
@@ -172,7 +175,7 @@ public List<ConnectionStatusRead> getConnectionStatuses(@Body final ConnectionSt
172
175
173
176
@ Override
174
177
@ Post (uri = "/stream_history" )
175
- @ Secured ({READER })
178
+ @ Secured ({READER , WORKSPACE_READER , ORGANIZATION_READER })
176
179
@ SecuredWorkspace
177
180
@ ExecuteOn (AirbyteTaskExecutors .IO )
178
181
public List <ConnectionStreamHistoryReadItem > getConnectionStreamHistory (ConnectionStreamHistoryRequestBody connectionStreamHistoryRequestBody ) {
@@ -181,7 +184,7 @@ public List<ConnectionStreamHistoryReadItem> getConnectionStreamHistory(Connecti
181
184
182
185
@ Override
183
186
@ Post (uri = "/sync_progress" )
184
- @ Secured ({READER })
187
+ @ Secured ({READER , WORKSPACE_READER , ORGANIZATION_READER })
185
188
@ SecuredWorkspace
186
189
@ ExecuteOn (AirbyteTaskExecutors .IO )
187
190
public List <ConnectionSyncProgressReadItem > getConnectionSyncProgress (ConnectionIdRequestBody connectionIdRequestBody ) {
@@ -190,7 +193,7 @@ public List<ConnectionSyncProgressReadItem> getConnectionSyncProgress(Connection
190
193
191
194
@ Override
192
195
@ Post (uri = "/history/uptime" )
193
- @ Secured ({READER })
196
+ @ Secured ({READER , WORKSPACE_READER , ORGANIZATION_READER })
194
197
@ SecuredWorkspace
195
198
@ ExecuteOn (AirbyteTaskExecutors .IO )
196
199
public List <ConnectionSyncResultRead > getConnectionUptimeHistory (ConnectionUptimeHistoryRequestBody connectionUptimeHistoryRequestBody ) {
@@ -200,7 +203,7 @@ public List<ConnectionSyncResultRead> getConnectionUptimeHistory(ConnectionUptim
200
203
@ Override
201
204
@ Post (uri = "/delete" )
202
205
@ Status (HttpStatus .NO_CONTENT )
203
- @ Secured ({EDITOR })
206
+ @ Secured ({EDITOR , WORKSPACE_EDITOR , ORGANIZATION_EDITOR })
204
207
@ SecuredWorkspace
205
208
@ ExecuteOn (AirbyteTaskExecutors .IO )
206
209
public void deleteConnection (@ Body final ConnectionIdRequestBody connectionIdRequestBody ) {
@@ -213,7 +216,7 @@ public void deleteConnection(@Body final ConnectionIdRequestBody connectionIdReq
213
216
214
217
@ Override
215
218
@ Post (uri = "/sync" )
216
- @ Secured ({EDITOR })
219
+ @ Secured ({EDITOR , WORKSPACE_EDITOR , ORGANIZATION_EDITOR })
217
220
@ SecuredWorkspace
218
221
@ ExecuteOn (AirbyteTaskExecutors .SCHEDULER )
219
222
public JobInfoRead syncConnection (@ Body final ConnectionIdRequestBody connectionIdRequestBody ) {
@@ -222,7 +225,7 @@ public JobInfoRead syncConnection(@Body final ConnectionIdRequestBody connection
222
225
223
226
@ Override
224
227
@ Post (uri = "/reset" )
225
- @ Secured ({EDITOR })
228
+ @ Secured ({EDITOR , WORKSPACE_EDITOR , ORGANIZATION_EDITOR })
226
229
@ SecuredWorkspace
227
230
@ ExecuteOn (AirbyteTaskExecutors .SCHEDULER )
228
231
public JobInfoRead resetConnection (@ Body final ConnectionIdRequestBody connectionIdRequestBody ) {
@@ -231,7 +234,7 @@ public JobInfoRead resetConnection(@Body final ConnectionIdRequestBody connectio
231
234
232
235
@ Override
233
236
@ Post (uri = "/reset/stream" )
234
- @ Secured ({EDITOR })
237
+ @ Secured ({EDITOR , WORKSPACE_EDITOR , ORGANIZATION_EDITOR })
235
238
@ SecuredWorkspace
236
239
@ ExecuteOn (AirbyteTaskExecutors .SCHEDULER )
237
240
public JobInfoRead resetConnectionStream (final ConnectionStreamRequestBody connectionStreamRequestBody ) {
@@ -240,7 +243,7 @@ public JobInfoRead resetConnectionStream(final ConnectionStreamRequestBody conne
240
243
241
244
@ Override
242
245
@ Post (uri = "/apply_schema_change" )
243
- @ Secured ({EDITOR })
246
+ @ Secured ({EDITOR , WORKSPACE_EDITOR , ORGANIZATION_EDITOR })
244
247
@ SecuredWorkspace
245
248
@ ExecuteOn (AirbyteTaskExecutors .IO )
246
249
public ConnectionAutoPropagateResult applySchemaChangeForConnection (final ConnectionAutoPropagateSchemaChange request ) {
@@ -250,7 +253,6 @@ public ConnectionAutoPropagateResult applySchemaChangeForConnection(final Connec
250
253
@ Override
251
254
@ Post (uri = "/get_task_queue_name" )
252
255
@ Secured ({ADMIN })
253
- @ SecuredWorkspace
254
256
@ ExecuteOn (AirbyteTaskExecutors .IO )
255
257
public TaskQueueNameRead getTaskQueueName (final GetTaskQueueNameRequest request ) {
256
258
final TemporalJobType jobType ;
0 commit comments