Skip to content

Commit

Permalink
Revert changes in rootRoute
Browse files Browse the repository at this point in the history
Signed-off-by: Joel Bartelheimer <joel.bartelheimer@bosch.io>
  • Loading branch information
jbartelh committed Apr 17, 2020
1 parent 1334a8e commit 51f16ca
Showing 1 changed file with 23 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import org.eclipse.ditto.protocoladapter.HeaderTranslator;
import org.eclipse.ditto.protocoladapter.ProtocolAdapter;
import org.eclipse.ditto.protocoladapter.TopicPath;
import org.eclipse.ditto.services.gateway.endpoints.directives.ContentTypeValidationDirective;
import org.eclipse.ditto.services.gateway.endpoints.directives.CorsEnablingDirective;
import org.eclipse.ditto.services.gateway.endpoints.directives.EncodingEnsuringDirective;
import org.eclipse.ditto.services.gateway.endpoints.directives.HttpsEnsuringDirective;
Expand Down Expand Up @@ -239,36 +238,31 @@ private Route wsAuthentication(final CharSequence correlationId,
private Route api(final RequestContext ctx, final String correlationId) {
return rawPathPrefix(PathMatchers.slash().concat(HTTP_PATH_API_PREFIX), () -> // /api
ensureSchemaVersion(apiVersion -> // /api/<apiVersion>
ContentTypeValidationDirective.ensureValidContentType(correlationId, ctx,
() -> customApiRoutesProvider.unauthorized(apiVersion, correlationId)
.orElse(
apiAuthentication(correlationId,
authContextWithPrefixedSubjects ->
mapAuthorizationContext(
correlationId,
apiVersion,
authContextWithPrefixedSubjects,
authContext ->
parameterOptional(
TopicPath.Channel.LIVE.getName(),
liveParam ->
withDittoHeaders(
authContext,
apiVersion,
correlationId,
ctx,
liveParam.orElse(
null),
CustomHeadersHandler.RequestType.API,
dittoHeaders ->
buildApiSubRoutes(
ctx,
dittoHeaders,
authContext)
)
customApiRoutesProvider.unauthorized(apiVersion, correlationId).orElse(
apiAuthentication(correlationId,
authContextWithPrefixedSubjects ->
mapAuthorizationContext(
correlationId,
apiVersion,
authContextWithPrefixedSubjects,
authContext ->
parameterOptional(TopicPath.Channel.LIVE.getName(),
liveParam ->
withDittoHeaders(
authContext,
apiVersion,
correlationId,
ctx,
liveParam.orElse(null),
CustomHeadersHandler.RequestType.API,
dittoHeaders ->
buildApiSubRoutes(ctx,
dittoHeaders,
authContext)
)
)
)))
)
))
)
);
}
Expand Down

0 comments on commit 51f16ca

Please sign in to comment.