Skip to content

Commit 87c17ae

Browse files
authored
allow tenant-id and client-id in api information (#1553)
1 parent fb72187 commit 87c17ae

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

__tests__/updater.test.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,4 +390,42 @@ describe('Updater', () => {
390390
])
391391
})
392392
})
393+
394+
describe('when given a tenant-id and client-id in credentials', () => {
395+
const jobDetails = {...mockJobDetails}
396+
397+
new Updater(
398+
'MOCK_UPDATER_IMAGE_NAME',
399+
'MOCK_PROXY_IMAGE_NAME',
400+
mockApiClient,
401+
jobDetails,
402+
[
403+
{
404+
type: 'git_source',
405+
host: 'github.com',
406+
username: 'user',
407+
password: 'pass'
408+
},
409+
{
410+
type: 'npm_registry',
411+
host: 'registry.npmjs.org',
412+
'tenant-id': '12345678-1234-1234-1234-123456789012',
413+
'client-id': '87654321-4321-4321-4321-210987654321'
414+
}
415+
]
416+
)
417+
418+
it('they are excluded from the credentials metadata', () => {
419+
expect(jobDetails['credentials-metadata']).toEqual([
420+
{
421+
type: 'git_source',
422+
host: 'github.com'
423+
},
424+
{
425+
type: 'npm_registry',
426+
host: 'registry.npmjs.org'
427+
}
428+
])
429+
})
430+
})
393431
})

src/api-client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export type Credential = {
3939
'replaces-base'?: boolean
4040
'public-key-fingerprint'?: string
4141
'auth-key'?: string
42+
'tenant-id'?: string
43+
'client-id'?: string
4244
}
4345

4446
export type Metric = {

0 commit comments

Comments
 (0)