Skip to content

Conversation

@siddsriv
Copy link
Contributor

Issue

Internal JS-5193

Description

makes tokenTtl configurable and sets a precedence order for port.

Testing

unit testing:

✓ src/MetadataService.spec.ts (31 tests) 23ms
   ✓ MetadataService Socket Leak Checks > fetchMetadataToken - body consumption checks > should consume response body on 200 status and return token 5ms
   ✓ MetadataService Socket Leak Checks > fetchMetadataToken - body consumption checks > should consume response body on 400 status before throwing 2ms
.
.
.
   ✓ MetadataService Retry Configuration > status code handling for retries > should retry 500 errors 0ms
   ✓ MetadataService Token TTL Configuration > should use default tokenTtl of 21600 seconds 0ms
   ✓ MetadataService Token TTL Configuration > should use custom tokenTtl value 0ms
   ✓ MetadataService Token TTL Configuration > should validate tokenTtl as positive integer 1ms
   ✓ MetadataService Token TTL Configuration > should accept valid positive integer tokenTtl values 0ms
   ✓ MetadataService Token TTL Configuration > should convert tokenTtl to string in header 0ms

 Test Files  1 passed (1)
      Tests  31 passed (31)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@siddsriv siddsriv requested a review from a team as a code owner December 17, 2025 00:22
*/
tokenTtl?: number;
/**
* the port for the endpoint, defaulting to 80.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it default to undefined or the default port of the url's protocol?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants