Shared utilities for NaturalState Superset plugins - ADLS authentication and assets management
npm install superset-plugins-utils-adlsShared utilities for NaturalState Superset plugins, providing authentication and assets management for Azure Data Lake Storage (ADLS).
- Authentication Service: Azure AD authentication using MSAL
- Assets Service: Manage and retrieve SAS URLs for ADLS blobs
- Config Service: Centralized configuration management
``bash`
npm install @natural-state/superset-plugins-utils-adls
`typescript
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'
});
`
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
Manages ADLS assets and SAS URL generation.
Methods:
- static getSasUrl(options): Get SAS URL for a blob
Options:
- storage_type (optional): 'file' or 'blob'
Centralized configuration management.
Methods:
- getConfig()`: Retrieve application configuration
Apache-2.0