chore: api report generated and removed comments

Signed-off-by: Nikunj Hudka <nikunjhudka123@gmail.com>
This commit is contained in:
Nikunj Hudka
2024-11-04 11:11:37 -04:00
parent 8d0f80e5ab
commit 6997a53fa7
2 changed files with 35 additions and 49 deletions
@@ -23,10 +23,6 @@ import { AzureBlobStorageIntegrationConfig } from './config';
import { AzureCredentialsManager } from './types';
import { ScmIntegrationRegistry } from '../registry';
/**
* Default Azure Credentials Manager to dynamically select and manage Azure credentials.
* It supports Service Principal, Managed Identity, SAS Token, Connection String, Account Key, and Anonymous access.
*/
export class DefaultAzureCredentialsManager implements AzureCredentialsManager {
private config: AzureBlobStorageIntegrationConfig;
private cachedCredentials: Map<string, TokenCredential>;
@@ -49,48 +45,13 @@ export class DefaultAzureCredentialsManager implements AzureCredentialsManager {
return new DefaultAzureCredentialsManager(azureConfig);
}
/**
* Determines the appropriate credential method and returns credentials for BlobServiceClient.
* Supports:
* - Service Principal
* - Managed Identity
* - SAS Token
* - Connection String
* - Account Key
* - Anonymous access
*/
async getCredentials(accountName: string): Promise<TokenCredential> {
// Check if the credentials are already cached
if (this.cachedCredentials.has(accountName)) {
return this.cachedCredentials.get(accountName)!;
}
let credential: TokenCredential;
// Check for SAS Token
// if (this.config.sasToken) {
// // console.log('Using SAS Token for Azure Blob Storage authentication');
// // SAS Token does not return a credential but can be used directly in BlobServiceClient
// // Here we can simply return undefined or keep a placeholder if needed
// return this.config.sasToken; // Or return a string for the URL using the SAS token
// }
// // Check for Connection String
// else if (this.config.connectionString) {
// // console.log(
// // 'Using Connection String for Azure Blob Storage authentication',
// // );
// // return undefined; // Connection string will also not return a specific credential object
// }
// Check for Account Key
// if (this.config.accountKey) {
// // console.log('Using Account Key for Azure Blob Storage authentication');
// credential = new StorageSharedKeyCredential(
// accountName,
// this.config.accountKey,
// );
// }
// Check for AAD credentials
if (
this.config.aadCredential &&
this.config.aadCredential.clientId &&
@@ -102,14 +63,7 @@ export class DefaultAzureCredentialsManager implements AzureCredentialsManager {
this.config.aadCredential.clientId,
this.config.aadCredential.clientSecret,
);
}
// Check for Anonymous access
// else if (this.config.anonymousAccess) {
// console.log('Using Anonymous Credential for Azure Blob Storage access');
// credential = new AnonymousCredential();
// }
// Fallback to Managed Identity
else {
} else {
credential = new DefaultAzureCredential();
}
@@ -3,18 +3,50 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { AzureBlobStorageIntergation } from '@backstage/integration';
import { BackendFeature } from '@backstage/backend-plugin-api';
import { CatalogProcessor } from '@backstage/plugin-catalog-node';
import { CatalogProcessorEmit } from '@backstage/plugin-catalog-node';
import { Config } from '@backstage/config';
import { DefaultAzureCredentialsManager } from '@backstage/integration';
import { EntityProvider } from '@backstage/plugin-catalog-node';
import { EntityProviderConnection } from '@backstage/plugin-catalog-node';
import { LocationSpec } from '@backstage/plugin-catalog-common';
import { LoggerService } from '@backstage/backend-plugin-api';
import { SchedulerService } from '@backstage/backend-plugin-api';
import { SchedulerServiceTaskRunner } from '@backstage/backend-plugin-api';
import { SchedulerServiceTaskScheduleDefinition } from '@backstage/backend-plugin-api';
import { ScmIntegrationRegistry } from '@backstage/integration';
// Warning: (ae-missing-release-tag) "AzureBlobStorageEntityProvider" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export class AzureBlobStorageEntityProvider implements EntityProvider {
// Warning: (ae-forgotten-export) The symbol "AzureBlobStorageConfig" needs to be exported by the entry point index.d.ts
constructor(
config: AzureBlobStorageConfig,
integration: AzureBlobStorageIntergation,
credentialsProvider: DefaultAzureCredentialsManager,
logger: LoggerService,
schedule: SchedulerServiceTaskRunner,
);
// (undocumented)
connect(connection: EntityProviderConnection): Promise<void>;
// (undocumented)
static fromConfig(
configRoot: Config,
options: {
logger: LoggerService;
schedule?: SchedulerServiceTaskRunner;
scheduler?: SchedulerService;
},
): AzureBlobStorageEntityProvider[];
// (undocumented)
getProviderName(): string;
// (undocumented)
refresh(logger: LoggerService): Promise<void>;
}
// @public
export class AzureDevOpsDiscoveryProcessor implements CatalogProcessor {
constructor(options: {
@@ -56,6 +88,6 @@ export class AzureDevOpsEntityProvider implements EntityProvider {
}
// @public
const catalogModuleAzureDevOpsEntityProvider: BackendFeature;
export default catalogModuleAzureDevOpsEntityProvider;
const catalogModuleAzureEntityProvider: BackendFeature;
export default catalogModuleAzureEntityProvider;
```