42. Spring Security Dependencies春季安全依赖

本附录提供了Spring Security中模块的参考,以及它们在运行的应用程序中运行所需的附加依赖关系。我们不包括仅在构建或测试Spring Security本身时使用的依赖关系。我们也不包括外部依赖所需的可传递依赖。

项目网站上列出了所需的Spring版本,因此下面的Spring依赖项省略了具体的版本。请注意,下面作为“可选”列出的一些依赖项对于Spring应用程序中的其他非安全功能可能仍然是必需的。此外,如果在大多数应用程序中使用,在项目的Maven POM文件中,被列为“可选”的依赖项实际上可能不会被标记为“可选”。它们只是在你不需要它们的意义上是“可选的”,除非你正在使用指定的功能。

当一个模块依赖于另一个Spring Security模块时,它所依赖的模块的非可选依赖项也被认为是必需的,并且没有单独列出。

42.1 spring-security-core弹簧-安全-核心

核心模块必须包含在任何使用Spring Security的项目中。

Table 42.1. Core Dependencie

DependencyVersionDescription

aopalliance

1.0

Required for method security implementation.方法安全实现所需的。

ehcache

1.6.2

Required if the Ehcache-based user cache implementation is used (optional).如果使用基于Ehcache的用户缓存实现,则为必填项(可选)。

spring-aop

 

Method security is based on Spring AOP方法安全性基于Spring AOP

spring-beans

 

Required for Spring configuration弹簧配置需要

spring-expression

 

Required for expression-based method security (optional)基于表达式的方法安全性必需(可选)

spring-jdbc

 

Required if using a database to store user data (optional).如果使用数据库存储用户数据,则为必填项(可选)。 spring-tx

spring-tx

 

Required if using a database to store user data (optional).如果使用数据库存储用户数据,则为必填项(可选)。

aspectjrt

1.6.10

Required if using AspectJ support (optional).如果使用AspectJ支持,则为必填项(可选)。

jsr250-api

1.0

Required if you are using JSR-250 method-security annotations (optional).如果您使用的是JSR-250方法-安全注释,则此选项为必填项(可选)。

42.2 spring-security-remotingspring-security-远程处理

这个模块通常在使用Servlet应用编程接口的网络应用程序中是必需的。

Table 42.2. Remoting Dependencies

DependencyVersionDescription

spring-security-core

   

spring-web

 

Required for clients which use HTTP remoting support.对于使用超文本传输协议远程处理支持的客户端是必需的。

42.3 spring-security-web弹簧-安全-网

这个模块通常在使用Servlet应用编程接口的网络应用程序中是必需的。

Table 42.3. Web Dependencies

DependencyVersionDescription

spring-security-core

   

spring-web

 

Spring web support classes are used extensively.Spring web支持类被广泛使用。

spring-jdbc

 

Required for JDBC-based persistent remember-me token repository (optional).对于基于JDBC的永久记忆令牌库是必需的(可选)。

spring-tx

 

Required by remember-me persistent token repository implementations (optional).“记住我”永久令牌存储库实现需要(可选)。

42.4 spring-security-ldap

仅当您使用LDAP身份验证时,此模块才是必需的。

Table 42.4. LDAP Dependencies

DependencyVersionDescription

spring-security-core

   

spring-ldap-core

1.3.0

LDAP support is based on Spring LDAP.LDAP支持基于春季LDAP。

spring-tx

 

Data exception classes are required.需要数据异常类。

apache-ds [1]

1.5.5

Required if you are using an embedded LDAP server (optional).如果您使用的是嵌入式LDAP服务器,则需要此项(可选)。

shared-ldap

0.9.15

Required if you are using an embedded LDAP server (optional).如果您使用的是嵌入式LDAP服务器,则需要此项(可选)。 ldapsdk

ldapsdk

4.1

Mozilla LdapSDK. Used for decoding LDAP password policy controls if you are using password-policy functionality with Mozilla LdapSDK。如果将密码策略功能与一起使用,则用于解码LDAP密码策略控件

42.5 spring-security-config弹簧-安全-配置

如果您使用的是Spring Security命名空间配置,则此模块是必需的。

Table 42.5. Config Dependencies

DependencyVersionDescription

spring-security-core

   

spring-security-web

 

Required if you are using any web-related namespace configuration (optional).如果您正在使用任何与web相关的命名空间配置,则需要此选项(可选)。

spring-security-ldap

 

