@Test public void testGetSecurityContext() throws Exception { boolean isSecure = false; DefaultSecurityContext securityContext = new DefaultSecurityContext(isSecure); assertNull(securityContext.getUserPrincipal()); assertFalse(securityContext.isUserInRole("1")); assertFalse(securityContext.isSecure()); assertNull(securityContext.getAuthenticationScheme()); }
protected void handle( final HttpServerRequest vertxRequest, final InputStream inputStream ) { URI uri = getAbsoluteURI(vertxRequest); boolean isSecure = "https".equalsIgnoreCase(uri.getScheme()); UriBuilder baseUriBuilder = UriBuilder.fromUri(uri) .replacePath(baseUri.getPath()) .replaceQuery(null); // Create the jersey request final ContainerRequest jerseyRequest = new ContainerRequest( baseUriBuilder.build(), uri, vertxRequest.method(), new DefaultSecurityContext(isSecure), new MapPropertiesDelegate()); handle(vertxRequest, inputStream, jerseyRequest); }
protected void handle( final HttpServerRequest vertxRequest, final InputStream inputStream ) { URI uri = getAbsoluteURI(vertxRequest); boolean isSecure = "https".equalsIgnoreCase(uri.getScheme()); UriBuilder baseUriBuilder = UriBuilder.fromUri(uri) .replacePath(getBaseUri().getPath()) .replaceQuery(null); // Create the jersey request final ContainerRequest jerseyRequest = new ContainerRequest( baseUriBuilder.build(), uri, vertxRequest.method().name(), new DefaultSecurityContext(isSecure), new MapPropertiesDelegate()); handle(vertxRequest, inputStream, jerseyRequest); }
@Test public void testGetSecurityContext_Secure() throws Exception { boolean isSecure = true; DefaultSecurityContext securityContext = new DefaultSecurityContext(isSecure); assertNull(securityContext.getUserPrincipal()); assertFalse(securityContext.isUserInRole("1")); assertTrue(securityContext.isSecure()); assertNull(securityContext.getAuthenticationScheme()); } }
protected void handle( final HttpServerRequest vertxRequest, final InputStream inputStream ) { URI uri = getAbsoluteURI(vertxRequest); boolean isSecure = "https".equalsIgnoreCase(uri.getScheme()); UriBuilder baseUriBuilder = UriBuilder.fromUri(uri) .replacePath(getBaseUri().getPath()) .replaceQuery(null); // Create the jersey request final ContainerRequest jerseyRequest = new ContainerRequest( baseUriBuilder.build(), uri, vertxRequest.method().name(), new DefaultSecurityContext(isSecure), new MapPropertiesDelegate()); handle(vertxRequest, inputStream, jerseyRequest); }