az2aws 1.0.0 → 1.0.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.
- package/CONTRIBUTING.md +201 -14
- package/README.md +48 -74
- package/lib/login.js +8 -0
- package/package.json +34 -8
- package/vitest.config.ts +15 -0
- package/.claude/settings.local.json +0 -16
package/CONTRIBUTING.md
CHANGED
|
@@ -1,54 +1,241 @@
|
|
|
1
|
-
# Contributing
|
|
1
|
+
# Contributing to az2aws
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Thank you for your interest in contributing to az2aws! This document provides guidelines and instructions for contributing.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Table of Contents
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- [Code of Conduct](#code-of-conduct)
|
|
8
|
+
- [Getting Started](#getting-started)
|
|
9
|
+
- [Development Workflow](#development-workflow)
|
|
10
|
+
- [Pull Request Process](#pull-request-process)
|
|
11
|
+
- [Coding Standards](#coding-standards)
|
|
12
|
+
- [Commit Message Guidelines](#commit-message-guidelines)
|
|
13
|
+
- [Reporting Issues](#reporting-issues)
|
|
14
|
+
|
|
15
|
+
## Code of Conduct
|
|
16
|
+
|
|
17
|
+
Please be respectful and constructive in all interactions. We are committed to providing a welcoming and inclusive environment for everyone.
|
|
18
|
+
|
|
19
|
+
## Getting Started
|
|
20
|
+
|
|
21
|
+
This project is written in TypeScript and uses Prettier and ESLint for code formatting. You need Node.js v24 or higher.
|
|
22
|
+
|
|
23
|
+
### Prerequisites
|
|
24
|
+
|
|
25
|
+
1. Install [mise](https://mise.jdx.dev/) (runtime version manager):
|
|
8
26
|
|
|
9
27
|
```sh
|
|
10
|
-
|
|
28
|
+
curl https://mise.run | sh
|
|
11
29
|
```
|
|
12
30
|
|
|
13
|
-
2.
|
|
31
|
+
2. Activate mise in your shell. Add the following to your shell configuration file:
|
|
14
32
|
|
|
15
33
|
```sh
|
|
16
|
-
|
|
34
|
+
echo 'eval "$(~/.local/bin/mise activate zsh)"' >> ~/.zshrc
|
|
17
35
|
```
|
|
18
36
|
|
|
19
|
-
|
|
37
|
+
Then restart your shell or run `source ~/.zshrc` (or the appropriate config file for your shell, such as `~/.bashrc`).
|
|
38
|
+
|
|
39
|
+
3. Install Node.js v24:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
mise use --global node@24
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
4. Verify Node.js version (should return v24.x.x):
|
|
20
46
|
|
|
21
47
|
```sh
|
|
22
48
|
node -v
|
|
23
49
|
```
|
|
24
50
|
|
|
25
|
-
|
|
51
|
+
5. Install yarn:
|
|
26
52
|
|
|
27
53
|
```sh
|
|
28
54
|
npm install -g yarn
|
|
29
55
|
```
|
|
30
56
|
|
|
31
|
-
|
|
57
|
+
### Setup
|
|
58
|
+
|
|
59
|
+
1. Fork and clone the repository:
|
|
32
60
|
|
|
33
61
|
```sh
|
|
34
|
-
git clone git@github.com:<
|
|
62
|
+
git clone git@github.com:<YOUR_GITHUB_USERNAME>/az2aws.git
|
|
35
63
|
cd az2aws
|
|
36
64
|
```
|
|
37
65
|
|
|
38
|
-
|
|
66
|
+
2. Install dependencies:
|
|
39
67
|
|
|
40
68
|
```sh
|
|
41
69
|
yarn install
|
|
42
70
|
```
|
|
43
71
|
|
|
44
|
-
|
|
72
|
+
3. Start development mode:
|
|
45
73
|
|
|
46
74
|
```sh
|
|
47
75
|
yarn start
|
|
48
76
|
```
|
|
49
77
|
|
|
50
|
-
|
|
78
|
+
Or build and run production mode:
|
|
51
79
|
|
|
52
80
|
```sh
|
|
53
81
|
yarn build && node ./lib/index.js
|
|
54
82
|
```
|
|
83
|
+
|
|
84
|
+
### Available Scripts
|
|
85
|
+
|
|
86
|
+
| Script | Description |
|
|
87
|
+
|--------|-------------|
|
|
88
|
+
| `yarn start` | Start development mode with hot reload |
|
|
89
|
+
| `yarn build` | Build for production |
|
|
90
|
+
| `yarn test` | Run linting and formatting checks |
|
|
91
|
+
| `yarn test:unit` | Run unit tests |
|
|
92
|
+
| `yarn eslint` | Run ESLint |
|
|
93
|
+
| `yarn prettier:check` | Check code formatting |
|
|
94
|
+
| `yarn prettier:write` | Auto-fix code formatting |
|
|
95
|
+
|
|
96
|
+
## Development Workflow
|
|
97
|
+
|
|
98
|
+
1. Create a new branch from `main`:
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
git switch -c feature/your-feature-name
|
|
102
|
+
# or
|
|
103
|
+
git checkout -b fix/your-bug-fix
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
2. Make your changes and ensure tests pass:
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
yarn test
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
3. Commit your changes following our [commit message guidelines](#commit-message-guidelines).
|
|
113
|
+
|
|
114
|
+
4. Push your branch and create a Pull Request.
|
|
115
|
+
|
|
116
|
+
## Pull Request Process
|
|
117
|
+
|
|
118
|
+
### Before Submitting
|
|
119
|
+
|
|
120
|
+
- [ ] Run `yarn test` and ensure all checks pass
|
|
121
|
+
- [ ] Run `yarn build` to verify the build succeeds
|
|
122
|
+
- [ ] Update documentation if you changed any user-facing behavior
|
|
123
|
+
- [ ] Add tests for new functionality
|
|
124
|
+
|
|
125
|
+
### PR Title Format
|
|
126
|
+
|
|
127
|
+
Use a descriptive title that summarizes the change:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
feat: add support for credential_process
|
|
131
|
+
fix: resolve proxy configuration conflict
|
|
132
|
+
docs: update installation instructions
|
|
133
|
+
chore: update dependencies
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### PR Description
|
|
137
|
+
|
|
138
|
+
Please include:
|
|
139
|
+
|
|
140
|
+
1. **Summary**: What does this PR do?
|
|
141
|
+
2. **Motivation**: Why is this change needed?
|
|
142
|
+
3. **Testing**: How did you test this change?
|
|
143
|
+
4. **Related Issues**: Link any related issues (e.g., `Closes #123`)
|
|
144
|
+
|
|
145
|
+
### Review Process
|
|
146
|
+
|
|
147
|
+
1. A maintainer will review your PR
|
|
148
|
+
2. Address any feedback or requested changes
|
|
149
|
+
3. Once approved, a maintainer will merge your PR
|
|
150
|
+
|
|
151
|
+
## Coding Standards
|
|
152
|
+
|
|
153
|
+
### TypeScript
|
|
154
|
+
|
|
155
|
+
- Use TypeScript for all new code
|
|
156
|
+
- Avoid `any` type when possible; use proper typing
|
|
157
|
+
- Use `interface` for object types
|
|
158
|
+
- Export types that are used across modules
|
|
159
|
+
|
|
160
|
+
### Code Style
|
|
161
|
+
|
|
162
|
+
This project uses ESLint and Prettier. Your code will be automatically checked.
|
|
163
|
+
|
|
164
|
+
```sh
|
|
165
|
+
# Check formatting
|
|
166
|
+
yarn prettier:check
|
|
167
|
+
|
|
168
|
+
# Auto-fix formatting
|
|
169
|
+
yarn prettier:write
|
|
170
|
+
|
|
171
|
+
# Run linter
|
|
172
|
+
yarn eslint
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### File Organization
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
src/
|
|
179
|
+
├── index.ts # CLI entry point
|
|
180
|
+
├── login.ts # Core login logic
|
|
181
|
+
├── awsConfig.ts # AWS configuration handling
|
|
182
|
+
├── configureProfileAsync.ts # Profile configuration
|
|
183
|
+
├── paths.ts # Path utilities
|
|
184
|
+
└── CLIError.ts # Custom error class
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Best Practices
|
|
188
|
+
|
|
189
|
+
- Keep functions small and focused
|
|
190
|
+
- Add debug logging for troubleshooting: `debug("message")`
|
|
191
|
+
- Handle errors gracefully with meaningful error messages
|
|
192
|
+
- Avoid breaking changes to CLI options
|
|
193
|
+
|
|
194
|
+
## Commit Message Guidelines
|
|
195
|
+
|
|
196
|
+
Commit messages should be generated using some LLM model.
|
|
197
|
+
|
|
198
|
+
## Reporting Issues
|
|
199
|
+
|
|
200
|
+
### Bug Reports
|
|
201
|
+
|
|
202
|
+
When reporting a bug, please include:
|
|
203
|
+
|
|
204
|
+
1. **Environment**:
|
|
205
|
+
- OS and version
|
|
206
|
+
- Node.js version (`node -v`)
|
|
207
|
+
- az2aws version (`az2aws --version`)
|
|
208
|
+
|
|
209
|
+
2. **Steps to Reproduce**: Clear steps to reproduce the issue
|
|
210
|
+
|
|
211
|
+
3. **Expected Behavior**: What you expected to happen
|
|
212
|
+
|
|
213
|
+
4. **Actual Behavior**: What actually happened
|
|
214
|
+
|
|
215
|
+
5. **Debug Output**: Run with debug enabled and include the output:
|
|
216
|
+
```sh
|
|
217
|
+
DEBUG=az2aws az2aws [your options]
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**Security note**: Debug logs may contain sensitive information (for example, SAML assertions such as SAMLResponse, SAML XML, role details, or other credentials/tokens). Do not share unredacted debug output in public issues or forums. If you attach logs to a bug report, carefully review and redact any secrets or identifiers before posting.
|
|
221
|
+
|
|
222
|
+
### Feature Requests
|
|
223
|
+
|
|
224
|
+
When requesting a feature, please include:
|
|
225
|
+
|
|
226
|
+
1. **Use Case**: Why do you need this feature?
|
|
227
|
+
2. **Proposed Solution**: How do you think it should work?
|
|
228
|
+
3. **Alternatives Considered**: Other approaches you've thought about
|
|
229
|
+
|
|
230
|
+
### Good First Issues
|
|
231
|
+
|
|
232
|
+
Look for issues labeled `good first issue` if you're new to the project. These are typically smaller, well-defined tasks that are good for getting started.
|
|
233
|
+
|
|
234
|
+
## Questions?
|
|
235
|
+
|
|
236
|
+
If you have questions, feel free to:
|
|
237
|
+
|
|
238
|
+
- Open a [GitHub Discussion](https://github.com/kuma0128/az2aws/discussions)
|
|
239
|
+
- Open an issue with the `question` label
|
|
240
|
+
|
|
241
|
+
Thank you for contributing!
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
[](https://www.npmjs.org/package/az2aws)
|
|
2
2
|
[](https://www.npmjs.org/package/az2aws)
|
|
3
|
+
[](https://github.com/kuma0128/az2aws/actions/workflows/main.yml)
|
|
4
|
+
[](https://codecov.io/gh/kuma0128/az2aws)
|
|
3
5
|
|
|
4
6
|
# az2aws
|
|
5
7
|
|
|
@@ -11,7 +13,7 @@ Installation can be done in any of the following platform - Windows, Linux, Dock
|
|
|
11
13
|
|
|
12
14
|
### Windows
|
|
13
15
|
|
|
14
|
-
Install [Node.js](https://nodejs.org/)
|
|
16
|
+
Install [Node.js](https://nodejs.org/) v24 or higher. Then install az2aws with npm:
|
|
15
17
|
|
|
16
18
|
npm install -g az2aws
|
|
17
19
|
|
|
@@ -21,7 +23,7 @@ You may need to install puppeteer dependency, if you're getting missing chrome o
|
|
|
21
23
|
|
|
22
24
|
### Linux
|
|
23
25
|
|
|
24
|
-
In Linux you can either install for all users or just the current user. In either case, you must first install [Node.js](https://nodejs.org/)
|
|
26
|
+
In Linux you can either install for all users or just the current user. In either case, you must first install [Node.js](https://nodejs.org/) v24 or higher and any [puppeteer dependencies](https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#chrome-headless-doesnt-launch). Then follow the appropriate instructions.
|
|
25
27
|
|
|
26
28
|
#### Option A: Install for All Users
|
|
27
29
|
|
|
@@ -76,6 +78,23 @@ Now just run `az2aws`.
|
|
|
76
78
|
|
|
77
79
|
https://snapcraft.io/az2aws
|
|
78
80
|
|
|
81
|
+
## Command Options
|
|
82
|
+
|
|
83
|
+
| Option | Description |
|
|
84
|
+
|--------|-------------|
|
|
85
|
+
| `--profile (-p)` | Profile name to use. Default: `default` or `AWS_PROFILE` |
|
|
86
|
+
| `--all-profiles (-a)` | Run for all configured profiles |
|
|
87
|
+
| `--force-refresh (-f)` | Force refresh even if credentials are valid |
|
|
88
|
+
| `--configure (-c)` | Configure the profile |
|
|
89
|
+
| `--mode (-m) <mode>` | `cli` (default), `gui`, or `debug` |
|
|
90
|
+
| `--no-sandbox` | Disable Puppeteer sandbox (needed on Linux) |
|
|
91
|
+
| `--no-prompt` | Skip prompts, use defaults |
|
|
92
|
+
| `--enable-chrome-network-service` | Enable Network Service (for 3XX redirects) |
|
|
93
|
+
| `--no-verify-ssl` | Disable AWS SSL verification |
|
|
94
|
+
| `--enable-chrome-seamless-sso` | Enable Azure AD Seamless SSO |
|
|
95
|
+
| `--no-disable-extensions` | Keep browser extensions enabled |
|
|
96
|
+
| `--disable-gpu` | Disable GPU acceleration |
|
|
97
|
+
|
|
79
98
|
## Usage
|
|
80
99
|
|
|
81
100
|
### Configuration
|
|
@@ -103,43 +122,25 @@ To use az2aws with AWS China Cloud, set the `region` profile property in your ~/
|
|
|
103
122
|
|
|
104
123
|
- cn-north-1
|
|
105
124
|
|
|
106
|
-
####
|
|
107
|
-
|
|
108
|
-
During the configuration you can decide to stay logged in:
|
|
125
|
+
#### Stay Logged In
|
|
109
126
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
If you set this configuration to true, the usual authentication with username/password/MFA is skipped as it's using session cookies to remember your identity. This enables you to use `--no-prompt` without the need to store your password anywhere, it's an alternative for using environment variables as described below.
|
|
113
|
-
As soon as you went through the full login procedure once, you can just use:
|
|
127
|
+
During configuration, you can enable "Stay logged in" to skip username/password/MFA on subsequent logins. Session cookies will remember your identity, allowing you to use `--no-prompt` without storing passwords:
|
|
114
128
|
|
|
115
129
|
az2aws --no-prompt
|
|
116
|
-
|
|
117
|
-
or
|
|
118
|
-
|
|
119
130
|
az2aws --profile foo --no-prompt
|
|
120
131
|
|
|
121
|
-
to refresh your aws credentials.
|
|
122
|
-
|
|
123
132
|
#### Environment Variables
|
|
124
133
|
|
|
125
|
-
You can
|
|
134
|
+
You can set defaults via environment variables (use with `--no-prompt`):
|
|
126
135
|
|
|
127
|
-
- `AZURE_TENANT_ID`
|
|
128
|
-
- `
|
|
129
|
-
- `
|
|
130
|
-
- `AZURE_DEFAULT_PASSWORD`
|
|
131
|
-
- `AZURE_DEFAULT_ROLE_ARN`
|
|
132
|
-
- `AZURE_DEFAULT_DURATION_HOURS`
|
|
136
|
+
- `AZURE_TENANT_ID` / `AZURE_APP_ID_URI` - Azure AD settings
|
|
137
|
+
- `AZURE_DEFAULT_USERNAME` / `AZURE_DEFAULT_PASSWORD` - Credentials
|
|
138
|
+
- `AZURE_DEFAULT_ROLE_ARN` / `AZURE_DEFAULT_DURATION_HOURS` - AWS role settings
|
|
133
139
|
|
|
134
|
-
To avoid
|
|
140
|
+
To avoid storing passwords in bash history, use a leading space:
|
|
135
141
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
Use the `HISTCONTROL` environment variable to avoid storing the password in your bash history (notice the space at the beginning):
|
|
139
|
-
|
|
140
|
-
$ HISTCONTROL=ignoreboth
|
|
141
|
-
$ export AZURE_DEFAULT_PASSWORD=mypassword
|
|
142
|
-
$ az2aws
|
|
142
|
+
HISTCONTROL=ignoreboth
|
|
143
|
+
export AZURE_DEFAULT_PASSWORD=mypassword
|
|
143
144
|
|
|
144
145
|
#### Use an Existing Chrome Install and Profile
|
|
145
146
|
|
|
@@ -154,63 +155,39 @@ Example (macOS):
|
|
|
154
155
|
export BROWSER_CHROME_BIN="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
|
|
155
156
|
export BROWSER_USER_DATA_DIR="/Users/<user>/Library/Application Support/Google/Chrome"
|
|
156
157
|
export BROWSER_PROFILE_DIR="Default"
|
|
157
|
-
|
|
158
|
+
az2aws --mode gui --no-disable-extensions --no-sandbox
|
|
158
159
|
|
|
159
160
|
Example (Linux):
|
|
160
161
|
|
|
161
162
|
export BROWSER_CHROME_BIN="/usr/bin/google-chrome"
|
|
162
163
|
export BROWSER_USER_DATA_DIR="/home/<user>/.config/google-chrome"
|
|
163
164
|
export BROWSER_PROFILE_DIR="Default"
|
|
164
|
-
|
|
165
|
+
az2aws --mode gui --no-disable-extensions --no-sandbox
|
|
165
166
|
|
|
166
167
|
Using Chrome instead of Chromium allows you to use browser extensions such as password managers.
|
|
167
168
|
|
|
168
169
|
### Logging In
|
|
169
170
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
az2aws
|
|
173
|
-
|
|
174
|
-
You will be prompted for your username and password. If MFA is required you'll also be prompted for a verification code or mobile device approval. To log in with a named profile:
|
|
175
|
-
|
|
176
|
-
az2aws --profile foo
|
|
177
|
-
|
|
178
|
-
Alternatively, you can set the `AWS_PROFILE` environmental variable to the name of the profile just like the AWS CLI.
|
|
171
|
+
az2aws # Default profile
|
|
172
|
+
az2aws --profile foo # Named profile
|
|
173
|
+
az2aws --mode gui # Use browser UI (more reliable)
|
|
179
174
|
|
|
180
|
-
|
|
175
|
+
You'll be prompted for username, password, and MFA if required. After login, use AWS CLI/SDKs as usual.
|
|
181
176
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
_Note:_ on virtual machines, or when rendering of the puppeteer UI fails, you might need to disable the GPU Hardware Acceleration:
|
|
189
|
-
|
|
190
|
-
az2aws --mode gui --disable-gpu
|
|
191
|
-
|
|
192
|
-
_Note:_ on Linux you will likely need to disable the Puppeteer sandbox or Chrome will fail to launch:
|
|
193
|
-
|
|
194
|
-
az2aws --no-sandbox
|
|
195
|
-
|
|
196
|
-
### Behind corporate proxy
|
|
197
|
-
|
|
198
|
-
If behind corporate proxy, then just set https_proxy env variable.
|
|
177
|
+
**Tips:**
|
|
178
|
+
- Set `AWS_PROFILE` env var instead of using `--profile`
|
|
179
|
+
- Use `--mode gui --disable-gpu` on VMs or if rendering fails
|
|
180
|
+
- Use `--no-sandbox` on Linux
|
|
181
|
+
- Set `https_proxy` env var for corporate proxy
|
|
199
182
|
|
|
200
183
|
## Automation
|
|
201
184
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
You can renew credentials for all configured profiles in one run. This is especially useful, if the maximum session length on AWS side is configured to a low value due to security constraints. Just run:
|
|
185
|
+
Renew all profiles at once (useful for short session limits):
|
|
205
186
|
|
|
206
187
|
az2aws --all-profiles
|
|
188
|
+
az2aws --all-profiles --no-prompt # With "Stay logged in" enabled
|
|
207
189
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
az2aws --all-profiles --no-prompt
|
|
211
|
-
|
|
212
|
-
This will allow you to automate the credentials refresh procedure, eg. by running a cronjob every 5 minutes.
|
|
213
|
-
To skip unnecessary calls, the credentials are only getting refreshed if the time to expire is lower than 11 minutes.
|
|
190
|
+
Credentials are only refreshed if expiring within 11 minutes - safe to run as a cron job.
|
|
214
191
|
|
|
215
192
|
## Getting Your Tenant ID and App ID URI
|
|
216
193
|
|
|
@@ -232,14 +209,11 @@ The Azure login page uses JavaScript, which requires a real web browser. To auto
|
|
|
232
209
|
|
|
233
210
|
## Troubleshooting
|
|
234
211
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
DEBUG=az2aws az2aws
|
|
238
|
-
|
|
239
|
-
On Windows:
|
|
212
|
+
If login fails, try these in order:
|
|
240
213
|
|
|
241
|
-
|
|
242
|
-
|
|
214
|
+
1. **GUI mode**: `az2aws --mode gui` - most reliable
|
|
215
|
+
2. **Debug mode**: `az2aws --mode debug` - see browser while CLI runs
|
|
216
|
+
3. **Verbose logging**: `DEBUG=az2aws az2aws` (Windows: `set DEBUG=az2aws && az2aws`)
|
|
243
217
|
|
|
244
218
|
## Support for Other Authentication Providers
|
|
245
219
|
|
package/lib/login.js
CHANGED
|
@@ -236,6 +236,11 @@ const states = [
|
|
|
236
236
|
(description) => { var _a; return (_a = description === null || description === void 0 ? void 0 : description.textContent) !== null && _a !== void 0 ? _a : ""; }, selected);
|
|
237
237
|
console.log(descriptionMessage);
|
|
238
238
|
try {
|
|
239
|
+
debug("Waiting for authentication code to be displayed");
|
|
240
|
+
await page.waitForSelector("#idRichContext_DisplaySign", {
|
|
241
|
+
visible: true,
|
|
242
|
+
timeout: 5000,
|
|
243
|
+
});
|
|
239
244
|
debug("Checking if authentication code is displayed");
|
|
240
245
|
const authenticationCodeElement = await page.$("#idRichContext_DisplaySign");
|
|
241
246
|
debug("Reading the authentication code");
|
|
@@ -788,6 +793,9 @@ exports.login = {
|
|
|
788
793
|
};
|
|
789
794
|
}
|
|
790
795
|
if (awsNoVerifySsl) {
|
|
796
|
+
console.warn("WARNING: SSL certificate verification is disabled. " +
|
|
797
|
+
"This makes the connection vulnerable to MITM attacks. " +
|
|
798
|
+
"Consider using NODE_EXTRA_CA_CERTS environment variable instead.");
|
|
791
799
|
stsOptions = {
|
|
792
800
|
...stsOptions,
|
|
793
801
|
requestHandler: new node_http_handler_1.NodeHttpHandler({
|
package/package.json
CHANGED
|
@@ -1,20 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "az2aws",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Use Azure AD SSO to log into the AWS CLI.",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Use Azure AD SSO to log into the AWS CLI. A modern, actively maintained alternative to aws-azure-login.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "az2aws devs",
|
|
8
8
|
"url": "https://github.com/az2aws"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"aws",
|
|
13
|
+
"azure",
|
|
14
|
+
"azure-ad",
|
|
15
|
+
"entra-id",
|
|
16
|
+
"microsoft-entra",
|
|
17
|
+
"saml",
|
|
18
|
+
"sso",
|
|
19
|
+
"single-sign-on",
|
|
20
|
+
"cli",
|
|
21
|
+
"authentication",
|
|
22
|
+
"mfa",
|
|
23
|
+
"multi-factor-authentication",
|
|
24
|
+
"federated-login",
|
|
25
|
+
"aws-cli",
|
|
26
|
+
"credential-helper",
|
|
27
|
+
"sts",
|
|
28
|
+
"assume-role",
|
|
29
|
+
"puppeteer"
|
|
30
|
+
],
|
|
31
|
+
"homepage": "https://github.com/kuma0128/az2aws#readme",
|
|
11
32
|
"repository": {
|
|
12
33
|
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/
|
|
34
|
+
"url": "git+https://github.com/kuma0128/az2aws.git"
|
|
14
35
|
},
|
|
15
|
-
"bugs": "https://github.com/
|
|
36
|
+
"bugs": "https://github.com/kuma0128/az2aws/issues",
|
|
16
37
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
38
|
+
"node": ">=24.0"
|
|
18
39
|
},
|
|
19
40
|
"bin": {
|
|
20
41
|
"az2aws": "lib/index.js"
|
|
@@ -26,7 +47,10 @@
|
|
|
26
47
|
"eslint": "eslint . --ext .ts",
|
|
27
48
|
"prettier:write": "prettier --write \"src/**/*.{ts,json}\"",
|
|
28
49
|
"prettier:check": "prettier --check \"src/**/*.ts\"",
|
|
29
|
-
"test": "
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"test:watch": "vitest",
|
|
52
|
+
"test:coverage": "vitest run --coverage",
|
|
53
|
+
"lint": "yarn eslint && yarn prettier:check"
|
|
30
54
|
},
|
|
31
55
|
"dependencies": {
|
|
32
56
|
"@aws-sdk/client-sts": "^3.473.0",
|
|
@@ -51,14 +75,16 @@
|
|
|
51
75
|
"@types/inquirer": "^8.2.10",
|
|
52
76
|
"@types/lodash": "^4.17.0",
|
|
53
77
|
"@types/mkdirp": "^1.0.2",
|
|
54
|
-
"@types/node": "^
|
|
78
|
+
"@types/node": "^24.0.0",
|
|
55
79
|
"@types/uuid": "^8.3.4",
|
|
56
80
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
57
81
|
"@typescript-eslint/parser": "^6.21.0",
|
|
82
|
+
"@vitest/coverage-v8": "^4.0.16",
|
|
58
83
|
"eslint": "^8.57.0",
|
|
59
84
|
"eslint-config-prettier": "^8.10.0",
|
|
60
85
|
"prettier": "^2.8.8",
|
|
61
86
|
"ts-node-dev": "^1.1.8",
|
|
62
|
-
"typescript": "^5.4.3"
|
|
87
|
+
"typescript": "^5.4.3",
|
|
88
|
+
"vitest": "^4.0.16"
|
|
63
89
|
}
|
|
64
90
|
}
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from "vitest/config";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
globals: true,
|
|
6
|
+
environment: "node",
|
|
7
|
+
include: ["src/**/*.test.ts"],
|
|
8
|
+
coverage: {
|
|
9
|
+
provider: "v8",
|
|
10
|
+
reporter: ["text", "json", "html", "lcov"],
|
|
11
|
+
include: ["src/**/*.ts"],
|
|
12
|
+
exclude: ["src/**/*.test.ts", "src/index.ts"],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(yarn test)",
|
|
5
|
-
"Bash(npm run test)",
|
|
6
|
-
"Bash(npm run build:*)",
|
|
7
|
-
"Bash(npm install)",
|
|
8
|
-
"Bash(npm cache clean:*)",
|
|
9
|
-
"Bash(npm install:*)",
|
|
10
|
-
"Bash(yarn install)",
|
|
11
|
-
"WebFetch(domain:github.com)",
|
|
12
|
-
"WebFetch(domain:patch-diff.githubusercontent.com)",
|
|
13
|
-
"Bash(ls:*)"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|