ephraimbuddy commented on a change in pull request #15159:
URL: https://github.com/apache/airflow/pull/15159#discussion_r608875129
##########
File path: airflow/providers/microsoft/azure/hooks/wasb.py
##########
@@ -57,6 +57,50 @@ class WasbHook(BaseHook):
conn_type = 'wasb'
hook_name = 'Azure Blob Storage'
+ @staticmethod
+ def get_connection_form_widgets() -> Dict[str, Any]:
+ """Returns connection widgets to add to connection form"""
+ from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
+ from flask_babel import lazy_gettext
+ from wtforms import StringField
+
+ return {
+ "extra__wasb__connection_string": StringField(
+ lazy_gettext('Blob Storage Connection String (optional)'),
widget=BS3TextFieldWidget()
+ ),
+ "extra__wasb__shared_access_key": StringField(
+ lazy_gettext('Blob Storage Shared Access Key (optional)'),
widget=BS3TextFieldWidget()
+ ),
+ "extra__wasb__tenant_id": StringField(
+ lazy_gettext('Tenant Id (Active Directory Auth)'),
widget=BS3TextFieldWidget()
+ ),
+ "extra__wasb__sas_token": StringField(
+ lazy_gettext('SAS Token (optional)'),
widget=BS3TextFieldWidget()
+ ),
+ }
+
+ @staticmethod
+ def get_ui_field_behaviour() -> Dict:
+ """Returns custom field behaviour"""
+ return {
+ "hidden_fields": ['schema', 'port', 'host'],
+ "relabeling": {
+ 'login': 'Blob Storage Login (optional)',
+ 'password': 'Blob Storage Token (optional)',
Review comment:
```suggestion
'password': 'Blob Storage Key (optional)',
```
Should we use `Key` instead of `Token`? Considering that users might mistake
it for SAS token?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]