From 78585d999bb176af630584b505ca662379f82a76 Mon Sep 17 00:00:00 2001 From: Johan Brandhorst-Satzkorn Date: Mon, 11 Jul 2022 16:39:20 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20switch=20to=20new=20toke?= =?UTF-8?q?n=20type=20parameter=20(#1082)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Boundary is deprecating the use of the token_type parameter to the Authenticate endpoint, instead replacing it with the new type parameter. See https://github.com/hashicorp/boundary/commit/80b2c9230fa84605d9aaf7c862f780b50690a36e for more context. Co-authored-by: Randall Morey Co-authored-by: Carlos Alcaide Corvo --- addons/auth/addon/authenticators/password.js | 2 +- addons/auth/tests/unit/authenticators/password-test.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/auth/addon/authenticators/password.js b/addons/auth/addon/authenticators/password.js index 3e0eb53e4..0f5da7826 100644 --- a/addons/auth/addon/authenticators/password.js +++ b/addons/auth/addon/authenticators/password.js @@ -57,7 +57,7 @@ export default class PasswordAuthenticator extends BaseAuthenticator { ) { const body = JSON.stringify({ command: 'login', - token_type: requestCookies ? 'cookie' : null, + type: requestCookies ? 'cookie' : null, attributes: { login_name, password }, }); const authEndpointURL = this.buildAuthEndpointURL(options); diff --git a/addons/auth/tests/unit/authenticators/password-test.js b/addons/auth/tests/unit/authenticators/password-test.js index 9799101e7..ac036d9ab 100644 --- a/addons/auth/tests/unit/authenticators/password-test.js +++ b/addons/auth/tests/unit/authenticators/password-test.js @@ -14,7 +14,7 @@ module('Unit | Authenticator | password', function (hooks) { authenticator.buildAuthEndpointURL(), (schema, request) => { const json = JSON.parse(request.requestBody); - assert.ok(json.token_type, 'Requested token cookies by default'); + assert.ok(json.type, 'Requested token cookies by default'); return new Response(200); } ); @@ -30,7 +30,7 @@ module('Unit | Authenticator | password', function (hooks) { authenticator.buildAuthEndpointURL(), (schema, request) => { const json = JSON.parse(request.requestBody); - assert.notOk(json.token_type, 'Did not request tokens cookies'); + assert.notOk(json.type, 'Did not request tokens cookies'); return new Response(200); } ); @@ -48,7 +48,7 @@ module('Unit | Authenticator | password', function (hooks) { const json = JSON.parse(request.requestBody); assert.deepEqual(json, { command: 'login', - token_type: 'cookie', + type: 'cookie', attributes: { login_name: 'foo', password: 'bar',