Skip to content

Commit

Permalink
Fix lint and depcheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sw-joelmut committed Oct 20, 2023
1 parent 9fb5c92 commit 455fa40
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions libraries/botbuilder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
},
"dependencies": {
"@azure/ms-rest-js": "^2.7.0",
"@azure/msal-node": "^1.2.0",
"axios": "^0.25.0",
"botbuilder-core": "4.1.6",
"botbuilder-stdlib": "4.1.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ export interface AuthenticatorResult {
* The date and time of expiration relative to Coordinated Universal Time (UTC).
*/
expiresOn: Date;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,24 @@ export class CertificateAppCredentials extends AppCredentials {
certificatePrivateKey: string,
channelAuthTenant?: string,
oAuthScope?: string,
x5c?: string,
x5c?: string
) {
super(appId, channelAuthTenant, oAuthScope);
this.certificateThumbprint = certificateThumbprint;
this.certificatePrivateKey = certificatePrivateKey;
this.x5c = x5c;
}

/**
* @inheritdoc
*/
async getToken(forceRefresh = false): Promise<string> {
this.credentials ??= new MsalAppCredentials(this.createClientApplication(), this.appId, this.oAuthEndpoint, this.oAuthScope);
*/
async getToken(forceRefresh = false): Promise<string> {
this.credentials ??= new MsalAppCredentials(
this.createClientApplication(),
this.appId,
this.oAuthEndpoint,
this.oAuthScope
);
return this.credentials.getToken(forceRefresh);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export class MicrosoftAppCredentials extends AppCredentials {
constructor(appId: string, public appPassword: string, channelAuthTenant?: string, oAuthScope?: string) {
super(appId, channelAuthTenant, oAuthScope);
}

/**
* @inheritdoc
*/
async getToken(forceRefresh = false): Promise<string> {
*/
async getToken(forceRefresh = false): Promise<string> {
this.credentials ??= new MsalAppCredentials(this.appId, this.appPassword, this.oAuthEndpoint, this.oAuthScope);
return this.credentials.getToken(forceRefresh);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ describe('AppCredentials', function () {

it('should fail to get a token with an appId and no appPassword', async function () {
const tokenGenerator = new MicrosoftAppCredentials(APP_ID);
await assert.rejects(
tokenGenerator.getToken(true),
{ errorCode: "invalid_client_credential" }
);
await assert.rejects(tokenGenerator.getToken(true), { errorCode: 'invalid_client_credential' });
});
});
});

0 comments on commit 455fa40

Please sign in to comment.