Skip to content

Commit

Permalink
chore: fixed aws sso logout issue and reduced max tps
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Villa committed Mar 5, 2024
1 parent 5e956bd commit 127fd26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/models/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const constants = {
timeout: 10000,
credentialsDestination: ".aws/credentials",
defaultRegion: "us-east-1",
maxSsoTps: 10, // Transaction per second for AWS SSO endpoint
maxSsoTps: 5, // Transaction per second for AWS SSO endpoint

//Azure
azureMsalCacheFile: ".azure/msal_token_cache.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,14 @@ export class AwsSsoIntegrationService implements IIntegrationService {
// Make a logout request to Sso
const logoutRequest: LogoutRequest = { accessToken: savedAccessToken };

/*try {
await this.ssoPortal.logout(logoutRequest);
} catch (_) {
// logout request has to be handled in reject Promise by design
// Clean clients
this.ssoPortal = null;
// Delete access token and remove sso integration info from workspace
await this.keyChainService.deleteSecret(constants.appName, this.getIntegrationAccessTokenKey(integrationId));
this.repository.unsetAwsSsoIntegrationExpiration(integrationId);
}*/

if (savedAccessToken !== null) {
await this.ssoPortal.logout(logoutRequest);
try {
await this.ssoPortal.logout(logoutRequest);
} catch (error) {
if (!(error.message === "Session token not found or invalid")) {
throw error;
}
}
}

// Clean clients
Expand Down

0 comments on commit 127fd26

Please sign in to comment.