diff options
Diffstat (limited to 'src/main')
3 files changed, 20 insertions, 20 deletions
diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/AAFAuthenticationFilter.java b/src/main/java/org/onap/dmaap/dbcapi/resources/AAFAuthenticationFilter.java index c5c29fa..1c3a504 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/resources/AAFAuthenticationFilter.java +++ b/src/main/java/org/onap/dmaap/dbcapi/resources/AAFAuthenticationFilter.java @@ -42,16 +42,16 @@ public class AAFAuthenticationFilter implements Filter { private static final Logger LOGGER = Logger.getLogger(AAFAuthenticationFilter.class.getName()); static final String CADI_PROPERTIES = "cadi.properties"; - static final String AAF_AUTHN_FLAG = "UseAAF"; + static final String CADI_AUTHN_FLAG = "enableCADI"; - private boolean isAafEnabled; + private boolean isCadiEnabled; private CadiFilter cadiFilter; @Override public void init(FilterConfig filterConfig) throws ServletException { DmaapConfig dmaapConfig = getConfig(); - String flag = dmaapConfig.getProperty(AAF_AUTHN_FLAG, "false"); - isAafEnabled = "true".equalsIgnoreCase(flag); + String flag = dmaapConfig.getProperty(CADI_AUTHN_FLAG, "false"); + isCadiEnabled = "true".equalsIgnoreCase(flag); initCadi(dmaapConfig); } @@ -60,7 +60,7 @@ public class AAFAuthenticationFilter implements Filter { public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { - if(isAafEnabled) { + if(isCadiEnabled) { cadiFilter.doFilter(servletRequest, servletResponse, filterChain); updateResponseBody((HttpServletResponse)servletResponse); } else { @@ -96,7 +96,7 @@ public class AAFAuthenticationFilter implements Filter { } private void initCadi(DmaapConfig dmaapConfig) throws ServletException { - if(isAafEnabled) { + if(isCadiEnabled) { try { String cadiPropertiesFile = dmaapConfig.getProperty(CADI_PROPERTIES); if(cadiPropertiesFile != null && !cadiPropertiesFile.isEmpty()) { @@ -136,7 +136,7 @@ public class AAFAuthenticationFilter implements Filter { this.cadiFilter = cadiFilter; } - boolean isAafEnabled() { - return isAafEnabled; + boolean isCadiEnabled() { + return isCadiEnabled; } } diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/AAFAuthorizationFilter.java b/src/main/java/org/onap/dmaap/dbcapi/resources/AAFAuthorizationFilter.java index 5bc3dec..602de85 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/resources/AAFAuthorizationFilter.java +++ b/src/main/java/org/onap/dmaap/dbcapi/resources/AAFAuthorizationFilter.java @@ -40,16 +40,16 @@ import org.onap.dmaap.dbcapi.util.PermissionBuilder; public class AAFAuthorizationFilter implements Filter{ private static final Logger LOGGER = Logger.getLogger(AAFAuthenticationFilter.class.getName()); - static final String AAF_AUTHZ_FLAG = "UseAAF"; - private boolean isAafEnabled = false; + static final String CADI_AUTHZ_FLAG = "enableCADI"; + private boolean isCadiEnabled = false; private PermissionBuilder permissionBuilder; @Override public void init(FilterConfig filterConfig) throws ServletException { DmaapConfig dmaapConfig = getConfig(); - isAafEnabled = "true".equalsIgnoreCase(dmaapConfig.getProperty(AAF_AUTHZ_FLAG, "false")); - if(isAafEnabled) { + isCadiEnabled = "true".equalsIgnoreCase(dmaapConfig.getProperty(CADI_AUTHZ_FLAG, "false")); + if(isCadiEnabled) { permissionBuilder = new PermissionBuilder(dmaapConfig, getDmaapService()); } } @@ -58,7 +58,7 @@ public class AAFAuthorizationFilter implements Filter{ public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { - if(isAafEnabled) { + if(isCadiEnabled) { HttpServletRequest httpRequest = (HttpServletRequest) servletRequest; permissionBuilder.updateDmaapInstance(); String permission = permissionBuilder.buildPermission(httpRequest); @@ -110,7 +110,7 @@ public class AAFAuthorizationFilter implements Filter{ this.permissionBuilder = permissionBuilder; } - void setAafEnabled(boolean aafEnabled) { - isAafEnabled = aafEnabled; + void setCadiEnabled(boolean cadiEnabled) { + isCadiEnabled = cadiEnabled; } } diff --git a/src/main/java/org/onap/dmaap/dbcapi/resources/AuthorizationFilter.java b/src/main/java/org/onap/dmaap/dbcapi/resources/AuthorizationFilter.java index 3ed5717..64aeea7 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/resources/AuthorizationFilter.java +++ b/src/main/java/org/onap/dmaap/dbcapi/resources/AuthorizationFilter.java @@ -32,22 +32,22 @@ import org.onap.dmaap.dbcapi.util.DmaapConfig; @Authorization public class AuthorizationFilter implements ContainerRequestFilter { - private static final String AAF_FLAG = "UseAAF"; + private static final String AAF_CADI_FLAG = "enableCADI"; private final Logger logger = Logger.getLogger(AuthorizationFilter.class.getName()); private final ResponseBuilder responseBuilder = new ResponseBuilder(); - private final boolean isAafEnabled; + private final boolean isCadiEnabled; public AuthorizationFilter() { DmaapConfig dmaapConfig = (DmaapConfig) DmaapConfig.getConfig(); - String flag = dmaapConfig.getProperty(AAF_FLAG, "false"); - isAafEnabled = "true".equalsIgnoreCase(flag); + String flag = dmaapConfig.getProperty(AAF_CADI_FLAG, "false"); + isCadiEnabled = "true".equalsIgnoreCase(flag); } @Override public void filter(ContainerRequestContext requestContext) { - if(!isAafEnabled) { + if(!isCadiEnabled) { ApiService apiResp = new ApiService() .setAuth(requestContext.getHeaderString("Authorization")) .setUriPath(requestContext.getUriInfo().getPath()) |