Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert NotificationsApiController to Micronaut #20396

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions airbyte-proxy/nginx-auth.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ http {
}
}

location ~ ^/api/v1/(connections|destinations|destination_definitions|destination_definition_specifications|destination_oauths|jobs|operations|scheduler|source_oauths|sources|source_definitions|source_definition_specifications|state|workspaces)/.* {
location ~ ^/api/v1/(connections|destinations|destination_definitions|destination_definition_specifications|destination_oauths|jobs|notifications|operations|scheduler|source_oauths|sources|source_definitions|source_definition_specifications|state|workspaces)/.* {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down Expand Up @@ -103,7 +103,7 @@ http {
}
}

location ~ ^/api/v1/(connections|destinations|destination_definitions|destination_definition_specifications|destination_oauths|jobs|operations|scheduler|source_oauths|sources|source_definitions|source_definition_specifications|state|workspaces)/.* {
location ~ ^/api/v1/(connections|destinations|destination_definitions|destination_definition_specifications|destination_oauths|jobs|notifications|operations|scheduler|source_oauths|sources|source_definitions|source_definition_specifications|state|workspaces)/.* {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down
4 changes: 2 additions & 2 deletions airbyte-proxy/nginx-no-auth.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ http {
proxy_pass "${PROXY_PASS_MICRONAUT_API}";
}

location ~ ^/api/v1/(connections|destinations|destination_definitions|destination_definition_specifications|destination_oauths|jobs|operations|scheduler|source_oauths|sources|source_definitions|source_definition_specifications|state|workspaces)/.* {
location ~ ^/api/v1/(connections|destinations|destination_definitions|destination_definition_specifications|destination_oauths|jobs|notifications|operations|scheduler|source_oauths|sources|source_definitions|source_definition_specifications|state|workspaces)/.* {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down Expand Up @@ -58,7 +58,7 @@ http {
proxy_pass "${PROXY_PASS_MICRONAUT_API}";
}

location ~ ^/api/v1/(connections|destinations|destination_definitions|destination_definition_specifications|destination_oauths|jobs|operations|scheduler|source_oauths|sources|source_definitions|source_definition_specifications|state|workspaces)/.* {
location ~ ^/api/v1/(connections|destinations|destination_definitions|destination_definition_specifications|destination_oauths|jobs|notifications|operations|scheduler|source_oauths|sources|source_definitions|source_definition_specifications|state|workspaces)/.* {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
import io.airbyte.server.apis.NotificationsApiController;
import io.airbyte.server.apis.WebBackendApiController;
import io.airbyte.server.apis.binders.LogsApiBinder;
import io.airbyte.server.apis.binders.NotificationApiBinder;
import io.airbyte.server.apis.binders.WebBackendApiBinder;
import io.airbyte.server.apis.factories.LogsApiFactory;
import io.airbyte.server.apis.factories.NotificationsApiFactory;
import io.airbyte.server.apis.factories.WebBackendApiFactory;
import io.airbyte.server.handlers.AttemptHandler;
import io.airbyte.server.handlers.ConnectionsHandler;
Expand Down Expand Up @@ -118,8 +116,6 @@ public ServerRunnable create(final SynchronousSchedulerClient synchronousSchedul

LogsApiFactory.setValues(logsHandler);

NotificationsApiFactory.setValues(workspacesHandler);

WebBackendApiFactory.setValues(webBackendConnectionsHandler, webBackendGeographiesHandler, webBackendCheckUpdatesHandler);

final Set<Class<?>> componentClasses = Set.of(
Expand All @@ -129,7 +125,6 @@ public ServerRunnable create(final SynchronousSchedulerClient synchronousSchedul

final Set<Object> components = Set.of(
new LogsApiBinder(),
new NotificationApiBinder(),
new WebBackendApiBinder());

// construct server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@
import io.airbyte.api.model.generated.Notification;
import io.airbyte.api.model.generated.NotificationRead;
import io.airbyte.server.handlers.WorkspacesHandler;
import javax.ws.rs.Path;
import lombok.AllArgsConstructor;
import io.micronaut.http.annotation.Body;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Post;

@Path("/v1/notifications/try")
@AllArgsConstructor
@Controller("/api/v1/notifications/try")
public class NotificationsApiController implements NotificationsApi {

private final WorkspacesHandler workspacesHandler;

public NotificationsApiController(final WorkspacesHandler workspacesHandler) {
this.workspacesHandler = workspacesHandler;
}

@Post
@Override
public NotificationRead tryNotificationConfig(final Notification notification) {
public NotificationRead tryNotificationConfig(@Body final Notification notification) {
return ApiHelper.execute(() -> workspacesHandler.tryNotification(notification));
}

Expand Down

This file was deleted.

This file was deleted.