fix: 投稿のスコープの設定を修正

This commit is contained in:
usbharu 2023-11-29 16:24:54 +09:00
parent 0b63f95c17
commit 8746258104
1 changed files with 5 additions and 2 deletions

View File

@ -182,7 +182,8 @@ class SecurityConfig {
builder.pattern("/api/v1/instance/**"),
builder.pattern("/.well-known/**"),
builder.pattern("/error"),
builder.pattern("/nodeinfo/2.0")
builder.pattern("/nodeinfo/2.0"),
builder.pattern("/api/v1/accounts")
).permitAll()
it.requestMatchers(
builder.pattern("/auth/**")
@ -192,7 +193,9 @@ class SecurityConfig {
.hasAnyAuthority("SCOPE_read", "SCOPE_read:accounts")
it.requestMatchers(builder.pattern(HttpMethod.POST, "/api/v1/media"))
.hasAnyAuthority("SCOPE_write", "SCOPE_write:media")
it.anyRequest().permitAll()
it.requestMatchers(builder.pattern(HttpMethod.POST, "/api/v1/statuses"))
.hasAnyAuthority("SCOPE_write", "SCOPE_write:statuses")
it.anyRequest().authenticated()
}
http.oauth2ResourceServer {
it.jwt(Customizer.withDefaults())