Skip to content

Commit

Permalink
fix: stream.pipe error
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvilla committed Mar 6, 2024
1 parent 1cdcab1 commit d711060
Show file tree
Hide file tree
Showing 17 changed files with 356 additions and 2,450 deletions.
1,381 changes: 121 additions & 1,260 deletions packages/cli/package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
"@aws-sdk/client-sso-oidc": "3.525.0",
"@azure/msal-node": "^1.9.0",
"@babel/plugin-proposal-decorators": "^7.16.5",
"@noovolari/leapp-core": "0.1.163",
"@noovolari/leapp-core": "file:../core",
"@oclif/core": "2.1.4",
"@oclif/plugin-help": "^5.1.12",
"@smithy/node-http-handler": "2.4.1",
"@types/inquirer": "8.2.0",
"@types/node": "20.10.0",
"@types/node-ipc": "9.2.0",
Expand Down Expand Up @@ -145,7 +146,7 @@
"release-npm": "gushio gushio/target-npm-release.js",
"run-plugin": "./bin/run session run-aws-credential-plugin",
"nightly": "gushio gushio/target-nightly.js",
"debug-session-list": "./bin/run session list"
"debug-session-list": "./bin/run session start"
},
"types": "dist/index.d.ts"
}
}
2 changes: 1 addition & 1 deletion packages/cli/scopes/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Display help for leapp.

Display help for leapp.

```console
```
USAGE
$ leapp help [COMMANDS] [-n]
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/scopes/idp-url.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SAML 2.0 Identity providers URL management

Create a new identity provider URL

```console
```
USAGE
$ leapp idp-url create [--idpUrl <value>]
Expand All @@ -32,7 +32,7 @@ EXAMPLES

Delete an identity provider URL

```console
```
USAGE
$ leapp idp-url delete [--idpUrlId <value>] [-f]
Expand All @@ -55,7 +55,7 @@ EXAMPLES

Edit an identity provider URL

```console
```
USAGE
$ leapp idp-url edit [--idpUrlId <value>] [--idpUrl <value>]
Expand All @@ -76,7 +76,7 @@ EXAMPLES

Show identity providers list

```console
```
USAGE
$ leapp idp-url list [--columns <value> | -x] [--sort <value>] [--filter <value>] [--output csv|json|yaml | |
[--csv | --no-truncate]] [--no-header | ]
Expand Down
12 changes: 6 additions & 6 deletions packages/cli/scopes/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Leapp Integrations management

Create a new integration

```console
```
USAGE
$ leapp integration create [--integrationAlias <value>] [--integrationPortalUrl <value>] [--integrationRegion <value>]
[--integrationType AWS-SSO|AZURE] [--integrationTenantId <value>] [--integrationLocation <value>]
Expand Down Expand Up @@ -43,7 +43,7 @@ EXAMPLES

Delete an integration

```console
```
USAGE
$ leapp integration delete [--integrationId <value>]
Expand All @@ -63,7 +63,7 @@ EXAMPLES

Show integrations list

```console
```
USAGE
$ leapp integration list [--columns <value> | -x] [--sort <value>] [--filter <value>] [--output csv|json|yaml | |
[--csv | --no-truncate]] [--no-header | ]
Expand All @@ -90,7 +90,7 @@ EXAMPLES

Login to synchronize integration sessions

```console
```
USAGE
$ leapp integration login [--integrationId <value>]
Expand All @@ -110,7 +110,7 @@ EXAMPLES

Logout from an integration

```console
```
USAGE
$ leapp integration logout [--integrationId <value>]
Expand All @@ -130,7 +130,7 @@ EXAMPLES

Synchronize integration sessions

```console
```
USAGE
$ leapp integration sync [--integrationId <value>]
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/scopes/profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Leapp AWS Multi-profile management

Create a new AWS named profile

```console
```
USAGE
$ leapp profile create [--profileName <value>]
Expand All @@ -32,7 +32,7 @@ EXAMPLES

Delete an AWS named profile

```console
```
USAGE
$ leapp profile delete [--profileId <value>] [-f]
Expand All @@ -55,7 +55,7 @@ EXAMPLES

Rename an AWS named profile

```console
```
USAGE
$ leapp profile edit [--profileId <value>] [--profileName <value>]
Expand All @@ -76,7 +76,7 @@ EXAMPLES

Show profile list

```console
```
USAGE
$ leapp profile list [--columns <value> | -x] [--sort <value>] [--filter <value>] [--output csv|json|yaml | |
[--csv | --no-truncate]] [--no-header | ]
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/scopes/region.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Leapp regions management

Displays the default region

```console
```
USAGE
$ leapp region get-default
Expand All @@ -25,7 +25,7 @@ EXAMPLES

Change the default region

```console
```
USAGE
$ leapp region set-default [--region <value>]
Expand Down
26 changes: 13 additions & 13 deletions packages/cli/scopes/session.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Sessions management

Add a new session

```console
```
USAGE
$ leapp session add [--providerType aws] [--accessKey <value>] [--idpArn <value>] [--idpUrl <value>]
[--mfaDevice <value>] [--sessionName <value>] [--parentSessionId <value>] [--profileId <value>] [--region <value>]
Expand Down Expand Up @@ -66,7 +66,7 @@ EXAMPLES

Change a session named-profile

```console
```
USAGE
$ leapp session change-profile [--sessionId <value>] [--profileId <value>]
Expand All @@ -87,7 +87,7 @@ EXAMPLES

Change a session region

