From f13324134f281f71abb82e0df8ed4b3bc8c3416e Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Wed, 7 Feb 2018 09:39:35 +0000 Subject: [PATCH] Give 'unauthorized' and 'missing' better names --- .../uk/ac/ic/wlgitbridge/server/Oauth2Filter.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/server/Oauth2Filter.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/server/Oauth2Filter.java index f4c2c4d67d..5478d68e43 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/server/Oauth2Filter.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/server/Oauth2Filter.java @@ -78,7 +78,7 @@ public class Oauth2Filter implements Filter { ); return; } catch (MissingRepositoryException e) { - missing(project, e, (HttpServletResponse) servletResponse); + handleMissingRepository(project, e, (HttpServletResponse) servletResponse); } Log.info("[{}] Auth not needed", project); filterChain.doFilter(servletRequest, servletResponse); @@ -133,7 +133,7 @@ public class Oauth2Filter implements Filter { ) ).execute().getAccessToken(); } catch (TokenResponseException e) { - unauthorized(projectName, capturedUsername, e.getStatusCode(), request, response); + handleNeedAuthorization(projectName, capturedUsername, e.getStatusCode(), request, response); return; } final Credential cred = new Credential.Builder( @@ -148,7 +148,7 @@ public class Oauth2Filter implements Filter { servletResponse ); } else { - unauthorized(projectName, capturedUsername, 0, request, response); + handleNeedAuthorization(projectName, capturedUsername, 0, request, response); } } catch (UnsupportedEncodingException e) { throw new Error("Couldn't retrieve authentication", e); @@ -156,14 +156,14 @@ public class Oauth2Filter implements Filter { } } } else { - unauthorized(projectName, capturedUsername, 0, request, response); + handleNeedAuthorization(projectName, capturedUsername, 0, request, response); } } @Override public void destroy() {} - private void unauthorized( + private void handleNeedAuthorization( String projectName, String userName, int statusCode, @@ -203,7 +203,7 @@ public class Oauth2Filter implements Filter { w.close(); } - private void missing( + private void handleMissingRepository( String projectName, MissingRepositoryException e, HttpServletResponse response