小编dav*_*ave的帖子

如何使用spring security为特定端点添加HTTP基本身份验证?

我有一个带Spring Security的Spring Boot应用程序./health要配置新端点,以便可以通过基本HTTP身份验证进行访问.目前的HttpSecurity配置如下:

@Override
protected void configure(HttpSecurity http) throws Exception {

http.requestMatchers()
    .antMatchers(HttpMethod.OPTIONS, "/**")
    .and()
    .csrf()
    .disable()
    .authorizeRequests()
    .anyRequest()
    .permitAll()
    .and()
    .sessionManagement()
    .sessionCreationPolicy(SessionCreationPolicy.STATELESS);
Run Code Online (Sandbox Code Playgroud)

}

如何为基础身份验证添加/health?我想我需要这样的东西,但我不认为这是完全正确的,我真的不明白在哪里添加它:

    .authorizeRequests()
    .antMatchers(
        // Health status
        "/health",
        "/health/"
    )
    .hasRole(HEALTH_CHECK_ROLE)
    .and()
    .httpBasic()
    .realmName(REALM_NAME)
    .authenticationEntryPoint(getBasicAuthEntryPoint())
    .and()
    .sessionManagement()
    .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
Run Code Online (Sandbox Code Playgroud)

我发现这些资源很有用,但还不够:

java security spring http

10
推荐指数
2
解决办法
8819
查看次数

更新 postgis 扩展时,postgresql 在“SUPPORT”处或附近出现“语法错误”

这是 macOS 上的本地设置,自制软件安装了 postgresql (12.1) 和 postgis (3.0.0)。

我在某些 Java 集成测试中遇到此错误:

Caused by: org.postgresql.util.PSQLException: ERROR: could not access file "$libdir/postgis-2.5": No such file or directory
Run Code Online (Sandbox Code Playgroud)

因此尝试更新导致另一个错误的扩展:

# ALTER EXTENSION postgis UPDATE;
ERROR:  syntax error at or near "SUPPORT"
Run Code Online (Sandbox Code Playgroud)

我找不到有关此特定错误消息的任何信息。

postgresql homebrew postgis

2
推荐指数
1
解决办法
1512
查看次数

如何在 Confluence 中获得自动编号的标题?

目前,Confluence 无法自动对文档结构的标题进行编号。我知道有(付费)第三方插件可用。

如何实现连续编号的标题?

javascript wiki confluence

1
推荐指数
1
解决办法
4529
查看次数

标签 统计

confluence ×1

homebrew ×1

http ×1

java ×1

javascript ×1

postgis ×1

postgresql ×1

security ×1

spring ×1

wiki ×1