Skip to content

Commit

Permalink
removed /health from regex pattern for DEVOPS_AUTH_SECURED;
Browse files Browse the repository at this point in the history
fixed copy/paste mistake in gateway.conf

Signed-off-by: Stefan Maute <stefan.maute@bosch-si.com>
  • Loading branch information
Stefan Maute committed Jul 27, 2018
1 parent 6899ced commit e7355e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
Expand Up @@ -26,7 +26,7 @@
import akka.http.javadsl.server.directives.SecurityDirectives;

/**
* Custom Akka Http directive performing basic auth for 2 realms, {@value #REALM_DEVOPS}.
* Custom Akka Http directive performing basic auth for {@value #REALM_DEVOPS} realm.
*/
public class DevopsBasicAuthenticationDirective {

Expand Down
Expand Up @@ -116,7 +116,6 @@ public final class RootRoute {
*/
public static final Pattern DEVOPS_AUTH_SECURED = Pattern.compile("(" +
OverallStatusRoute.PATH_STATUS + "|" +
CachingHealthRoute.PATH_HEALTH + "|" +
DevOpsRoute.PATH_DEVOPS + ").*"
);

Expand Down Expand Up @@ -243,16 +242,16 @@ public Route buildRoute() {
extractRequestContext(ctx ->
route(
statsRoute.buildStatsRoute(correlationId), // /stats
cachingHealthRoute.buildHealthRoute(), // /health
api(ctx, correlationId), // /api
ws(correlationId), // /ws
publicHealth(), // /health
pathPrefixTest(PathMatchers.segment(DEVOPS_AUTH_SECURED), segment ->
authenticateDevopsBasic(REALM_DEVOPS,
route(
overallStatusRoute.buildStatusRoute(), // /status
devopsRoute.buildDevopsRoute(ctx) // /devops
)
)
authenticateDevopsBasic(REALM_DEVOPS,
route(
overallStatusRoute.buildStatusRoute(), // /status
devopsRoute.buildDevopsRoute(ctx) // /devops
)
)
)
)
)
Expand Down Expand Up @@ -307,10 +306,6 @@ private Route wsAuthentication(final String correlationId, final Function<Author
return wsAuthenticationDirective.authenticate(correlationId, inner);
}

private Route publicHealth() {
return cachingHealthRoute.buildHealthRoute();
}

/*
* Describes {@code /api} route.
*
Expand Down
2 changes: 1 addition & 1 deletion services/gateway/starter/src/main/resources/gateway.conf
Expand Up @@ -129,7 +129,7 @@ ditto {
forcehttps = ${?FORCE_HTTPS}

enablecors = false
forcehttps = ${?ENABLE_CORS}
enablecors = ${?ENABLE_CORS}

redirect-to-https = false
redirect-to-https = ${?REDIRECT_TO_HTTPS}
Expand Down

0 comments on commit e7355e9

Please sign in to comment.