Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions __tests__/updater.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,4 +390,42 @@ describe('Updater', () => {
])
})
})

describe('when given a tenant-id and client-id in credentials', () => {
const jobDetails = {...mockJobDetails}

new Updater(
'MOCK_UPDATER_IMAGE_NAME',
'MOCK_PROXY_IMAGE_NAME',
mockApiClient,
jobDetails,
[
{
type: 'git_source',
host: 'github.com',
username: 'user',
password: 'pass'
},
{
type: 'npm_registry',
host: 'registry.npmjs.org',
'tenant-id': '12345678-1234-1234-1234-123456789012',
'client-id': '87654321-4321-4321-4321-210987654321'
}
]
)

it('they are excluded from the credentials metadata', () => {
expect(jobDetails['credentials-metadata']).toEqual([
{
type: 'git_source',
host: 'github.com'
},
{
type: 'npm_registry',
host: 'registry.npmjs.org'
}
])
})
})
})
2 changes: 2 additions & 0 deletions src/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export type Credential = {
'replaces-base'?: boolean
'public-key-fingerprint'?: string
'auth-key'?: string
'tenant-id'?: string
'client-id'?: string
}

export type Metric = {
Expand Down
Loading