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

Changed context values & Removed Unnecessary header #183

Merged
merged 6 commits into from
Aug 25, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -162,22 +162,6 @@ export class AzureRegistryDataProvider extends RegistryV2DataProvider implements
}
}

public async deleteTag(item: AzureTag): Promise<void> {
const authenticationProvider = this.getAuthenticationProvider(item.parent.parent as unknown as AzureRegistryItem);

const reponse = await registryV2Request({
method: 'DELETE',
registryUri: item.baseUrl,
path: ['v2', '_acr', `${item.parent.label}`, 'tags', `${item.label}`],
scopes: [`repository:${item.parent.label}:delete`],
authenticationProvider: authenticationProvider,
});

if (!reponse.succeeded) {
throw new Error(`Failed to delete tag: ${reponse.statusText}`);
}
}

protected override getAuthenticationProvider(item: AzureRegistryItem): ACROAuthProvider {
const registryString = item.baseUrl.toString();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class GitHubRegistryDataProvider extends RegistryV2DataProvider {
public async onConnect(): Promise<void> {
const wizardContext: RegistryWizardContext = {
usernamePrompt: vscode.l10n.t('GitHub Username'),
secretPrompt: vscode.l10n.t('GitHub Personal Access Token (requires `repo` scope for read-only operations)'), // TODO: add scope for write
secretPrompt: vscode.l10n.t('GitHub Personal Access Token (requires `repo` and `write:packages` scopes)'),
};

const wizard = new RegistryWizard(
Expand Down Expand Up @@ -74,6 +74,7 @@ export class GitHubRegistryDataProvider extends RegistryV2DataProvider {
baseUrl: GitHubContainerRegistryUri,
label: org,
type: 'commonregistry',
additionalContextValues: ['githubRegistry']
}
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ export abstract class RegistryV2DataProvider extends CommonRegistryDataProvider
method: 'DELETE',
registryUri: registry.baseUrl,
path: ['v2', item.parent.label, 'manifests', digest],
scopes: [`repository:${item.parent.label}:pull`],
headers: {
'accept': 'application/vnd.docker.distribution.manifest.v2+json'
}
scopes: [`repository:${item.parent.label}:delete`]
});
}

Expand Down