mirror of
https://github.com/docker/login-action.git
synced 2026-07-24 12:27:57 +00:00
Merge pull request #1054 from crazy-max/oidc-missing-dhi
support dhi.io as Docker Hub OIDC registry
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+2
-5
@@ -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> => {
|
||||
|
||||
Reference in New Issue
Block a user