Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use remoteCredentialsService when client specified a secretStorageProvider #190781

Merged
merged 2 commits into from
Aug 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,18 @@ export class BrowserCredentialsService extends Disposable implements ICredential
) {
super();

if (environmentService.remoteAuthority && !environmentService.options?.credentialsProvider) {
if (
environmentService.remoteAuthority
&& !environmentService.options?.credentialsProvider
&& !environmentService.options?.secretStorageProvider
) {
// If we have a remote authority but the embedder didn't provide a credentialsProvider,
// we can use the CredentialsService on the remote side
const remoteCredentialsService = ProxyChannel.toService<ICredentialsService>(remoteAgentService.getConnection()!.getChannel('credentials'));
this.credentialsProvider = remoteCredentialsService;
this._secretStoragePrefix = remoteCredentialsService.getSecretStoragePrefix();
} else {
// fall back to InMemoryCredentialsProvider if none was given to us. This should really only be used
// when running tests.
// fall back to InMemoryCredentialsProvider if none was given to us.
this.credentialsProvider = environmentService.options?.credentialsProvider ?? new InMemoryCredentialsProvider();
this._secretStoragePrefix = Promise.resolve(this.productService.urlProtocol);
}
Expand Down