[英]Authenticating and transferring CSV files from GCS to a remote network drive in Python
I'm wanting to use a containerised Python app to connect and authenticate to an AD managed.network drive on a physical file server to then transfer some csv files to it from a Google Cloud bucket and I'm wondering what the best options are to do this?我想使用容器化的 Python 应用程序连接到物理文件服务器上的 AD managed.network 驱动器并进行身份验证,然后将一些 csv 文件从 Google Cloud 存储桶传输到它,我想知道最好的选择是什么做这个?
So far I have established that I can see the server using:到目前为止,我已经确定我可以看到服务器使用:
try:
smbclient.register_session("xx.xx.xx.xx", username="user", password="pass")
except Exception as exec:
print(exec)
But this leads me to the problem of the best way to authenticate against it.但这让我想到了对它进行身份验证的最佳方式的问题。 I'm unfortunately not a very experienced programmer, I was wondering if there was some sort of token exchange that I could implement?不幸的是,我不是一个非常有经验的程序员,我想知道是否可以实现某种令牌交换?
I used:我用了:
mount_string = f'mount -t cifs -o username={secret_dict["user"]}, {secret_dict["password"]} //<serverip>/<share> {mount}'
try:
os.system(mount_string)
except Exception as exec:
print(exec)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.