|
19 | 19 | from posixpath import basename |
20 | 20 | from typing import Any |
21 | 21 |
|
22 | | -from config.settings import IBM_AUTH_ENABLED, is_dev_azure_blob_enabled |
| 22 | +from config.settings import ( |
| 23 | + IBM_AUTH_ENABLED, |
| 24 | + is_azure_blob_enabled, |
| 25 | + is_dev_azure_blob_enabled, |
| 26 | +) |
23 | 27 | from connectors.base import BaseConnector, ConnectorDocument, DocumentACL |
24 | 28 | from utils.logging_config import get_logger |
25 | 29 |
|
@@ -71,17 +75,19 @@ class AzureBlobConnector(BaseConnector): |
71 | 75 | SECRET_CONFIG_KEYS = ("connection_string", "account_key") |
72 | 76 |
|
73 | 77 | # BaseConnector uses these for the default env-availability probe; the |
74 | | - # bucket-kind override below makes availability hinge on IBM_AUTH_ENABLED |
75 | | - # (or OPENRAG_DEV_AZURE_BLOB for local dev). |
| 78 | + # bucket-kind override below makes availability hinge on the kill switch and |
| 79 | + # IBM_AUTH_ENABLED (or OPENRAG_DEV_AZURE_BLOB for local dev). |
76 | 80 | CLIENT_ID_ENV_VAR = "AZURE_STORAGE_ACCOUNT_NAME" |
77 | 81 | CLIENT_SECRET_ENV_VAR = "AZURE_STORAGE_ACCOUNT_KEY" |
78 | 82 |
|
79 | 83 | @classmethod |
80 | 84 | def is_available(cls, manager, user_id=None) -> bool: |
81 | | - # Gated by feature flag like the other bucket connectors (aws_s3, ibm_cos). |
82 | | - # OPENRAG_DEV_AZURE_BLOB=true bypasses the IBM_AUTH_ENABLED requirement for |
83 | | - # local dev testing (e.g. against Azurite). Never use in production. |
84 | | - return IBM_AUTH_ENABLED or is_dev_azure_blob_enabled() |
| 85 | + # OPENRAG_AZURE_BLOB_ENABLED is a kill switch (default true): set it false |
| 86 | + # to force-hide the connector even when IBM auth is on. When true, the |
| 87 | + # Enterprise/SaaS gate still applies -- IBM_AUTH_ENABLED like the other |
| 88 | + # bucket connectors (aws_s3, ibm_cos), or OPENRAG_DEV_AZURE_BLOB=true to |
| 89 | + # bypass IBM auth for local dev (e.g. against Azurite; never in production). |
| 90 | + return is_azure_blob_enabled() and (IBM_AUTH_ENABLED or is_dev_azure_blob_enabled()) |
85 | 91 |
|
86 | 92 | @classmethod |
87 | 93 | def register_routes(cls, app) -> None: |
|
0 commit comments