@forge/cli-shared 8.3.1-next.2 → 8.3.1-next.4
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/CHANGELOG.md +12 -0
- package/out/auth/personal/credential-store.d.ts +1 -0
- package/out/auth/personal/credential-store.d.ts.map +1 -1
- package/out/auth/personal/credential-store.js +14 -6
- package/out/graphql/graphql-types.d.ts +1134 -20
- package/out/graphql/graphql-types.d.ts.map +1 -1
- package/out/graphql/graphql-types.js +84 -22
- package/out/ui/text.d.ts +3 -0
- package/out/ui/text.d.ts.map +1 -1
- package/out/ui/text.js +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @forge/cli-shared
|
|
2
2
|
|
|
3
|
+
## 8.3.1-next.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d273489: Add support for CI mode with devSpace in register and create command
|
|
8
|
+
|
|
9
|
+
## 8.3.1-next.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- d77aea3: Cache credentials in credential store
|
|
14
|
+
|
|
3
15
|
## 8.3.1-next.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -43,6 +43,7 @@ export declare class CredentialStoreImpl implements CredentialStore {
|
|
|
43
43
|
private readonly cachedConfig;
|
|
44
44
|
private readonly userRepository;
|
|
45
45
|
private keytarAccount;
|
|
46
|
+
private cached;
|
|
46
47
|
constructor(logger: Logger, instructionsURL: string, keytar: Keytar | null, cachedConfig: CachedConf, userRepository: UserRepository);
|
|
47
48
|
private wrapKeytarError;
|
|
48
49
|
decodeCredentials(credentialsString: string | null): PersonalApiCredentialsValidated;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-store.d.ts","sourceRoot":"","sources":["../../../src/auth/personal/credential-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,C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edConfig;
|
|
62
62
|
userRepository;
|
|
63
63
|
keytarAccount;
|
|
64
|
+
cached = null;
|
|
64
65
|
constructor(logger, instructionsURL, keytar, cachedConfig, userRepository) {
|
|
65
66
|
this.logger = logger;
|
|
66
67
|
this.instructionsURL = instructionsURL;
|
|
@@ -130,6 +131,10 @@ class CredentialStoreImpl {
|
|
|
130
131
|
this.cachedConfig.delete(CACHE_CREDENTIALS_KEY);
|
|
131
132
|
}
|
|
132
133
|
async getCredentials() {
|
|
134
|
+
if (this.cached) {
|
|
135
|
+
return this.cached;
|
|
136
|
+
}
|
|
137
|
+
let result;
|
|
133
138
|
const plaintextCredentials = this.popInsecurePlaintextCredentials();
|
|
134
139
|
if (plaintextCredentials) {
|
|
135
140
|
if (this.keytar) {
|
|
@@ -146,17 +151,19 @@ class CredentialStoreImpl {
|
|
|
146
151
|
token: process.env[exports.API_TOKEN_KEY]
|
|
147
152
|
};
|
|
148
153
|
const { accountId } = await this.userRepository.getUser(credentials);
|
|
149
|
-
|
|
154
|
+
result = { ...credentials, accountId };
|
|
150
155
|
}
|
|
151
|
-
if (this.keytar) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
else if (this.keytar) {
|
|
157
|
+
result = await this.getCredentialsKeytar(this.keytar);
|
|
158
|
+
}
|
|
159
|
+
if (result) {
|
|
160
|
+
this.cached = result;
|
|
161
|
+
return result;
|
|
156
162
|
}
|
|
157
163
|
throw new NoTokenInStoreError();
|
|
158
164
|
}
|
|
159
165
|
async setCredentials(credentials) {
|
|
166
|
+
this.cached = null;
|
|
160
167
|
if (this.keytar) {
|
|
161
168
|
try {
|
|
162
169
|
await this.keytar.setPassword(KEYTAR_SERVICE, this.keytarAccount, JSON.stringify(credentials));
|
|
@@ -170,6 +177,7 @@ class CredentialStoreImpl {
|
|
|
170
177
|
}
|
|
171
178
|
}
|
|
172
179
|
async deleteCredentials() {
|
|
180
|
+
this.cached = null;
|
|
173
181
|
if (this.keytar) {
|
|
174
182
|
try {
|
|
175
183
|
await this.keytar.deletePassword(KEYTAR_SERVICE, this.keytarAccount);
|