Skip to content

Commit

Permalink
Fix Docker Hub sign in URL (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwateratmsft authored Nov 30, 2023
1 parent 24e2d35 commit 5ea29cc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
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.

3 changes: 1 addition & 2 deletions 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.1.8",
"version": "0.1.9",
"description": "Extensibility model for contributing registry providers to the Docker extension for Visual Studio Code",
"license": "See LICENSE in the project root for license information.",
"repository": {
Expand All @@ -23,7 +23,6 @@
"lint": "eslint --max-warnings 0 . --ext ts",
"test": "mocha --file lib/test/global.test.js --recursive lib/test",
"unittest": "npm test -- --grep /unit/i",
"update-design": "npx embedme DESIGN.md",
"package": "npm pack"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import * as vscode from 'vscode';
import { AuthenticationProvider } from '../contracts/AuthenticationProvider';
import { LoginInformation } from '../contracts/BasicCredentials';
import { DockerHubRegistryUrl, DockerHubRequestUrl } from '../clients/DockerHub/DockerHubRegistryDataProvider';
import { DockerHubRequestUrl, DockerHubSignInUrl } from '../clients/DockerHub/DockerHubRegistryDataProvider';
import { httpRequest } from '../utils/httpRequest';
import { BasicAuthProvider } from './BasicAuthProvider';

Expand Down Expand Up @@ -54,7 +54,7 @@ export class DockerHubAuthProvider extends BasicAuthProvider implements Authenti
const credentials = await this.getBasicCredentials();

return {
server: DockerHubRegistryUrl.toString(),
server: DockerHubSignInUrl,
username: credentials.username,
secret: credentials.secret,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ import { getErrorTreeItem } from './ErrorTreeItem';

dayjs.extend(relativeTime);

export abstract class CommonRegistryDataProvider implements RegistryDataProvider<CommonRegistryItem> {
export abstract class CommonRegistryDataProvider implements RegistryDataProvider<CommonRegistryItem>, vscode.Disposable {
protected readonly onDidChangeTreeDataEmitter = new vscode.EventEmitter<CommonRegistryItem | undefined>();
public readonly onDidChangeTreeData = this.onDidChangeTreeDataEmitter.event;

public dispose(): void {
this.onDidChangeTreeDataEmitter.dispose();
}

public async getChildren(element?: CommonRegistryItem | undefined): Promise<CommonRegistryItem[]> {
try {
if (!element) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import * as vscode from 'vscode';

export const DockerHubRequestUrl = vscode.Uri.parse('https://hub.docker.com/');
export const DockerHubRegistryUrl = vscode.Uri.parse('https://docker.io/');
export const DockerHubSignInUrl = 'https://index.docker.io/v1/';
export const DockerHubContextValue = 'dockerhub';

export function isDockerHubRegistry(item: unknown): item is CommonRegistry {
Expand Down

0 comments on commit 5ea29cc

Please sign in to comment.