```console
```
USAGE
$ leapp session change-region [--sessionId <value>] [--region <value>]
Expand All @@ -108,7 +108,7 @@ EXAMPLES

Provides info about the current active session for a selected profile (if no profile is provided, it uses the profile default)

```console
```
USAGE
$ leapp session current [-i] [-p <value>] [-r aws|azure] [-f <value>]
Expand All @@ -133,7 +133,7 @@ EXAMPLES

Delete a session

```console
```
USAGE
$ leapp session delete [--sessionId <value>] [-f]
Expand All @@ -156,7 +156,7 @@ EXAMPLES

Generate STS temporary credentials for the given AWS session id

```console
```
USAGE
$ leapp session generate SESSIONID
Expand All @@ -174,7 +174,7 @@ EXAMPLES

Get session id

```console
```
USAGE
$ leapp session get-id
Expand All @@ -189,7 +189,7 @@ EXAMPLES

Show sessions list with all properties; filter query is case sensitive

```console
```
USAGE
$ leapp session list [--columns <value> | -x] [--sort <value>] [--filter <value>] [--output csv|json|yaml | |
[--csv | --no-truncate]] [--no-header | ]
Expand Down Expand Up @@ -228,7 +228,7 @@ EXAMPLES

Open an AWS Web Console

```console
```
USAGE
$ leapp session open-web-console [--sessionId <value>] [-p]
Expand All @@ -249,7 +249,7 @@ EXAMPLES

Run a Leapp Plugin

```console
```
USAGE
$ leapp session run-aws-credential-plugin [--sessionId <value>] [--pluginName <value>]
Expand All @@ -270,7 +270,7 @@ EXAMPLES

Start a session

```console
```
USAGE
$ leapp session start [SESSIONNAME] [--sessionId <value>] [--sessionRole <value>] [--noInteractive]
Expand Down Expand Up @@ -302,7 +302,7 @@ EXAMPLES

Start an AWS SSM session

```console
```
USAGE
$ leapp session start-ssm-session [--sessionId <value>] [--region <value>] [--ssmInstanceId <value>]
Expand All @@ -324,7 +324,7 @@ EXAMPLES

Stop a session

```console
```
USAGE
$ leapp session stop [SESSIONNAME] [--sessionId <value>] [--sessionRole <value>] [--noInteractive]
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/scopes/set-workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Set the current Leapp workspace

Set the current Leapp workspace

```console
```
USAGE
$ leapp set-workspace [WORKSPACENAME]
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/scopes/team.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Login to your Team account

Login to your Team account

```console
```
USAGE
$ leapp team login
Expand All @@ -26,7 +26,7 @@ EXAMPLES

Logout from your Team account

```console
```
USAGE
$ leapp team logout
Expand All @@ -41,7 +41,7 @@ EXAMPLES

Get the team login status

```console
```
USAGE
$ leapp team status
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/scopes/version.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Displays the Cli and Core versions

Displays the Cli and Core versions

```console
```
USAGE
$ leapp version
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/scopes/workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Show the current workspace

Show the current workspace

```console
```
USAGE
$ leapp workspace
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/service/cli-provider-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import { WorkspaceConsistencyService } from "@noovolari/leapp-core/services/work
import * as crypto from "crypto";
import { TeamService } from "./team-service";
import { LocalstackSessionService } from "@noovolari/leapp-core/services/session/localstack/localstack-session-service";
import { NodeHttpHandler } from "@smithy/node-http-handler";

/* eslint-disable */
export class CliProviderService {
Expand Down Expand Up @@ -405,7 +406,7 @@ export class CliProviderService {

get awsCoreService(): AwsCoreService {
if (!this.awsCoreServiceInstance) {
this.awsCoreServiceInstance = new AwsCoreService(this.cliNativeService, this.logService);
this.awsCoreServiceInstance = new AwsCoreService(new NodeHttpHandler({ connectionTimeout: constants.timeout }), this.cliNativeService, this.logService);
}
return this.awsCoreServiceInstance;
}
Expand Down
9 changes: 3 additions & 6 deletions packages/core/src/services/aws-core-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { constants } from "../models/constants";
import { Session } from "../models/session";
import { INativeService } from "../interfaces/i-native-service";
import { LogService } from "./log-service";
import { FetchHttpHandler } from "@smithy/fetch-http-handler";
import { HttpHandler } from "@smithy/protocol-http";
//import { Credentials } from "@aws-sdk/client-sts";

// TODO: rename it. This naming is ambiguous.
Expand Down Expand Up @@ -40,7 +40,7 @@ export class AwsCoreService {
["us-west-2", "https://sts.us-west-2.amazonaws.com"],
]);

constructor(private nativeService: INativeService, private logService: LogService) {}
constructor(private httpHandler: HttpHandler, private nativeService: INativeService, private logService: LogService) {}

awsCredentialPath(): string {
return this.nativeService.path.join(this.nativeService.os.homedir(), ".aws", "credentials");
Expand All @@ -60,14 +60,11 @@ export class AwsCoreService {

stsOptions(session: Session, isV3 = false, credentials: any = undefined): any {
let options: any = {};
console.log(credentials);
if (isV3 && credentials) {
options = {
credentials,
maxAttempts: 0,
requestHandler: new FetchHttpHandler({
requestTimeout: constants.timeout,
}),
requestHandler: this.httpHandler,
};
if (session.region) {
options = {
Expand Down
Loading

0 comments on commit d711060

Please sign in to comment.