Required if you are using the LDAP namespace options (optional).如果您使用的是LDAP命名空间选项,则为必填项(可选)。

spring-security-openid

 

Required if you are using OpenID authentication (optional).如果您使用的是OpenID身份验证,则为必填项(可选)。

aspectjweaver

1.6.10

Required if using the protect-pointcut namespace syntax (optional).如果使用保护切入点命名空间语法,则为必填项(可选)。

42.6 spring-security-acl

The ACL module.

Table 42.6. ACL Dependencies

DependencyVersionDescription

spring-security-core

   

ehcache

1.6.2

Required if the Ehcache-based ACL cache implementation is used (optional if you are using your own implementation).如果使用基于Ehcache的ACL缓存实现,则为必需(如果使用自己的实现,则为可选)。

spring-jdbc

 

Required if you are using the default JDBC-based AclService (optional if you implement your own).如果您使用默认的基于JDBC的AclService,则为必填项(如果您实现自己的AClServiCe,则为可选项)。

spring-tx

 

Required if you are using the default JDBC-based AclService (optional if you implement your own).如果您使用默认的基于JDBC的AclService,则为必填项(如果您实现自己的AClServiCe,则为可选项)。

42.7 spring-security-cas

CAS模块提供了与JA-SIG CAS的集成。

Table 42.7. CAS Dependencies

DependencyVersionDescription

spring-security-core

   

spring-security-web

   

cas-client-core

3.1.12

The JA-SIG CAS Client. This is the basis of the Spring Security integration.

ehcache

1.6.2

Required if you are using the Ehcache-based ticket cache (optional).

Table 42.7. CAS Dependencies

DependencyVersionDescription

spring-security-core

   

spring-security-web

   

cas-client-core

3.1.12

The JA-SIG CAS Client. This is the basis of the Spring Security integration.

ehcache

1.6.2

Required if you are using the Ehcache-based ticket cache (optional).

42.8 spring-security-openid

The OpenID module.

Table 42.8. OpenID Dependencies

DependencyVersionDescription

spring-security-core

   

spring-security-web

   

openid4java-nodeps

0.9.6

Spring Security’s OpenID integration uses OpenID4Java.Spring Security的OpenID集成使用了OpenID4Java。

httpclient

4.1.1

openid4java-nodeps depends on HttpClient 4.openid4java-nodeps依赖于HttpClient 4。

guice

2.0

openid4java-nodeps depends on Guice 2.openid4java-nodeps依赖Guice 2。

42.9 spring-security-taglibs

42.9 spring-security-taglibs

提供了Spring Security的JSP标签实现。

Table 42.9. Taglib Dependencies

DependencyVersionDescription

spring-security-core

   

spring-security-web

   

spring-security-acl

 

Required if you are using the accesscontrollist tag or hasPermission() expressions with ACLs (optional).如果您将accesscontrollist标记或hasPermission()表达式与ACLs一起使用,则需要此选项(可选)。

spring-expression

 

Required if you are using SPEL expressions in your tag access constraints.

Provides Spring Security’s JSP tag implementations.

Table 42.9. Taglib Dependencies

DependencyVersionDescription

spring-security-core

   

spring-security-web

   

spring-security-acl

 

Required if you are using the accesscontrollist tag or hasPermission() expressions with ACLs (optional).如果您将accesscontrollist标记或hasPermission()表达式与ACLs一起使用,则需要此选项(可选)。

spring-expression

 

Required if you are using SPEL expressions in your tag access constraints.如果在标记访问约束中使用SPEL表达式,则需要此选项。

43. Proxy Server Configuration

使用代理服务器时,确保正确配置应用程序非常重要。例如,许多应用程序都有一个负载平衡器,该负载平衡器通过将请求转发到位于https://192.168.1:8080的应用程序服务器来响应对https://example.com/的请求。如果没有正确的配置,应用程序服务器将不会知道负载平衡器的存在,并且会将该请求视为客户端请求了https://192.168.1:8080。

要解决这个问题,您可以使用RFC 7239来指定正在使用负载平衡器。要让应用程序意识到这一点,您需要配置您的应用程序服务器,使其意识到X-Forward头。例如,Tomcat使用远程阀门,Jetty使用转发请求定制器。或者,Spring 4.3+用户可以利用转发头过滤器。

posted @ 2020-08-16 15:43  节日快乐  阅读(252)  评论(0编辑  收藏  举报