Skip to content

Commit

Permalink
Merge branch 'main' into jwalker/repl-tolerations
Browse files Browse the repository at this point in the history
  • Loading branch information
davinchia authored Dec 14, 2023
2 parents 6e30bcd + d4ba1b8 commit 5703b39
Show file tree
Hide file tree
Showing 401 changed files with 2,841 additions and 1,216 deletions.
2 changes: 1 addition & 1 deletion airbyte-api-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:2.0.4
ARG JDK_IMAGE=airbyte/airbyte-base-java-image:2.1.0
FROM ${JDK_IMAGE} AS server
EXPOSE 8006 5005
ENV APPLICATION airbyte-api-server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ open class ConnectionsController(
) : ConnectionsApi {
override fun createConnection(
connectionCreateRequest: ConnectionCreateRequest?,
authorization: String?,
userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand All @@ -56,7 +57,7 @@ open class ConnectionsController(
// get destination response to retrieve workspace id as well as input for destination sync modes
val destinationResponse: DestinationResponse =
trackingHelper.callWithTracker(
{ destinationService.getDestination(connectionCreateRequest!!.destinationId, validUserInfo) },
{ destinationService.getDestination(connectionCreateRequest!!.destinationId, authorization, validUserInfo) },
CONNECTIONS_PATH,
POST,
userId,
Expand All @@ -65,7 +66,7 @@ open class ConnectionsController(
// get source schema for catalog id and airbyte catalog
val schemaResponse: SourceDiscoverSchemaRead =
trackingHelper.callWithTracker(
{ sourceService.getSourceSchema(connectionCreateRequest!!.sourceId, false, validUserInfo) },
{ sourceService.getSourceSchema(connectionCreateRequest!!.sourceId, false, authorization, validUserInfo) },
CONNECTIONS_PATH,
POST,
userId,
Expand Down Expand Up @@ -106,7 +107,7 @@ open class ConnectionsController(

val validDestinationSyncModes =
trackingHelper.callWithTracker(
{ destinationService.getDestinationSyncModes(destinationResponse, validUserInfo) },
{ destinationService.getDestinationSyncModes(destinationResponse, authorization, validUserInfo) },
CONNECTIONS_PATH,
POST,
userId,
Expand Down Expand Up @@ -142,6 +143,7 @@ open class ConnectionsController(
catalogId!!,
finalConfiguredCatalog!!,
destinationResponse.workspaceId,
authorization,
validUserInfo,
)
}, CONNECTIONS_PATH, POST, userId)!!
Expand All @@ -159,6 +161,7 @@ open class ConnectionsController(

override fun deleteConnection(
connectionId: UUID,
authorization: String?,
userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand All @@ -168,6 +171,7 @@ open class ConnectionsController(
{
connectionService.deleteConnection(
connectionId,
authorization,
getLocalUserInfoIfNull(userInfo),
)
},
Expand All @@ -188,6 +192,7 @@ open class ConnectionsController(

override fun getConnection(
connectionId: UUID,
authorization: String?,
userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand All @@ -196,6 +201,7 @@ open class ConnectionsController(
trackingHelper.callWithTracker({
connectionService.getConnection(
connectionId,
authorization,
getLocalUserInfoIfNull(userInfo),
)
}, CONNECTIONS_PATH, GET, userId)!!
Expand All @@ -215,6 +221,7 @@ open class ConnectionsController(
includeDeleted: Boolean?,
limit: Int?,
offset: Int?,
authorization: String?,
userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand All @@ -227,6 +234,7 @@ open class ConnectionsController(
limit!!,
offset!!,
includeDeleted!!,
authorization,
getLocalUserInfoIfNull(userInfo),
)
}, CONNECTIONS_PATH, GET, userId)!!
Expand All @@ -245,6 +253,7 @@ open class ConnectionsController(
override fun patchConnection(
connectionId: UUID,
connectionPatchRequest: ConnectionPatchRequest,
authorization: String?,
userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand All @@ -264,7 +273,7 @@ open class ConnectionsController(

val currentConnection: ConnectionResponse =
trackingHelper.callWithTracker(
{ connectionService.getConnection(connectionId, validUserInfo) },
{ connectionService.getConnection(connectionId, authorization, validUserInfo) },
CONNECTIONS_WITH_ID_PATH,
PUT,
userId,
Expand All @@ -273,7 +282,7 @@ open class ConnectionsController(
// get destination response to retrieve workspace id as well as input for destination sync modes
val destinationResponse: DestinationResponse =
trackingHelper.callWithTracker(
{ destinationService.getDestination(currentConnection.destinationId, validUserInfo) },
{ destinationService.getDestination(currentConnection.destinationId, authorization, validUserInfo) },
CONNECTIONS_WITH_ID_PATH,
PUT,
userId,
Expand All @@ -282,7 +291,7 @@ open class ConnectionsController(
// get source schema for catalog id and airbyte catalog
val schemaResponse =
trackingHelper.callWithTracker(
{ sourceService.getSourceSchema(currentConnection.sourceId, false, validUserInfo) },
{ sourceService.getSourceSchema(currentConnection.sourceId, false, authorization, validUserInfo) },
CONNECTIONS_PATH,
POST,
userId,
Expand Down Expand Up @@ -323,7 +332,7 @@ open class ConnectionsController(

val validDestinationSyncModes =
trackingHelper.callWithTracker(
{ destinationService.getDestinationSyncModes(destinationResponse, validUserInfo) },
{ destinationService.getDestinationSyncModes(destinationResponse, authorization, validUserInfo) },
CONNECTIONS_PATH,
POST,
userId,
Expand Down Expand Up @@ -360,6 +369,7 @@ open class ConnectionsController(
catalogId!!,
finalConfiguredCatalog,
destinationResponse.workspaceId,
authorization,
validUserInfo,
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ open class DefaultController() : DefaultApi {
@Value("\${airbyte.internal.documentation.host}")
var documentationHost: String? = null

override fun getDocumentation(userInfo: String?): Response {
override fun getDocumentation(
authorization: String?,
userInfo: String?,
): Response {
return Response
.status(302)
.location(URI.create(documentationHost))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ open class DestinationsController(
) : DestinationsApi {
override fun createDestination(
destinationCreateRequest: DestinationCreateRequest,
authorization: String?,
userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand Down Expand Up @@ -68,6 +69,7 @@ open class DestinationsController(
destinationService.createDestination(
destinationCreateRequest,
destinationDefinitionId,
authorization,
getLocalUserInfoIfNull(userInfo),
)
},
Expand All @@ -89,6 +91,7 @@ open class DestinationsController(

override fun deleteDestination(
destinationId: UUID,
authorization: String?,
userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand All @@ -98,6 +101,7 @@ open class DestinationsController(
{
destinationService.deleteDestination(
destinationId,
authorization,
getLocalUserInfoIfNull(userInfo),
)
},
Expand All @@ -118,6 +122,7 @@ open class DestinationsController(

override fun getDestination(
destinationId: UUID,
authorization: String?,
userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand All @@ -127,6 +132,7 @@ open class DestinationsController(
{
destinationService.getDestination(
destinationId,
authorization,
getLocalUserInfoIfNull(userInfo),
)
},
Expand All @@ -150,6 +156,7 @@ open class DestinationsController(
includeDeleted: Boolean?,
limit: Int?,
offset: Int?,
authorization: String?,
userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand All @@ -162,6 +169,7 @@ open class DestinationsController(
includeDeleted!!,
limit!!,
offset!!,
authorization,
getLocalUserInfoIfNull(userInfo),
)
}, DESTINATIONS_PATH, GET, userId)
Expand All @@ -180,6 +188,7 @@ open class DestinationsController(
override fun patchDestination(
destinationId: UUID,
destinationPatchRequest: DestinationPatchRequest,
authorization: String?,
userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand All @@ -192,6 +201,7 @@ open class DestinationsController(
destinationService.partialUpdateDestination(
destinationId,
destinationPatchRequest,
authorization,
getLocalUserInfoIfNull(userInfo),
)
},
Expand All @@ -214,6 +224,7 @@ open class DestinationsController(
override fun putDestination(
destinationId: UUID,
destinationPutRequest: DestinationPutRequest,
authorization: String?,
userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand All @@ -226,6 +237,7 @@ open class DestinationsController(
destinationService.updateDestination(
destinationId,
destinationPutRequest,
authorization,
getLocalUserInfoIfNull(userInfo),
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import io.airbyte.airbyte_api.model.generated.JobTypeEnum
import io.airbyte.api.client.model.generated.JobListForWorkspacesRequestBody.OrderByFieldEnum
import io.airbyte.api.client.model.generated.JobListForWorkspacesRequestBody.OrderByMethodEnum
import io.airbyte.api.server.apiTracking.TrackingHelper
import io.airbyte.api.server.constants.AUTH_HEADER
import io.airbyte.api.server.constants.DELETE
import io.airbyte.api.server.constants.ENDPOINT_API_USER_INFO_HEADER
import io.airbyte.api.server.constants.GET
Expand Down Expand Up @@ -47,6 +48,7 @@ open class JobsController(
@Path("/{jobId}")
override fun cancelJob(
@PathParam("jobId") jobId: Long,
@HeaderParam(AUTH_HEADER) authorization: String?,
@HeaderParam(ENDPOINT_API_USER_INFO_HEADER) userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand All @@ -56,6 +58,7 @@ open class JobsController(
{
jobService.cancelJob(
jobId,
authorization,
getLocalUserInfoIfNull(userInfo),
)
},
Expand All @@ -77,6 +80,7 @@ open class JobsController(

override fun createJob(
jobCreateRequest: JobCreateRequest,
authorization: String?,
userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand All @@ -86,6 +90,7 @@ open class JobsController(
{
connectionService.getConnection(
jobCreateRequest.connectionId,
authorization,
getLocalUserInfoIfNull(userInfo),
)
},
Expand All @@ -101,6 +106,7 @@ open class JobsController(
trackingHelper.callWithTracker({
jobService.sync(
jobCreateRequest.connectionId,
authorization,
getLocalUserInfoIfNull(userInfo),
)
}, JOBS_PATH, POST, userId)!!
Expand All @@ -121,6 +127,7 @@ open class JobsController(
trackingHelper.callWithTracker({
jobService.reset(
jobCreateRequest.connectionId,
authorization,
getLocalUserInfoIfNull(userInfo),
)
}, JOBS_PATH, POST, userId)!!
Expand Down Expand Up @@ -153,6 +160,7 @@ open class JobsController(
@Path("/{jobId}")
override fun getJob(
@PathParam("jobId") jobId: Long,
@HeaderParam(AUTH_HEADER) authorization: String?,
@HeaderParam(ENDPOINT_API_USER_INFO_HEADER) userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand All @@ -162,6 +170,7 @@ open class JobsController(
{
jobService.getJobInfoWithoutLogs(
jobId,
authorization,
getLocalUserInfoIfNull(userInfo),
)
},
Expand Down Expand Up @@ -193,6 +202,7 @@ open class JobsController(
updatedAtStart: OffsetDateTime?,
updatedAtEnd: OffsetDateTime?,
orderBy: String?,
authorization: String?,
userInfo: String?,
): Response {
val userId: UUID = userService.getUserIdFromUserInfoString(userInfo)
Expand Down Expand Up @@ -221,6 +231,7 @@ open class JobsController(
filter,
orderByField,
orderByMethod,
authorization,
getLocalUserInfoIfNull(userInfo),
)
},
Expand All @@ -236,6 +247,7 @@ open class JobsController(
filter,
orderByField,
orderByMethod,
authorization,
getLocalUserInfoIfNull(userInfo),
)
},
Expand Down
Loading

0 comments on commit 5703b39

Please sign in to comment.