@Test public void testGetAuthorizationDetails() { Response response = cut.getAuthorizationDetails(); assertEquals(response.getStatus(), 200); }
@Override public Response getAuthorizationDetails() { return ResponseBuilder.ok(new ResponseContent() { private static final String TRUE = "true"; private final String authEnabled = ApplicationProperties.get(JWALA_AUTHORIZATION, TRUE); public String getAuthorizationEnabled() { return authEnabled; } @SuppressWarnings("unchecked") public Collection<GrantedAuthority> getUserAuthorities() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (authEnabled.equalsIgnoreCase(TRUE) && auth != null) { return (Collection<GrantedAuthority>) auth.getAuthorities(); } return null; } }); }
AdminServiceRestImpl implements AdminServiceRest { @Override public Response getAuthorizationDetails() { return ResponseBuilder.ok(new ResponseContent() { private static final String TRUE = "true"; private final String authEnabled = ApplicationProperties.get(JWALA_AUTHORIZATION, TRUE); public String getAuthorizationEnabled() { return authEnabled; } @SuppressWarnings("unchecked") public Collection<GrantedAuthority> getUserAuthorities() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (authEnabled.equalsIgnoreCase(TRUE) && auth != null) { return (Collection<GrantedAuthority>) auth.getAuthorities(); } return null; } }); } }
AdminServiceRestImpl implements AdminServiceRest { @Override public Response getAuthorizationDetails() { return ResponseBuilder.ok(new ResponseContent() { private static final String TRUE = "true"; private final String authEnabled = ApplicationProperties.get(JWALA_AUTHORIZATION, TRUE); public String getAuthorizationEnabled() { return authEnabled; } @SuppressWarnings("unchecked") public Collection<GrantedAuthority> getUserAuthorities() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (authEnabled.equalsIgnoreCase(TRUE) && auth != null) { return (Collection<GrantedAuthority>) auth.getAuthorities(); } return null; } }); } AdminServiceRestImpl(FilesConfiguration theFilesConfiguration, ResourceService resourceService); }
AdminServiceRestImpl implements AdminServiceRest { @Override public Response getAuthorizationDetails() { return ResponseBuilder.ok(new ResponseContent() { private static final String TRUE = "true"; private final String authEnabled = ApplicationProperties.get(JWALA_AUTHORIZATION, TRUE); public String getAuthorizationEnabled() { return authEnabled; } @SuppressWarnings("unchecked") public Collection<GrantedAuthority> getUserAuthorities() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (authEnabled.equalsIgnoreCase(TRUE) && auth != null) { return (Collection<GrantedAuthority>) auth.getAuthorities(); } return null; } }); } AdminServiceRestImpl(FilesConfiguration theFilesConfiguration, ResourceService resourceService); @Override Response reload(); @Override Response view(); @Override Response encrypt(String cleartext); @Override Response manifest(ServletContext context); @Override Response isJwalaAuthorizationEnabled(); @Override Response getAuthorizationDetails(); }
AdminServiceRestImpl implements AdminServiceRest { @Override public Response getAuthorizationDetails() { return ResponseBuilder.ok(new ResponseContent() { private static final String TRUE = "true"; private final String authEnabled = ApplicationProperties.get(JWALA_AUTHORIZATION, TRUE); public String getAuthorizationEnabled() { return authEnabled; } @SuppressWarnings("unchecked") public Collection<GrantedAuthority> getUserAuthorities() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (authEnabled.equalsIgnoreCase(TRUE) && auth != null) { return (Collection<GrantedAuthority>) auth.getAuthorities(); } return null; } }); } AdminServiceRestImpl(FilesConfiguration theFilesConfiguration, ResourceService resourceService); @Override Response reload(); @Override Response view(); @Override Response encrypt(String cleartext); @Override Response manifest(ServletContext context); @Override Response isJwalaAuthorizationEnabled(); @Override Response getAuthorizationDetails(); static final String JSON_RESPONSE_TRUE; static final String JSON_RESPONSE_FALSE; }