Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

928 changes: 498 additions & 430 deletions packages/vscode-container-client/NOTICE.html

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions packages/vscode-docker-registries/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.4.2 - 16 April 2026
### Fixed
* Fixed an issue where some requests would fail. [#354](https://github.com/microsoft/vscode-docker-extensibility/issues/354)
* Fixed incorrect handling of basic auth `WWW-Authenticate` headers. [#355](https://github.com/microsoft/vscode-docker-extensibility/issues/355)

## 0.4.1 - 14 October 2025
### Fixed
* Better error messages in the tree when errors occur. [#310](https://github.com/microsoft/vscode-docker-extensibility/pull/310)
Expand Down
928 changes: 498 additions & 430 deletions packages/vscode-docker-registries/NOTICE.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/vscode-docker-registries/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@microsoft/vscode-docker-registries",
"author": "Microsoft Corporation",
"version": "0.4.1",
"version": "0.4.2",
"description": "Extensibility model for contributing registry providers to the Container Tools extension for Visual Studio Code",
"license": "See LICENSE in the project root for license information.",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,16 @@ export class BasicOAuthProvider extends BasicAuthProvider implements Authenticat

const match = wwwAuthenticateHeaderRegex.exec(wwwAuthenticateHeader);

if (!match?.groups?.realm || !match?.groups?.service || !match?.groups?.scope) {
if (match?.groups?.realm && match?.groups?.service && match?.groups?.scope) {
this.oAuthEndpoint = match.groups.realm;
this.oAuthService = match.groups.service;
this.defaultScopes = match.groups.scope.split(' ');
} else if (!/Basic\s+/i.test(wwwAuthenticateHeader)) {
throw new Error(vscode.l10n.t('Unable to parse WWW-Authenticate header: "{0}"', wwwAuthenticateHeader));
}
// For Basic challenges, oAuthEndpoint/oAuthService remain undefined,
// so getSession will use Basic auth directly.

this.oAuthEndpoint = match.groups.realm;
this.oAuthService = match.groups.service;
this.defaultScopes = match.groups.scope.split(' ');
this._didFallback = true;
Comment thread
bwateratmsft marked this conversation as resolved.
Comment thread
bwateratmsft marked this conversation as resolved.
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import * as chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { before } from 'mocha';

before('Global setup', function () {
console.log('Global setup');
Expand Down
8 changes: 6 additions & 2 deletions packages/vscode-docker-registries/src/utils/httpRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ export interface ResponseLike<T> extends Response {
}

export async function httpRequest<T>(url: string, request: RequestLike, throwOnFailure: boolean = true): Promise<ResponseLike<T>> {
const fetchRequest = new Request(url, request);
const response: Response = await fetch(fetchRequest);
const requestInit: RequestLike = !!request.body && request.duplex === undefined
// node-fetch requires the "duplex" option to be set to "half" in order to send a body
? { ...request, duplex: 'half' }
: request;

const response: Response = await fetch(url, requestInit);

if (throwOnFailure && response.status === 401) {
throw new UnauthorizedError(vscode.l10n.t('Request to \'{0}\' failed with response 401: Unauthorized', url));
Expand Down
Loading
Loading