Merge pull request #1054 from crazy-max/oidc-missing-dhi

support dhi.io as Docker Hub OIDC registry
This commit is contained in:
CrazyMax
2026-07-24 14:22:20 +02:00
committed by GitHub
3 changed files with 6 additions and 9 deletions
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+3 -3
View File
File diff suppressed because one or more lines are too long
+2 -5
View File
@@ -12,17 +12,14 @@ interface OIDCTokenResponse {
access_token: string;
}
const registries = new Set(['', 'docker.io', 'registry-1.docker.io', 'registry-1-stage.docker.io', 'dhi.io']);
const defaultExpiresIn = 300;
const minExpiresIn = 300;
const maxExpiresIn = 3600;
const maxRetries = 5;
export const isDockerHubOIDC = (registry: string, password: string): boolean => {
return process.env.DOCKERHUB_OIDC_CONNECTIONID !== undefined && !password && isDockerHubRegistry(registry);
};
const isDockerHubRegistry = (registry: string): boolean => {
return registry === '' || registry === 'docker.io' || registry === 'registry-1.docker.io' || registry === 'registry-1-stage.docker.io';
return process.env.DOCKERHUB_OIDC_CONNECTIONID !== undefined && !password && registries.has(registry);
};
export const getOIDCToken = async (registry: string, username: string): Promise<LoginCredentials> => {