Update version after client credentials backport
This commit changes the serialization version from V_7_0_0_alpha1 to V_6_5_0 for the create token request and response with a client credentials grant type. The client credentials work has now been backported to 6.x. Relates #33106
This commit is contained in:
parent
3828ec60f5
commit
6daf8115d6
|
@ -186,7 +186,7 @@ public final class CreateTokenRequest extends ActionRequest {
|
|||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
if (out.getVersion().before(Version.V_7_0_0_alpha1) && GrantType.CLIENT_CREDENTIALS.getValue().equals(grantType)) {
|
||||
if (out.getVersion().before(Version.V_6_5_0) && GrantType.CLIENT_CREDENTIALS.getValue().equals(grantType)) {
|
||||
throw new IllegalArgumentException("a request with the client_credentials grant_type cannot be sent to version [" +
|
||||
out.getVersion() + "]");
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public final class CreateTokenResponse extends ActionResponse implements ToXCont
|
|||
out.writeString(tokenString);
|
||||
out.writeTimeValue(expiresIn);
|
||||
out.writeOptionalString(scope);
|
||||
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { // TODO change to V_6_5_0 after backport
|
||||
if (out.getVersion().onOrAfter(Version.V_6_5_0)) {
|
||||
out.writeOptionalString(refreshToken);
|
||||
} else if (out.getVersion().onOrAfter(Version.V_6_2_0)) {
|
||||
if (refreshToken == null) {
|
||||
|
@ -76,7 +76,7 @@ public final class CreateTokenResponse extends ActionResponse implements ToXCont
|
|||
tokenString = in.readString();
|
||||
expiresIn = in.readTimeValue();
|
||||
scope = in.readOptionalString();
|
||||
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { // TODO change to V_6_5_0 after backport
|
||||
if (in.getVersion().onOrAfter(Version.V_6_5_0)) {
|
||||
refreshToken = in.readOptionalString();
|
||||
} else if (in.getVersion().onOrAfter(Version.V_6_2_0)) {
|
||||
refreshToken = in.readString();
|
||||
|
|
Loading…
Reference in New Issue