@p0security/cli 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/commands/scp.d.ts +1 -1
  2. package/dist/commands/scp.js +5 -4
  3. package/dist/commands/shared/index.d.ts +4 -0
  4. package/dist/commands/shared/index.js +67 -0
  5. package/dist/commands/{shared.d.ts → shared/ssh.d.ts} +6 -22
  6. package/dist/commands/{shared.js → shared/ssh.js} +18 -74
  7. package/dist/commands/ssh.d.ts +1 -1
  8. package/dist/commands/ssh.js +3 -3
  9. package/dist/common/retry.d.ts +9 -0
  10. package/dist/common/retry.js +50 -0
  11. package/dist/drivers/auth.d.ts +1 -1
  12. package/dist/drivers/auth.js +7 -3
  13. package/dist/plugins/aws/config.d.ts +1 -1
  14. package/dist/plugins/aws/idc/index.d.ts +16 -0
  15. package/dist/plugins/aws/idc/index.js +150 -0
  16. package/dist/plugins/aws/ssh.d.ts +3 -3
  17. package/dist/plugins/aws/ssh.js +21 -11
  18. package/dist/plugins/aws/types.d.ts +29 -5
  19. package/dist/plugins/google/ssh.d.ts +5 -3
  20. package/dist/plugins/google/ssh.js +26 -10
  21. package/dist/plugins/google/types.d.ts +11 -3
  22. package/dist/plugins/login.d.ts +3 -0
  23. package/dist/plugins/login.js +10 -0
  24. package/dist/plugins/oidc/login.d.ts +33 -2
  25. package/dist/plugins/oidc/login.js +100 -60
  26. package/dist/plugins/okta/aws.d.ts +1 -1
  27. package/dist/plugins/okta/aws.js +2 -2
  28. package/dist/plugins/okta/login.js +11 -1
  29. package/dist/plugins/ping/login.d.ts +2 -1
  30. package/dist/plugins/ping/login.js +11 -1
  31. package/dist/plugins/ssh/index.d.ts +2 -1
  32. package/dist/plugins/ssh/index.js +14 -5
  33. package/dist/types/aws/oidc.d.ts +36 -0
  34. package/dist/types/aws/oidc.js +12 -0
  35. package/dist/types/oidc.d.ts +21 -0
  36. package/dist/types/request.d.ts +2 -7
  37. package/dist/types/ssh.d.ts +27 -0
  38. package/dist/types/ssh.js +5 -0
  39. package/package.json +1 -1
@@ -0,0 +1,27 @@
1
+ /** Copyright © 2024-present P0 Security
2
+
3
+ This file is part of @p0security/cli
4
+
5
+ @p0security/cli is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.
6
+
7
+ @p0security/cli is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
8
+
9
+ You should have received a copy of the GNU General Public License along with @p0security/cli. If not, see <https://www.gnu.org/licenses/>.
10
+ **/
11
+ import { AwsSsh, AwsSshPermissionSpec, AwsSshRequest } from "../plugins/aws/types";
12
+ import { GcpSsh, GcpSshPermissionSpec, GcpSshRequest } from "../plugins/google/types";
13
+ import { Request } from "./request";
14
+ export declare type CliSshRequest = AwsSsh | GcpSsh;
15
+ export declare type PluginSshRequest = AwsSshPermissionSpec | GcpSshPermissionSpec;
16
+ export declare type CliPermissionSpec<P extends PluginSshRequest, C extends object | undefined> = P & {
17
+ cliLocalData: C;
18
+ };
19
+ export declare const SupportedSshProviders: readonly ["aws", "gcloud"];
20
+ export declare type SupportedSshProvider = (typeof SupportedSshProviders)[number];
21
+ export declare type SshProvider<PR extends PluginSshRequest = PluginSshRequest, O extends object | undefined = undefined, SR extends SshRequest = SshRequest> = {
22
+ requestToSsh: (request: CliPermissionSpec<PR, O>) => SR;
23
+ toCliRequest: (request: Request<PR>, options?: {
24
+ debug?: boolean;
25
+ }) => Promise<Request<CliSshRequest>>;
26
+ };
27
+ export declare type SshRequest = AwsSshRequest | GcpSshRequest;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SupportedSshProviders = void 0;
4
+ // The prefix of installed SSH accounts in P0 is the provider name
5
+ exports.SupportedSshProviders = ["aws", "gcloud"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@p0security/cli",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Execute infra CLI commands with P0 grants",
5
5
  "main": "index.ts",
6
6
  "repository": {