superset-plugins-utils-adls
v1.0.0
Published
Shared utilities for NaturalState Superset plugins - ADLS authentication and assets management
Downloads
7
Readme
@natural-state/superset-plugins-utils-adls
Shared utilities for NaturalState Superset plugins, providing authentication and assets management for Azure Data Lake Storage (ADLS).
Features
- Authentication Service: Azure AD authentication using MSAL
- Assets Service: Manage and retrieve SAS URLs for ADLS blobs
- Config Service: Centralized configuration management
Installation
npm install @natural-state/superset-plugins-utils-adlsUsage
import { AuthService, AssetsService, ConfigService } from '@natural-state/superset-plugins-utils-adls';
// Use the services in your Superset plugin
const authService = new AuthService();
const isAuth = authService.isAuthenticated('adls_storage');
// Get SAS URL for a blob
const sasUrl = await AssetsService.getSasUrl({
storage_account: 'myaccount',
container: 'mycontainer',
blob: 'myblob.jpg'
});Services
AuthService
Handles Azure AD authentication using MSAL browser library.
Methods:
static getTokens(scope): Get stored access and ID tokensisAuthenticated(scope): Check if user is authenticatedrefreshToken(scope): Refresh authentication tokenacquireTokenSilent(scope): Silently acquire tokenacquireTokenRedirect(scope): Acquire token via redirect
AssetsService
Manages ADLS assets and SAS URL generation.
Methods:
static getSasUrl(options): Get SAS URL for a blob
Options:
storage_type(optional): 'file' or 'blob'
ConfigService
Centralized configuration management.
Methods:
getConfig(): Retrieve application configuration
License
Apache-2.0
