- //Cadi code starts
- if (!isAAFFeed) {
- String reason = config.isPublishPermitted(feedid, credentials, ip);
- if (reason != null) {
- eelfLogger.error("NODE0111 Rejecting unauthorized publish attempt to feed " + PathUtil
- .cleanString(feedid) + " fileid " + PathUtil.cleanString(fileid) + FROM + PathUtil
- .cleanString(ip) + " reason " + PathUtil.cleanString(reason));
- resp.sendError(HttpServletResponse.SC_FORBIDDEN, reason);
- eelfLogger.info(EelfMsgs.EXIT);
- return;
- }
- user = config.getAuthUser(feedid, credentials);
- } else {
- String reason = config.isPublishPermitted(feedid, ip);
- if (reason != null) {
- eelfLogger.error("NODE0111 Rejecting unauthorized publish attempt to feed " + PathUtil
- .cleanString(feedid) + " fileid " + PathUtil.cleanString(fileid) + FROM + PathUtil
- .cleanString(ip) + " reason Invalid AAF user- " + PathUtil.cleanString(reason));
- String message = "Invalid AAF user- " + PathUtil.cleanString(reason);
- eelfLogger.debug("NODE0308 Rejecting unauthenticated PUT or DELETE of " + PathUtil
- .cleanString(req.getPathInfo()) + FROM + PathUtil.cleanString(req.getRemoteAddr()));
- resp.sendError(HttpServletResponse.SC_FORBIDDEN, message);
- return;
- }
- if ((req.getUserPrincipal() != null) && (req.getUserPrincipal().getName() != null)) {
- String userName = req.getUserPrincipal().getName();
- String[] attid = userName.split("@");
- user = attid[0];
- } else {
- user = "AAFUser";
- }
+ String reason = config.isPublishPermitted(feedid, credentials, ip);
+ if (reason != null) {
+ eelfLogger.info("NODE0111 Rejecting unauthorized publish attempt to feed " + feedid + " fileid "
+ + fileid + " from " + ip + " reason " + reason);
+ resp.sendError(javax.servlet.http.HttpServletResponse.SC_FORBIDDEN, reason);
+ eelfLogger.info(EelfMsgs.EXIT);
+ return;