JAVA-021 / 中級
Spring Security パス許可ルールの過剰設定(permitAll の乱用)
なぜ問題になるのか?
/** より後のルールが無視され、ワイルドカードの順序ミスで管理 API が公開されます。
修正方法
java
http.authorizeHttpRequests(a -> a
.requestMatchers("/api/public/**").permitAll()
.requestMatchers("/api/admin/**").hasRole("ADMIN")
.anyRequest().authenticated());