From 821e7f8ec65b87adb2ae69adf18d3d3b83516788 Mon Sep 17 00:00:00 2001 From: Nithin Krishnamurthi <110488533+nithinkdb@users.noreply.github.com> Date: Tue, 25 Oct 2022 15:12:55 -0700 Subject: [PATCH] Removed old APIs (#81) * Removed old APIs Signed-off-by: nithinkdb * Removed old tests Signed-off-by: nithinkdb Signed-off-by: nithinkdb --- lib/DBSQLSession.ts | 59 --------------------------------- lib/contracts/IDBSQLSession.ts | 20 ----------- tests/unit/DBSQLSession.test.js | 34 ------------------- 3 files changed, 113 deletions(-) diff --git a/lib/DBSQLSession.ts b/lib/DBSQLSession.ts index 13a6c832..6c31f19a 100644 --- a/lib/DBSQLSession.ts +++ b/lib/DBSQLSession.ts @@ -265,65 +265,6 @@ export default class DBSQLSession implements IDBSQLSession { .then((response) => this.createOperation(response)); } - /** - * Get delegation token. For kerberos auth only - * @public - * @param owner - * @param renewer - * @returns Delegation token - */ - getDelegationToken(owner: string, renewer: string): Promise { - return this.driver - .getDelegationToken({ - sessionHandle: this.sessionHandle, - owner, - renewer, - }) - .then((response) => { - this.assertStatus(response.status); - - return response.delegationToken || ''; - }); - } - - /** - * Renew delegation token/ For kerberos auth only - * @public - * @param token - * @returns Operation status - */ - renewDelegationToken(token: string): Promise { - return this.driver - .renewDelegationToken({ - sessionHandle: this.sessionHandle, - delegationToken: token, - }) - .then((response) => { - this.assertStatus(response.status); - - return this.statusFactory.create(response.status); - }); - } - - /** - * Cancel delegation token. For kerberos auth only - * @public - * @param token - * @returns Operation status - */ - cancelDelegationToken(token: string): Promise { - return this.driver - .cancelDelegationToken({ - sessionHandle: this.sessionHandle, - delegationToken: token, - }) - .then((response) => { - this.assertStatus(response.status); - - return this.statusFactory.create(response.status); - }); - } - /** * Closes the session * @public diff --git a/lib/contracts/IDBSQLSession.ts b/lib/contracts/IDBSQLSession.ts index 21a75fa6..4dcdad1c 100644 --- a/lib/contracts/IDBSQLSession.ts +++ b/lib/contracts/IDBSQLSession.ts @@ -154,26 +154,6 @@ export default interface IDBSQLSession { */ getCrossReference(request: CrossReferenceRequest): Promise; - /** - * Get delegation token. For kerberos auth only - * - * @param owner - * @param renewer - */ - getDelegationToken(owner: string, renewer: string): Promise; - - /** - * Renew delegation token/ For kerberos auth only - * @param token - */ - renewDelegationToken(token: string): Promise; - - /** - * Cancel delegation token. For kerberos auth only - * @param token - */ - cancelDelegationToken(token: string): Promise; - /** * closes the session */ diff --git a/tests/unit/DBSQLSession.test.js b/tests/unit/DBSQLSession.test.js index 38c13efe..2bd622c0 100644 --- a/tests/unit/DBSQLSession.test.js +++ b/tests/unit/DBSQLSession.test.js @@ -333,40 +333,6 @@ describe('DBSQLSession', () => { }); }); - describe('getDelegationToken', () => { - it('should return token if available', async () => { - const session = createSession((unused, resp) => ({ - ...resp, - delegationToken: 'token', - })); - - const result = await session.getDelegationToken('owner', 'renewer'); - expect(result).to.be.eq('token'); - }); - - it('should return empty string if token is not available', async () => { - const session = createSession(); - const result = await session.getDelegationToken('owner', 'renewer'); - expect(result).to.be.eq(''); - }); - }); - - describe('renewDelegationToken', () => { - it('should run operation', async () => { - const session = createSession(); - const result = await session.renewDelegationToken('token'); - expect(result).instanceOf(Status); - }); - }); - - describe('cancelDelegationToken', () => { - it('should run operation', async () => { - const session = createSession(); - const result = await session.cancelDelegationToken('token'); - expect(result).instanceOf(Status); - }); - }); - describe('close', () => { it('should run operation', async () => { const session = createSession(() => ({