You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oozie.apache.org by "Jaydeep Vishwakarma (JIRA)" <ji...@apache.org> on 2015/07/05 07:58:04 UTC
[jira] [Commented] (OOZIE-1782) Workflow path not found is thrown
as SC_UNAUTHORIZED
[ https://issues.apache.org/jira/browse/OOZIE-1782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14614138#comment-14614138 ]
Jaydeep Vishwakarma commented on OOZIE-1782:
--------------------------------------------
Seeing almost same code in both methods. Can we extract common method from them?
> Workflow path not found is thrown as SC_UNAUTHORIZED
> ----------------------------------------------------
>
> Key: OOZIE-1782
> URL: https://issues.apache.org/jira/browse/OOZIE-1782
> Project: Oozie
> Issue Type: Bug
> Reporter: Purshotam Shah
> Assignee: Purshotam Shah
> Attachments: OOZIE-1782-V1.patch, OOZIE-1782-V2.patch
>
>
> {code:java}
> AuthorizationService.java
> ....
> Path path = new Path(appPath);
> try {
> if (!fs.exists(path)) {
> incrCounter(INSTR_FAILED_AUTH_COUNTER, 1);
> throw new AuthorizationException(ErrorCode.E0504, appPath);
> }
> BaseJobServlet.java
> ......
> if (wfPath != null) {
> auth.authorizeForApp(user, acl, wfPath, "workflow.xml", conf);
> }
> else if (coordPath != null){
> auth.authorizeForApp(user, acl, coordPath, "coordinator.xml", conf);
> }
> else if (bundlePath != null){
> auth.authorizeForApp(user, acl, bundlePath, "bundle.xml", conf);
> }
> }
> catch (AuthorizationException ex) {
> XLog.getLog(BaseJobServlet.class).info("AuthorizationException ", ex);
> throw new XServletException(HttpServletResponse.SC_UNAUTHORIZED, ex);
> }
> {code}
> Path not found should be a SC_BAD_REQUEST not SC_UNAUTHORIZED.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)