Compare commits

..

3 Commits

Author SHA1 Message Date
CrazyMax
eed2509203 Merge pull request #1068 from crazy-max/dockerhub-oidc-increase-expire-in
raise Docker Hub OIDC max expiry to 6 hours
2026-08-06 12:07:08 +02:00
CrazyMax
07573e7c18 chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-08-06 11:54:13 +02:00
CrazyMax
99ffd0f38a raise Docker Hub OIDC max expiry to 6 hours
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-08-06 11:53:57 +02:00
7 changed files with 128 additions and 128 deletions

View File

@@ -757,10 +757,10 @@ The following inputs can be used as `step.with` keys:
The following environment variables can be set as `step.env` keys:
| Name | Type | Default | Description |
|-------------------------------|--------|---------|-----------------------------------------------------------------------------|
| `DOCKERHUB_OIDC_CONNECTIONID` | String | | Docker Hub OIDC connection ID. Required for Docker Hub OIDC login |
| `DOCKERHUB_OIDC_EXPIREIN` | Number | `300` | Docker Hub OIDC token lifetime in seconds. Must be between `300` and `3600` |
| Name | Type | Default | Description |
|-------------------------------|--------|---------|----------------------------------------------------------------------------------------------------|
| `DOCKERHUB_OIDC_CONNECTIONID` | String | | Docker Hub OIDC connection ID. Required for Docker Hub OIDC login |
| `DOCKERHUB_OIDC_EXPIREIN` | Number | `300` | Docker Hub OIDC token lifetime in seconds. Must be between `300` (5 minutes) and `21600` (6 hours) |
## Contributing

View File

@@ -86,10 +86,10 @@ describe('getOIDCToken', () => {
});
test('uses custom token expiration', async () => {
process.env.DOCKERHUB_OIDC_EXPIREIN = '900';
process.env.DOCKERHUB_OIDC_EXPIREIN = '21600';
await dockerhub.getOIDCToken('docker.io', 'dbowie');
const body = new URLSearchParams(postSpy.mock.calls[0][1]);
expect(body.get('expires_in')).toBe('900');
expect(body.get('expires_in')).toBe('21600');
});
test('uses stage identity host for stage registry', async () => {
@@ -112,9 +112,9 @@ describe('getOIDCToken', () => {
expect(postSpy).not.toHaveBeenCalled();
});
test.each(['not-a-number', '299', '3601'])('validates token expiration %p', async expiresIn => {
test.each(['not-a-number', '299', '21601'])('validates token expiration %p', async expiresIn => {
process.env.DOCKERHUB_OIDC_EXPIREIN = expiresIn;
await expect(dockerhub.getOIDCToken('docker.io', 'dbowie')).rejects.toThrow(`Invalid DOCKERHUB_OIDC_EXPIREIN: ${expiresIn}. Must be between 300 and 3600`);
await expect(dockerhub.getOIDCToken('docker.io', 'dbowie')).rejects.toThrow(`Invalid DOCKERHUB_OIDC_EXPIREIN: ${expiresIn}. Must be between 300 and 21600`);
expect(getIDTokenMock).not.toHaveBeenCalled();
expect(postSpy).not.toHaveBeenCalled();
});

224
dist/index.cjs generated vendored

File diff suppressed because one or more lines are too long

6
dist/index.cjs.map generated vendored

File diff suppressed because one or more lines are too long

2
dist/licenses.txt generated vendored
View File

@@ -4976,7 +4976,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
The following npm package may be included in this product:
- undici@6.28.0
- undici@6.27.0
This package contains the following license:

View File

@@ -15,7 +15,7 @@ interface OIDCTokenResponse {
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 maxExpiresIn = 21600;
const maxRetries = 5;
export const isDockerHubOIDC = (registry: string, password: string): boolean => {

View File

@@ -6238,9 +6238,9 @@ __metadata:
linkType: hard
"undici@npm:^6.23.0, undici@npm:^6.25.0":
version: 6.28.0
resolution: "undici@npm:6.28.0"
checksum: 10/672a7a53bd1f6c80edb73b357ab36e98ef9e474024c442aab2b8ea2bc32f1103cab05525c78661ae724f3e1340e23d03efb9730fba28e76218ab0ec52e15d75a
version: 6.27.0
resolution: "undici@npm:6.27.0"
checksum: 10/30c18cdb235edf4dd36f8aa3ace1ffaf44060289a7d62ad44c33180d2d74a224015d25574812f62ce9c625b5beb1b0b766495b650fedf356aca11eed7ce2c816
languageName: node
linkType: hard