\r
#### fixes\r
\r
+- Fixed bug where a repository set as authenticated push did not have anonymous clone access (issue 96)\r
- Fixed bug in Basic authentication if passwords had a colon (Github/peterloron)\r
\r
#### changes\r
* Determine if the repository requires authentication.\r
* \r
* @param repository\r
+ * @param action\r
* @return true if authentication required\r
*/\r
- protected abstract boolean requiresAuthentication(RepositoryModel repository);\r
+ protected abstract boolean requiresAuthentication(RepositoryModel repository, String action);\r
\r
/**\r
* Determine if the user can access the repository and perform the specified\r
}\r
\r
// BASIC authentication challenge and response processing\r
- if (!StringUtils.isEmpty(urlRequestType) && requiresAuthentication(model)) {\r
+ if (!StringUtils.isEmpty(urlRequestType) && requiresAuthentication(model, urlRequestType)) {\r
if (user == null) {\r
// challenge client to provide credentials. send 401.\r
if (GitBlit.isDebugMode()) {\r
* Determine if the repository requires authentication.\r
* \r
* @param repository\r
+ * @param action\r
* @return true if authentication required\r
*/\r
@Override\r
- protected boolean requiresAuthentication(RepositoryModel repository) {\r
+ protected boolean requiresAuthentication(RepositoryModel repository, String action) {\r
return repository.accessRestriction.atLeast(AccessRestrictionType.VIEW);\r
}\r
\r
* Determine if the repository requires authentication.\r
* \r
* @param repository\r
+ * @param action\r
* @return true if authentication required\r
*/\r
@Override\r
- protected boolean requiresAuthentication(RepositoryModel repository) {\r
- return repository.accessRestriction.atLeast(AccessRestrictionType.PUSH);\r
+ protected boolean requiresAuthentication(RepositoryModel repository, String action) {\r
+ if (gitUploadPack.equals(action)) {\r
+ // send to client\r
+ return repository.accessRestriction.atLeast(AccessRestrictionType.CLONE); \r
+ } else if (gitReceivePack.equals(action)) {\r
+ // receive from client\r
+ return repository.accessRestriction.atLeast(AccessRestrictionType.PUSH);\r
+ }\r
+ return false;\r
}\r
\r
/**\r
* Determine if the repository requires authentication.\r
* \r
* @param repository\r
+ * @param action\r
* @return true if authentication required\r
*/\r
@Override\r
- protected boolean requiresAuthentication(RepositoryModel repository) {\r
+ protected boolean requiresAuthentication(RepositoryModel repository, String action) {\r
return repository.accessRestriction.atLeast(AccessRestrictionType.VIEW);\r
}\r
\r
* Determine if the repository requires authentication.\r
* \r
* @param repository\r
+ * @param action\r
* @return true if authentication required\r
*/\r
@Override\r
- protected boolean requiresAuthentication(RepositoryModel repository) {\r
+ protected boolean requiresAuthentication(RepositoryModel repository, String action) {\r
return repository.accessRestriction.atLeast(AccessRestrictionType.VIEW);\r
}\r
\r