Simplify opaqueToken support
Remove scopes convenience method to alleviate potential confusion with the "scope" attribute. Issue gh-7827 Issue gh-7712
This commit is contained in:
-12
@@ -590,18 +590,6 @@ public class SecurityMockServerConfigurers {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the provided scopes as the authorities in the resulting principal
|
||||
* @param scopes the scopes to use
|
||||
* @return the {@link OpaqueTokenMutator} for further configuration
|
||||
*/
|
||||
public OpaqueTokenMutator scopes(String... scopes) {
|
||||
Assert.notNull(scopes, "scopes cannot be null");
|
||||
this.authorities = () -> getAuthorities(Arrays.asList(scopes));
|
||||
this.principal = this::defaultPrincipal;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the provided principal
|
||||
* @param principal the principal to use
|
||||
|
||||
-12
@@ -1228,18 +1228,6 @@ public final class SecurityMockMvcRequestPostProcessors {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the provided scopes as the authorities in the resulting principal
|
||||
* @param scopes the scopes to use
|
||||
* @return the {@link OpaqueTokenRequestPostProcessor} for further configuration
|
||||
*/
|
||||
public OpaqueTokenRequestPostProcessor scopes(String... scopes) {
|
||||
Assert.notNull(scopes, "scopes cannot be null");
|
||||
this.authorities = () -> getAuthorities(Arrays.asList(scopes));
|
||||
this.principal = this::defaultPrincipal;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the provided principal
|
||||
* @param principal the principal to use
|
||||
|
||||
Reference in New Issue
Block a user