@metaplay/metaplay-auth 1.4.2 → 1.6.0
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/.prettierignore +2 -0
- package/CHANGELOG.md +69 -28
- package/dist/index.cjs +292 -0
- package/dist/sshcrypto-OMBCGRSN.node +0 -0
- package/eslint.config.js +3 -0
- package/index.ts +763 -437
- package/package.json +22 -21
- package/prettier.config.js +3 -0
- package/src/auth.ts +121 -80
- package/src/buildCommand.ts +267 -0
- package/src/config.ts +12 -0
- package/src/deployment.ts +285 -52
- package/src/logging.ts +4 -4
- package/src/secret_store.ts +10 -7
- package/src/stackapi.ts +5 -381
- package/src/targetenvironment.ts +311 -0
- package/src/utils.ts +162 -31
- package/src/version.ts +1 -0
- package/dist/index.js +0 -644
- package/dist/index.js.map +0 -1
- package/dist/src/auth.js +0 -373
- package/dist/src/auth.js.map +0 -1
- package/dist/src/deployment.js +0 -250
- package/dist/src/deployment.js.map +0 -1
- package/dist/src/logging.js +0 -18
- package/dist/src/logging.js.map +0 -1
- package/dist/src/secret_store.js +0 -79
- package/dist/src/secret_store.js.map +0 -1
- package/dist/src/stackapi.js +0 -302
- package/dist/src/stackapi.js.map +0 -1
- package/dist/src/utils.js +0 -62
- package/dist/src/utils.js.map +0 -1
- package/dist/tests/utils.spec.js +0 -18
- package/dist/tests/utils.spec.js.map +0 -1
- package/tests/utils.spec.ts +0 -20
- package/vitest.config.ts +0 -7
package/.prettierignore
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,119 +1,160 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.6.0] - 2024-09-06
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- New command `build-image` for building the docker image locally. It wraps the raw docker build command while giving more helpful error messages about incorrect paths and other issues.
|
|
8
|
+
- The `deploy-server` now supports specifying a semver range for the Helm chart version, e.g., `--helm-chart-version=^0.6.4`. We strongly recommend pinning the Helm chart version exactly to avoid surprises!
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- The generated `kubeconfig`s now bake in the stable humanId of the target environment to skip the lookup from the portal when used.
|
|
13
|
+
- Resolve the target environment information from the portal to better support changing slugs of organizations, projects, and environments.
|
|
14
|
+
- Add warning about not specifying the Helm chart version explicitly. The docker image label -based versions are deprecated and will eventually be removed.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Fix `kubectl` potential hang when interrupted using Ctrl-C as it was invoking `metaplay-auth` to query the Kubernetes access credentials.
|
|
19
|
+
- Improve the error reporting during deployment when a server pod ends up in the `Unschedulable` state for any reason.
|
|
20
|
+
|
|
21
|
+
## [1.5.0] - 2024-07-29
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- New command `debug-server` allows attaching an ephemeral debug container to a running game server pod. Note: requires `kubectl` to be installed on your machine.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- The published npm package is now bundled to significantly speed up the invocation of the tool.
|
|
30
|
+
- In generated kubeconfig, use `npx @metaplay/metaplay-auth@latest` to launch the credential helper (instead of assuming globally installed `metaplay-auth`) when the `kubeconfig` was generated with `npx @metaplay/metaplay-auth get-kubeconfig`. Thus, the `metaplay-auth` does not need to be installed on the machine.
|
|
31
|
+
- Specifying the target environment as FQDN (eg, idler-develop.p1.metaplay.io) no longer supports `--stack-api`. Use the form `<organization>-<project>-<environment>` instead.
|
|
32
|
+
- The `--organization`, `--project`, `--environment` options are deprecated and will be removed in a future version. Use the `<organization>-<project>-<environment>` syntax instead!
|
|
33
|
+
- The output of `get-environment` is now printed as an indented multi-line object to make it easier to read.
|
|
34
|
+
- The output of `show-tokens` is now printed as a valid JSON object to make it more easily consumed by other tools.
|
|
35
|
+
- The `get-docker-login` is deprecated and will be removed in a later version. You should use the `push-docker-image` instead which handles the login automatically.
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- Support overriding StackAPI base url with `--stack-api` in the commands `push-docker-image` and `check-server-status`.
|
|
40
|
+
- The generated `kubeconfig` now remembers the `--stack-api` override, if specified when generating a `kubeconfig` for an environment.
|
|
41
|
+
- The `get-kubeconfig` argument `--type <credentials-type>` is now properly respected.
|
|
42
|
+
- The `deploy-server` server status check now checks that the image tag is the expected one, to avoid mistaking ready pods from the previous deployment as the current deployment's pods.
|
|
43
|
+
|
|
3
44
|
## [1.4.2] - 2024-04-24
|
|
4
45
|
|
|
5
46
|
### Added
|
|
6
47
|
|
|
7
|
-
|
|
48
|
+
- Support deploying docker images directly from the target environment's registry in `deploy-server`.
|
|
8
49
|
|
|
9
50
|
## [1.4.1] - 2024-04-24
|
|
10
51
|
|
|
11
52
|
### Added
|
|
12
53
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
54
|
+
- New command `deploy-server` which deploys a given docker image to the target environment, including support for auto-detecting default Helm chart repository and version from the built image's labels.
|
|
55
|
+
- New command `push-docker-image` which pushes the built docker image into the target environment's image repository.
|
|
56
|
+
- New command `check-server-status [gameserver]` which replaces the old `check-deployment [namespace]`
|
|
57
|
+
- Allow writing the kubeconfig from `get-kubeconfig` command directly into a file with `metaplay-auth get-kubeconfig --output /path/to/kubeconfig`.
|
|
17
58
|
|
|
18
59
|
### Changed
|
|
19
60
|
|
|
20
|
-
|
|
21
|
-
|
|
61
|
+
- The `get-kubeconfig` command now defaults to generating a dynamic `kubeconfig` for human users. This means that the credentials are resolved on each time the `kubeconfig` is used. Thus, the `kubeconfig` stays valid as long as the `metaplay-auth` session is valid. Machine users still default to a static `kubeconfig` with the secret embedded.
|
|
62
|
+
- The `check-deployment` command is now considered deprecated. Use the `check-server-status [gameserver]` instead.
|
|
22
63
|
|
|
23
64
|
### Fixed
|
|
24
65
|
|
|
25
|
-
|
|
66
|
+
- Many improvements to the game server status check logic: support multi-pod deployments, fix multiple bugs, make progress reporting less noisy and improve error messages.
|
|
26
67
|
|
|
27
68
|
## [1.3.0] - 2024-04-18
|
|
28
69
|
|
|
29
70
|
### Added
|
|
30
71
|
|
|
31
|
-
|
|
32
|
-
|
|
72
|
+
- Introduce new option `-t dynamic` for `metaplay-auth get-kubeconfig` that generates a `kubeconfig` which invokes the `metaplay-auth` itself to get the credentials. This way, the `kubeconfig` is longer-lived and no longer contains the sensitive access token.
|
|
73
|
+
- Support specifying target environment/gameserver address using the format '\<organization\>-\<project\>-\<environment\>', e.g., `metaplay-auth get-environment metaplay-idler-develop`.
|
|
33
74
|
|
|
34
75
|
### Changed
|
|
35
76
|
|
|
36
|
-
|
|
77
|
+
- The `kubeconfig` files generated default to the environment's namespace so it doesn't need to be specified manually. The cluster, user, and context names were changed to be more meaningful.
|
|
37
78
|
|
|
38
79
|
## [1.2.1] - 2024-04-05
|
|
39
80
|
|
|
40
81
|
### Changed
|
|
41
82
|
|
|
42
|
-
|
|
83
|
+
- `Upgraded @kubernetes/client-node dependency to 1.0.0-rc4. This removes transitive dependencies on various deprecated libraries.
|
|
43
84
|
|
|
44
85
|
## [1.2.0] - 2024-03-20
|
|
45
86
|
|
|
46
87
|
### Added
|
|
47
88
|
|
|
48
|
-
|
|
89
|
+
- Introduce `get-docker-login` command that allows simpler CI flows. It outputs `DOCKER_REPO`, `DOCKER_USERNAME` and `DOCKER_PASSWORD` env variables that can be used to login with docker.
|
|
49
90
|
|
|
50
91
|
## [1.1.7] - 2024-03-15
|
|
51
92
|
|
|
52
93
|
### Added
|
|
53
94
|
|
|
54
|
-
|
|
95
|
+
- The `machine-login` command now works with machine user credentials in the `METAPLAY_CREDENTIALS` environment variable. You can get the credentials from the developer portal.
|
|
55
96
|
|
|
56
97
|
### Changed
|
|
57
98
|
|
|
58
|
-
|
|
59
|
-
|
|
99
|
+
- The `show-tokens` command is changed back to print more human-friendly output and the `--format` flag is removed.
|
|
100
|
+
- Improve `check-deployment` error checking and clean up logging.
|
|
60
101
|
|
|
61
102
|
## [1.1.6] - 2024-03-12
|
|
62
103
|
|
|
63
104
|
### Added
|
|
64
105
|
|
|
65
|
-
|
|
66
|
-
|
|
106
|
+
- Added experimental `check-deployment` command for checking the status of a game server after deploying it.
|
|
107
|
+
- Added experimental `machine-login` command to login using machine credentials.
|
|
67
108
|
|
|
68
109
|
### Changed
|
|
69
110
|
|
|
70
|
-
|
|
111
|
+
- The `show-tokens` now outputs the values by default in JSON, you can use `metaplay-auth show-tokens -f pretty` to get the old formatting.
|
|
71
112
|
|
|
72
113
|
## [1.1.5] - 2024-02-26
|
|
73
114
|
|
|
74
115
|
### Changed
|
|
75
116
|
|
|
76
|
-
|
|
77
|
-
|
|
117
|
+
- Switched from express to H3 for a local web server.
|
|
118
|
+
- Introduced native support of node:http for local server creation.
|
|
78
119
|
|
|
79
120
|
## [1.1.4] - 2024-02-23
|
|
80
121
|
|
|
81
122
|
### Changed
|
|
82
123
|
|
|
83
|
-
|
|
124
|
+
- Fixed URL escaping in the login link.
|
|
84
125
|
|
|
85
126
|
## [1.1.3] - 2024-02-23
|
|
86
127
|
|
|
87
128
|
### Changed
|
|
88
129
|
|
|
89
|
-
|
|
130
|
+
- Updated outdated dependencies.
|
|
90
131
|
|
|
91
132
|
## [1.1.2] - 2024-02-23
|
|
92
133
|
|
|
93
134
|
### Changed
|
|
94
135
|
|
|
95
|
-
|
|
136
|
+
- Bumped version for package re-publishing test.
|
|
96
137
|
|
|
97
138
|
## [1.1.1] - 2024-02-23
|
|
98
139
|
|
|
99
140
|
### Changed
|
|
100
141
|
|
|
101
|
-
|
|
142
|
+
- Bumped version for package re-publishing.
|
|
102
143
|
|
|
103
144
|
## [1.1.0] - 2024-02-22
|
|
104
145
|
|
|
105
146
|
### Added
|
|
106
147
|
|
|
107
|
-
|
|
148
|
+
- Added support for inexplicit token refresh flow.
|
|
108
149
|
|
|
109
150
|
## [1.0.1] - 2024-02-08
|
|
110
151
|
|
|
111
152
|
### Changed
|
|
112
153
|
|
|
113
|
-
|
|
154
|
+
- Better error handling and reporting for the OAuth2 PKCE flow.
|
|
114
155
|
|
|
115
156
|
## [1.0.0] - 2024-01-17
|
|
116
157
|
|
|
117
158
|
### Added
|
|
118
159
|
|
|
119
|
-
|
|
160
|
+
- Initial `metaplay-auth` version.
|