Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Noovolari/leapp
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/Noovolari/leapp:
  Fixed bug in truster account credentials refresh from plain account
  Update log file name on Windows

# Conflicts:
#	README.md
  • Loading branch information
urz9999 committed Dec 1, 2020
2 parents e75103b + 1295905 commit 5d883d3
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 27 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ By default, Leapp writes logs to the following locations:
- on Windows: %USERPROFILE%\\AppData\\Roaming\\**Leapp**\\logs\\log.log

Logs are structured in the following way:
=======

```
[YYYY-MM-DD HH:mm:ss.mmm] [LEVEL] [rendered/system] [COMPONENT] MESSAGE {Useful Object / Stacktrace Err Object}
Expand Down
2 changes: 1 addition & 1 deletion electron/dist/src/environments/environment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion electron/dist/src/environments/environment.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"name": "Leapp",
"version": "0.3.2",
"version": "0.3.3",
"author": {
"name": "besharp",
"email": "[email protected]"
},
"description": "Straight programmatic access via Single Sign-on to all your AWS accounts and resources.",
"contributors": [
{
"name": "Alessandro Gaggia",
"email": "[email protected]"
"name": "Andrea Cavagna",
"email": "[email protected]"
},
{
"name": "Paolo Diciaula",
"email": "[email protected]"
"name": "Paolo Diciaula",
"email": "[email protected]"
},
{
"name": "Eric Villa",
"email": "[email protected]"
"name": "Alessandro Gaggia",
"email": "[email protected]"
},
{
"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",
Expand Down
3 changes: 2 additions & 1 deletion src/app/services-system/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/app/services/timer-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
14 changes: 3 additions & 11 deletions src/app/strategies/awsStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit 5d883d3

Please sign in to comment.