Polish gh-628
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020-2021 the original author or authors.
|
||||
* Copyright 2020-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -58,7 +58,8 @@ public final class JwtEncodingContext implements OAuth2TokenContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link JoseHeader.Builder headers}.
|
||||
* Returns the {@link JoseHeader.Builder headers}
|
||||
* allowing the ability to add, replace, or remove.
|
||||
*
|
||||
* @return the {@link JoseHeader.Builder}
|
||||
*/
|
||||
@@ -67,7 +68,8 @@ public final class JwtEncodingContext implements OAuth2TokenContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link JwtClaimsSet.Builder claims}.
|
||||
* Returns the {@link JwtClaimsSet.Builder claims}
|
||||
* allowing the ability to add, replace, or remove.
|
||||
*
|
||||
* @return the {@link JwtClaimsSet.Builder}
|
||||
*/
|
||||
@@ -102,9 +104,11 @@ public final class JwtEncodingContext implements OAuth2TokenContext {
|
||||
* A {@code Consumer} of the {@link JoseHeader.Builder headers}
|
||||
* allowing the ability to add, replace, or remove.
|
||||
*
|
||||
* @deprecated Use {@link #getHeaders()} instead
|
||||
* @param headersConsumer a {@code Consumer} of the {@link JoseHeader.Builder headers}
|
||||
* @return the {@link Builder} for further configuration
|
||||
*/
|
||||
@Deprecated
|
||||
public Builder headers(Consumer<JoseHeader.Builder> headersConsumer) {
|
||||
headersConsumer.accept(get(JoseHeader.Builder.class));
|
||||
return this;
|
||||
@@ -114,9 +118,11 @@ public final class JwtEncodingContext implements OAuth2TokenContext {
|
||||
* A {@code Consumer} of the {@link JwtClaimsSet.Builder claims}
|
||||
* allowing the ability to add, replace, or remove.
|
||||
*
|
||||
* @deprecated Use {@link #getClaims()} instead
|
||||
* @param claimsConsumer a {@code Consumer} of the {@link JwtClaimsSet.Builder claims}
|
||||
* @return the {@link Builder} for further configuration
|
||||
*/
|
||||
@Deprecated
|
||||
public Builder claims(Consumer<JwtClaimsSet.Builder> claimsConsumer) {
|
||||
claimsConsumer.accept(get(JwtClaimsSet.Builder.class));
|
||||
return this;
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.springframework.security.oauth2.server.authorization.token;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.security.oauth2.core.AuthorizationGrantType;
|
||||
@@ -161,8 +160,8 @@ public final class JwtGenerator implements OAuth2TokenGenerator<Jwt> {
|
||||
|
||||
/**
|
||||
* Sets the {@link OAuth2TokenCustomizer} that customizes the
|
||||
* {@link JwtEncodingContext.Builder#headers(Consumer) headers} and/or
|
||||
* {@link JwtEncodingContext.Builder#claims(Consumer) claims} for the generated {@link Jwt}.
|
||||
* {@link JwtEncodingContext#getHeaders() headers} and/or
|
||||
* {@link JwtEncodingContext#getClaims() claims} for the generated {@link Jwt}.
|
||||
*
|
||||
* @param jwtCustomizer the {@link OAuth2TokenCustomizer} that customizes the headers and/or claims for the generated {@code Jwt}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user