Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Akka Extensions for gateway authentication
Signed-off-by: David Schwilk <david.schwilk@bosch.io>
- Loading branch information
1 parent
a5da06a
commit 2c049b0
Showing
36 changed files
with
840 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
.../org/eclipse/ditto/gateway/service/endpoints/routes/sse/NoOpSseAuthorizationEnforcer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (c) 2022 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.eclipse.ditto.gateway.service.endpoints.routes.sse; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
import java.util.concurrent.CompletionStage; | ||
|
||
import org.eclipse.ditto.base.model.headers.DittoHeaders; | ||
|
||
import akka.actor.ActorSystem; | ||
import akka.http.javadsl.server.RequestContext; | ||
|
||
/** | ||
* Null implementation for {@link SseAuthorizationEnforcer}. | ||
*/ | ||
public final class NoOpSseAuthorizationEnforcer extends SseAuthorizationEnforcer { | ||
|
||
/** | ||
* @param actorSystem the actor system in which to load the extension. | ||
*/ | ||
public NoOpSseAuthorizationEnforcer(final ActorSystem actorSystem) { | ||
super(actorSystem); | ||
} | ||
|
||
@Override | ||
public CompletionStage<Void> checkAuthorization(final RequestContext requestContext, | ||
final DittoHeaders dittoHeaders) { | ||
return CompletableFuture.completedStage(null); | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...a/org/eclipse/ditto/gateway/service/endpoints/routes/sse/NoOpSseConnectionSupervisor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) 2022 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.eclipse.ditto.gateway.service.endpoints.routes.sse; | ||
|
||
import org.eclipse.ditto.base.model.headers.DittoHeaders; | ||
import org.eclipse.ditto.gateway.service.streaming.actors.SupervisedStream; | ||
|
||
import akka.actor.ActorSystem; | ||
|
||
/** | ||
* Null implementation for {@link SseConnectionSupervisor}. | ||
*/ | ||
public final class NoOpSseConnectionSupervisor extends SseConnectionSupervisor { | ||
|
||
/** | ||
* @param actorSystem the actor system in which to load the extension. | ||
*/ | ||
public NoOpSseConnectionSupervisor(final ActorSystem actorSystem) { | ||
super(actorSystem); | ||
} | ||
|
||
@Override | ||
public void supervise(final SupervisedStream supervisedStream, final CharSequence connectionCorrelationId, | ||
final DittoHeaders dittoHeaders) { | ||
|
||
// Does nothing. | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.