mik-laj commented on a change in pull request #17201:
URL: https://github.com/apache/airflow/pull/17201#discussion_r677120045



##########
File path: airflow/providers/alibabacloud/operators/oss_bucket.py
##########
@@ -0,0 +1,122 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""This module contains Alibaba Cloud OSS operators."""
+import oss2
+from typing import Optional
+
+from airflow.models import BaseOperator
+from airflow.providers.alibabacloud.hooks.oss import OSSHook
+
+
+class OSSCreateBucketOperator(BaseOperator):
+    """
+    This operator creates an OSS bucket
+
+    .. seealso::
+        For more information on how to use this operator, take a look at the 
guide:
+        :ref:`howto/operator:OSSCreateBucketOperator`
+
+    :param region: OSS region you want to create bucket
+    :type region: str
+    :param bucket_name: This is bucket name you want to create
+    :type bucket_name: str
+    :param oss_conn_id: The Airflow connection used for OSS credentials.
+    :type oss_conn_id: Optional[str]
+    :param auth: authentication for Alibaba Cloud user. If not specified 
fetched from connection.
+    :type auth: Optional[oss2.auth.Auth]
+    :param access_id: access key id for Alibaba Cloud user. If not specified 
fetched from connection.
+    :type access_id: Optional[str]
+    :param access_secret: access key secret for Alibaba Cloud user. If not 
specified fetched from connection.

Review comment:
       We should not allow credentials to be passed via parameters as this is 
insecure. When we allow it, the user very often then save these credentials in 
the same file as the DAG, which may expose these credentials to leakage.  
However, when credentials are saved with the connection, they are either 
encrypted in the database or can be stored securely in secret backend.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to