-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/maven/fixes/9.0' into maven/rele…
…ase/9.0
- Loading branch information
Showing
5 changed files
with
92 additions
and
13 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
...end/services/core/src/main/java/org/edu_sharing/repository/server/GlobalHeaderFilter.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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package org.edu_sharing.repository.server; | ||
|
||
import jakarta.servlet.*; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
import net.sf.acegisecurity.AuthenticationCredentialsNotFoundException; | ||
import org.alfresco.repo.security.authentication.AuthenticationComponent; | ||
import org.alfresco.repo.security.authentication.AuthenticationUtil; | ||
import org.alfresco.service.ServiceRegistry; | ||
import org.alfresco.service.cmr.security.AuthenticationService; | ||
import org.apache.log4j.Logger; | ||
import org.edu_sharing.alfresco.authentication.HttpContext; | ||
import org.edu_sharing.alfresco.authentication.subsystems.SubsystemChainingAuthenticationService; | ||
import org.edu_sharing.alfresco.lightbend.LightbendConfigLoader; | ||
import org.edu_sharing.alfresco.policy.NodeCustomizationPolicies; | ||
import org.edu_sharing.alfresco.repository.server.authentication.Context; | ||
import org.edu_sharing.alfresco.service.config.model.AvailableMds; | ||
import org.edu_sharing.alfresco.workspace_administration.NodeServiceInterceptor; | ||
import org.edu_sharing.alfrescocontext.gate.AlfAppContextGate; | ||
import org.edu_sharing.metadataset.v2.QueryUtils; | ||
import org.edu_sharing.repository.TrackingApplicationInfo; | ||
import org.edu_sharing.repository.client.tools.CCConstants; | ||
import org.edu_sharing.repository.server.tools.ApplicationInfoList; | ||
import org.edu_sharing.repository.server.tools.security.SignatureVerifier; | ||
import org.edu_sharing.restservices.NodeDao; | ||
import org.edu_sharing.restservices.RepositoryDao; | ||
import org.edu_sharing.service.authentication.SSOAuthorityMapper; | ||
import org.edu_sharing.service.authentication.ScopeAuthenticationServiceFactory; | ||
import org.edu_sharing.service.authority.AuthorityServiceFactory; | ||
import org.edu_sharing.service.config.ConfigServiceFactory; | ||
import org.edu_sharing.service.usage.Usage; | ||
import org.edu_sharing.service.usage.Usage2Exception; | ||
import org.edu_sharing.service.usage.Usage2Service; | ||
import org.edu_sharing.webservices.util.AuthenticationUtils; | ||
import org.springframework.context.ApplicationContext; | ||
|
||
import java.io.IOException; | ||
import java.io.Serializable; | ||
import java.util.Map; | ||
|
||
|
||
/** | ||
* Filter to add possible headers that should be included in every request | ||
*/ | ||
public class GlobalHeaderFilter implements Filter { | ||
@Override | ||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { | ||
if (LightbendConfigLoader.get().hasPath("security.headers")) { | ||
for (Map.Entry<String, Object> entry : LightbendConfigLoader.get().getObject("security.headers").unwrapped().entrySet()) { | ||
if (entry.getValue() != null) { | ||
((HttpServletResponse) res).addHeader(entry.getKey(), entry.getValue().toString()); | ||
} | ||
} | ||
} | ||
chain.doFilter(req, res); | ||
} | ||
|
||
} |
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
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