Thanks to visit codestin.com
Credit goes to github.com

Skip to content

OperationContext only finds SecurityContext's by path ignoring methods #2502

@ghost

Description

In version 2.9.0 the method OperationContext#securityContext() only looks at paths using the deprecated SecurityContext#securityForPath method

It should use SecurityContext#securityForOperation which will filter by method type as well then.

This bug causes a null pointer if you define a SecurityContext that uses forHttpMethods

Caused by: java.lang.NullPointerException: null
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:770)
	at com.google.common.collect.FluentIterable.<init>(FluentIterable.java:125)
	at com.google.common.collect.FluentIterable$1.<init>(FluentIterable.java:143)
	at com.google.common.collect.FluentIterable.from(FluentIterable.java:141)
	at springfox.documentation.swagger.readers.operation.OperationAuthReader.apply(OperationAuthReader.java:63)
	at springfox.documentation.spring.web.plugins.DocumentationPluginsManager.operation(DocumentationPluginsManager.java:120)
	at springfox.documentation.spring.web.readers.operation.ApiOperationReader.read(ApiOperationReader.java:73)
	at springfox.documentation.spring.web.scanners.CachingOperationReader$1.load(CachingOperationReader.java:50)
	at springfox.documentation.spring.web.scanners.CachingOperationReader$1.load(CachingOperationReader.java:48)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3628)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2336)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2295)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2208)
	... 25 common frames omitted

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions