Skip to content

Commit

Permalink
Removed old APIs (#81)
Browse files Browse the repository at this point in the history
* Removed old APIs

Signed-off-by: nithinkdb <[email protected]>

* Removed old tests

Signed-off-by: nithinkdb <[email protected]>

Signed-off-by: nithinkdb <[email protected]>
  • Loading branch information
nithinkdb authored Oct 25, 2022
1 parent 4186df2 commit 821e7f8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 113 deletions.
59 changes: 0 additions & 59 deletions lib/DBSQLSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
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<Status> {
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<Status> {
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
Expand Down
20 changes: 0 additions & 20 deletions lib/contracts/IDBSQLSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,26 +154,6 @@ export default interface IDBSQLSession {
*/
getCrossReference(request: CrossReferenceRequest): Promise<IOperation>;

/**
* Get delegation token. For kerberos auth only
*
* @param owner
* @param renewer
*/
getDelegationToken(owner: string, renewer: string): Promise<string>;

/**
* Renew delegation token/ For kerberos auth only
* @param token
*/
renewDelegationToken(token: string): Promise<Status>;

/**
* Cancel delegation token. For kerberos auth only
* @param token
*/
cancelDelegationToken(token: string): Promise<Status>;

/**
* closes the session
*/
Expand Down
34 changes: 0 additions & 34 deletions tests/unit/DBSQLSession.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => ({
Expand Down

0 comments on commit 821e7f8

Please sign in to comment.