forked from apereo/cas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename webapp modules into support modules (apereo#1789)
- Loading branch information
1 parent
1b6cc11
commit 876cc8a
Showing
129 changed files
with
307 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...rver-webapp-actions-aup-ldap/build.gradle → ...ver-support-actions-aup-ldap/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
description = 'Apereo CAS AUP LDAP Support' | ||
dependencies { | ||
compile project(':cas-server-core-webflow') | ||
compile project(':cas-server-webapp-actions') | ||
compile project(':cas-server-webapp-actions-aup-webflow') | ||
compile project(':cas-server-support-actions') | ||
compile project(':cas-server-support-actions-aup-webflow') | ||
compile project(':cas-server-support-ldap-core') | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
cas-server-webapp-actions/build.gradle → cas-server-support-actions/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
158 changes: 79 additions & 79 deletions
158
...s/web/flow/ServiceAuthorizationCheck.java → ...s/web/flow/ServiceAuthorizationCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,79 @@ | ||
package org.apereo.cas.web.flow; | ||
|
||
import org.apereo.cas.authentication.principal.Service; | ||
import org.apereo.cas.services.RegisteredService; | ||
import org.apereo.cas.services.ServicesManager; | ||
import org.apereo.cas.services.UnauthorizedServiceException; | ||
import org.apereo.cas.web.support.WebUtils; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.cloud.context.config.annotation.RefreshScope; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.webflow.action.AbstractAction; | ||
import org.springframework.webflow.execution.Event; | ||
import org.springframework.webflow.execution.RequestContext; | ||
|
||
/** | ||
* Performs a basic check if an authentication request for a provided service is authorized to proceed | ||
* based on the registered services registry configuration (or lack thereof). | ||
* | ||
* @author Dmitriy Kopylenko | ||
* @since 3.5.1 | ||
**/ | ||
@RefreshScope | ||
@Component("serviceAuthorizationCheck") | ||
public class ServiceAuthorizationCheck extends AbstractAction { | ||
|
||
|
||
private ServicesManager servicesManager; | ||
|
||
private transient Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
|
||
/** | ||
* Initialize the component with an instance of the services manager. | ||
* @param servicesManager the service registry instance. | ||
*/ | ||
@Autowired | ||
public ServiceAuthorizationCheck(@Qualifier("servicesManager") | ||
final ServicesManager servicesManager) { | ||
this.servicesManager = servicesManager; | ||
} | ||
|
||
@Override | ||
protected Event doExecute(final RequestContext context) throws Exception { | ||
final Service service = WebUtils.getService(context); | ||
//No service == plain /login request. Return success indicating transition to the login form | ||
if (service == null) { | ||
return success(); | ||
} | ||
|
||
if (this.servicesManager.getAllServices().isEmpty()) { | ||
final String msg = String.format("No service definitions are found in the service manager. " | ||
+ "Service [%s] will not be automatically authorized to request authentication.", service.getId()); | ||
logger.warn(msg); | ||
throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_EMPTY_SVC_MGMR, msg); | ||
} | ||
final RegisteredService registeredService = this.servicesManager.findServiceBy(service); | ||
|
||
if (registeredService == null) { | ||
final String msg = String.format("Service Management: missing service. " | ||
+ "Service [%s] is not found in service registry.", service.getId()); | ||
logger.warn(msg); | ||
throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE, msg); | ||
} | ||
if (!registeredService.getAccessStrategy().isServiceAccessAllowed()) { | ||
final String msg = String.format("Service Management: Unauthorized Service Access. " | ||
+ "Service [%s] is not allowed access via the service registry.", service.getId()); | ||
|
||
logger.warn(msg); | ||
|
||
WebUtils.putUnauthorizedRedirectUrlIntoFlowScope(context, | ||
registeredService.getAccessStrategy().getUnauthorizedRedirectUrl()); | ||
throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE, msg); | ||
} | ||
|
||
return success(); | ||
} | ||
} | ||
package org.apereo.cas.web.flow; | ||
|
||
import org.apereo.cas.authentication.principal.Service; | ||
import org.apereo.cas.services.RegisteredService; | ||
import org.apereo.cas.services.ServicesManager; | ||
import org.apereo.cas.services.UnauthorizedServiceException; | ||
import org.apereo.cas.web.support.WebUtils; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.cloud.context.config.annotation.RefreshScope; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.webflow.action.AbstractAction; | ||
import org.springframework.webflow.execution.Event; | ||
import org.springframework.webflow.execution.RequestContext; | ||
|
||
/** | ||
* Performs a basic check if an authentication request for a provided service is authorized to proceed | ||
* based on the registered services registry configuration (or lack thereof). | ||
* | ||
* @author Dmitriy Kopylenko | ||
* @since 3.5.1 | ||
**/ | ||
@RefreshScope | ||
@Component("serviceAuthorizationCheck") | ||
public class ServiceAuthorizationCheck extends AbstractAction { | ||
|
||
|
||
private ServicesManager servicesManager; | ||
|
||
private transient Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
|
||
/** | ||
* Initialize the component with an instance of the services manager. | ||
* @param servicesManager the service registry instance. | ||
*/ | ||
@Autowired | ||
public ServiceAuthorizationCheck(@Qualifier("servicesManager") | ||
final ServicesManager servicesManager) { | ||
this.servicesManager = servicesManager; | ||
} | ||
|
||
@Override | ||
protected Event doExecute(final RequestContext context) throws Exception { | ||
final Service service = WebUtils.getService(context); | ||
//No service == plain /login request. Return success indicating transition to the login form | ||
if (service == null) { | ||
return success(); | ||
} | ||
|
||
if (this.servicesManager.getAllServices().isEmpty()) { | ||
final String msg = String.format("No service definitions are found in the service manager. " | ||
+ "Service [%s] will not be automatically authorized to request authentication.", service.getId()); | ||
logger.warn(msg); | ||
throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_EMPTY_SVC_MGMR, msg); | ||
} | ||
final RegisteredService registeredService = this.servicesManager.findServiceBy(service); | ||
|
||
if (registeredService == null) { | ||
final String msg = String.format("Service Management: missing service. " | ||
+ "Service [%s] is not found in service registry.", service.getId()); | ||
logger.warn(msg); | ||
throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE, msg); | ||
} | ||
if (!registeredService.getAccessStrategy().isServiceAccessAllowed()) { | ||
final String msg = String.format("Service Management: Unauthorized Service Access. " | ||
+ "Service [%s] is not allowed access via the service registry.", service.getId()); | ||
|
||
logger.warn(msg); | ||
|
||
WebUtils.putUnauthorizedRedirectUrlIntoFlowScope(context, | ||
registeredService.getAccessStrategy().getUnauthorizedRedirectUrl()); | ||
throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE, msg); | ||
} | ||
|
||
return success(); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.