UNPKG

@backstage/integration

Version:

Helpers for managing integrations towards external systems

27 lines (23 loc) 896 B
'use strict'; var CachedAzureDevOpsCredentialsProvider = require('./CachedAzureDevOpsCredentialsProvider.cjs.js'); async function getAzureRequestOptions(config, additionalHeaders) { const headers = additionalHeaders ? { ...additionalHeaders } : {}; const credentialConfig = config.credentials?.filter( (credential) => credential.organizations === void 0 || credential.organizations.length === 0 )[0]; if (credentialConfig) { const credentialsProvider = CachedAzureDevOpsCredentialsProvider.CachedAzureDevOpsCredentialsProvider.fromAzureDevOpsCredential( credentialConfig ); const credentials = await credentialsProvider.getCredentials(); return { headers: { ...credentials?.headers, ...headers } }; } return { headers }; } exports.getAzureRequestOptions = getAzureRequestOptions; //# sourceMappingURL=deprecated.cjs.js.map