question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SecurityContextBuilder.forPaths Deprecation / Migrating to SecurityContextBuilder.operationSelector

See original GitHub issue

Using: 3.0.0

Question: Does documentation exist for how to use SecurityContextBuilder.operationSelector instead of SecurityContextBuilder.forPaths?

I see that SecurityContextBuilder.forPaths is deprecated since this 3.0.0 version.

But the documentation/examples I’ve found still use SecurityContextBuilder.forPaths so I’m not sure what the expected replacement logic should look like.

For instance

Thanks for any pointers you can provide 😃

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:5

github_iconTop GitHub Comments

9reactions
Runriotercommented, Jun 28, 2021
return SecurityContext.builder()
  .operationSelector(
    oc -> oc.requestMappingPattern().matches("path_regex")
  )
  .build();
5reactions
t0r0Xcommented, May 11, 2021

Another example. Replace:

SecurityContext.builder()
        .forPaths(PathSelectors.any())
[...]

with:

SecurityContext.builder()
        .operationSelector(operationContext -> true)
[...]
Read more comments on GitHub >

github_iconTop Results From Across the Web

SecurityContextBuilder
@Deprecated public SecurityContextBuilder forPaths​(java.util.function.Predicate<java.lang.String> selector). Deprecated. Use operationSelector instead.
Read more >
SecurityContextBuilder.forPaths - Tabnine
Best Java code snippets using springfox.documentation.spi.service.contexts.SecurityContextBuilder.forPaths (Showing top 16 results out of 315).
Read more >
springfox.documentation.spi.service.contexts.SecurityContext
This page shows Java code examples of springfox.documentation.spi.service.contexts.SecurityContext.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found