From a7536c591c6735c983773059b25d4077e9af9862 Mon Sep 17 00:00:00 2001 From: Paolo Fulgoni Date: Thu, 19 Nov 2020 22:44:49 +0100 Subject: [PATCH 1/2] Update log file name on Windows --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9920edfcc..137e95553 100644 --- a/README.md +++ b/README.md @@ -54,9 +54,9 @@ To install the compiled version, choose the one for your **OS** and simply **dou By default, Leapp writes logs to the following locations: -- on Linux: ~/.config/{app name}/logs/{process type}.log -- on macOS: ~/Library/Logs/{app name}/{process type}.log -- on Windows: %USERPROFILE%\AppData\Roaming\{app name}\logs\{process type}.log +- on Linux: `~/.config/{app name}/logs/{process type}.log` +- on macOS: `~/Library/Logs/{app name}/{process type}.log` +- on Windows: `%USERPROFILE%\AppData\Roaming\Leapp\log.log` # Tutorials From 129590556d4beb3d8d9197fb6dc1d45ebce68de7 Mon Sep 17 00:00:00 2001 From: Eric Villa Date: Mon, 30 Nov 2020 17:44:46 +0100 Subject: [PATCH 2/2] Fixed bug in truster account credentials refresh from plain account --- electron/dist/src/environments/environment.js | 2 +- .../dist/src/environments/environment.js.map | 2 +- package.json | 22 +++++++++---------- src/app/services-system/app.service.ts | 3 ++- src/app/services/timer-service.ts | 3 +-- src/app/strategies/awsStrategy.ts | 14 +++--------- 6 files changed, 19 insertions(+), 27 deletions(-) diff --git a/electron/dist/src/environments/environment.js b/electron/dist/src/environments/environment.js index 91efbf54e..0aec59cde 100644 --- a/electron/dist/src/environments/environment.js +++ b/electron/dist/src/environments/environment.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); var environment = { appName: 'Leapp', - sessionDuration: 1200, + sessionDuration: 30, sessionTokenDuration: 36000, timeout: 10000, lockFileDestination: '', diff --git a/electron/dist/src/environments/environment.js.map b/electron/dist/src/environments/environment.js.map index 451d11177..1c1ca1595 100644 --- a/electron/dist/src/environments/environment.js.map +++ b/electron/dist/src/environments/environment.js.map @@ -1 +1 @@ -{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../../src/environments/environment.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0EAA0E;AAC1E,gEAAgE;;AAEhE,IAAM,WAAW,GAAG;IAClB,OAAO,EAAE,OAAO;IAChB,eAAe,EAAE,IAAI;IACrB,oBAAoB,EAAE,KAAK;IAC3B,OAAO,EAAE,KAAK;IACd,mBAAmB,EAAE,EAAE;IACvB,cAAc,EAAE,OAAO;IACvB,UAAU,EAAE,KAAK;IACjB,sBAAsB,EAAE,kBAAkB;IAC1C,iBAAiB,EAAE,0BAA0B;IAC7C,YAAY,EAAE,0BAA0B;CACzC,CAAC;AAGO,kCAAW;AADpB,WAAW,CAAC,mBAAmB,GAAG,wBAAwB,CAAC"} \ No newline at end of file +{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../../src/environments/environment.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0EAA0E;AAC1E,gEAAgE;;AAEhE,IAAM,WAAW,GAAG;IAClB,OAAO,EAAE,OAAO;IAChB,eAAe,EAAE,EAAE;IACnB,oBAAoB,EAAE,KAAK;IAC3B,OAAO,EAAE,KAAK;IACd,mBAAmB,EAAE,EAAE;IACvB,cAAc,EAAE,OAAO;IACvB,UAAU,EAAE,KAAK;IACjB,sBAAsB,EAAE,kBAAkB;IAC1C,iBAAiB,EAAE,0BAA0B;IAC7C,YAAY,EAAE,0BAA0B;CACzC,CAAC;AAGO,kCAAW;AADpB,WAAW,CAAC,mBAAmB,GAAG,wBAAwB,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index 958266bd5..2217dfc96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Leapp", - "version": "0.3.2", + "version": "0.3.3", "author": { "name": "besharp", "email": "info@besharp.it" @@ -8,24 +8,24 @@ "description": "Straight programmatic access via Single Sign-on to all your AWS accounts and resources.", "contributors": [ { - "name": "Alessandro Gaggia", - "email": "alex@besharp.it" + "name": "Andrea Cavagna", + "email": "andrea.cavagna@noovolari.com" }, { - "name": "Paolo Diciaula", - "email": "paolo.diciaula@besharp.it" + "name": "Paolo Diciaula", + "email": "paolo.diciaula@besharp.it" }, { - "name": "Eric Villa", - "email": "eric@noovolari.com" + "name": "Alessandro Gaggia", + "email": "alex@besharp.it" }, { - "name": "Andrea Cavagna", - "email": "andrea.cavagna@noovolari.com" + "name": "Nicolò Marchesi", + "email": "nicolo@noovolari.com" }, { - "name": "Nicolò Marchesi", - "email": "nicolo@noovolari.com" + "name": "Eric Villa", + "email": "eric@noovolari.com" } ], "repository": "https://github.com/Noovolari/leapp", diff --git a/src/app/services-system/app.service.ts b/src/app/services-system/app.service.ts index 39c77698c..ce5b76865 100644 --- a/src/app/services-system/app.service.ts +++ b/src/app/services-system/app.service.ts @@ -3,7 +3,7 @@ import {NativeService} from './native-service'; import {FileService} from './file.service'; import {ToastrService} from 'ngx-toastr'; import {ConfirmationDialogComponent} from '../shared/confirmation-dialog/confirmation-dialog.component'; -import {BsModalRef, BsModalService} from 'ngx-bootstrap'; +import {BsModalService} from 'ngx-bootstrap'; import {FormControl, FormGroup} from '@angular/forms'; import {environment} from '../../environments/environment'; import {InputDialogComponent} from '../shared/input-dialog/input-dialog.component'; @@ -335,6 +335,7 @@ export class AppService extends NativeService { * @param callback - the callback for the ok button to launch */ inputDialog(title: string, placeholder: string, message: string, callback: any) { + console.log('inputDialog'); for (let i = 1; i <= this.modalService.getModalsCount(); i++) { this.modalService.hide(i); } diff --git a/src/app/services/timer-service.ts b/src/app/services/timer-service.ts index afb390e77..756eecd0c 100644 --- a/src/app/services/timer-service.ts +++ b/src/app/services/timer-service.ts @@ -19,8 +19,7 @@ export class TimerService extends NativeService { if (this.startTime) { const currentTime = new Date(); const seconds = (currentTime.getTime() - this.startTime.getTime()) / 1000; - const bufferZone = 5; - const timeToRefresh = (seconds > (environment.sessionDuration - bufferZone)); + const timeToRefresh = (seconds > environment.sessionDuration); if (timeToRefresh) { this.processRefreshByTimer.emit(); } diff --git a/src/app/strategies/awsStrategy.ts b/src/app/strategies/awsStrategy.ts index ce07d94ad..c14ece2c5 100644 --- a/src/app/strategies/awsStrategy.ts +++ b/src/app/strategies/awsStrategy.ts @@ -206,8 +206,6 @@ export class AwsStrategy extends RefreshCredentialsStrategy { const secretKey = await this.keychainService.getSecret(environment.appName, this.appService.keychainGenerateSecretString(parentSession.account.accountName, (parentSession.account as AwsPlainAccount).user)); const credentials = {default: {aws_access_key_id: accessKey, aws_secret_access_key: secretKey}}; - this.fileService.iniWriteSync(this.appService.awsCredentialPath(), credentials); - this.proxyService.configureBrowserWindow(this.appService.currentBrowserWindow()); const params = { @@ -268,13 +266,7 @@ export class AwsStrategy extends RefreshCredentialsStrategy { }); }; - this.keychainService.getSecret(environment.appName, this.generateTrusterAccountSessionTokenExpirationString(session)).then(sessionTokenData => { - if (sessionTokenData && this.isSessionTokenStillValid(sessionTokenData)) { - this.applyTrusterAccountSessionToken(workspace, session); - } else { - processData(params); - } - }); + processData(params); } } @@ -304,9 +296,9 @@ export class AwsStrategy extends RefreshCredentialsStrategy { const sts = new AWS.STS(this.appService.stsOptions(session)); const params = { DurationSeconds: environment.sessionTokenDuration }; - this.keychainService.getSecret(environment.appName, this.generateTrusterAccountSessionTokenExpirationString(parentSession)).then(sessionTokenExpirationData => { + this.keychainService.getSecret(environment.appName, this.generateTrusterAccountSessionTokenExpirationString(session)).then(sessionTokenExpirationData => { if (sessionTokenExpirationData && this.isSessionTokenStillValid(sessionTokenExpirationData)) { - this.keychainService.getSecret(environment.appName, this.generateTrusterAccountSessionTokenString(parentSession)).then(sessionTokenData => { + this.keychainService.getSecret(environment.appName, this.generateTrusterAccountSessionTokenString(session)).then(sessionTokenData => { sessionTokenData = JSON.parse(sessionTokenData); processData(sessionTokenData, null); });