Azure-Samples / Azure-Samples/ms-identity-python-daemon
Close key file after reading in Python example
オープン
- 主要言語
- PowerShell
- スター
- 62
- フォーク
- 27
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Don't open a file in Python without closing it. This code is bad mojo:
```
app = msal.ConfidentialClientApplication(
config["client_id"], authority=config["authority"],
client_credential={"thumbprint": config["thumbprint"], "private_key": open(config['private_key_file']).read()},
)
```
Prefer:
```
with open(config['private_key_file']) as f:
key = f.read()
app = msal.ConfidentialClientApplication(
config["client_id"], authority=config["authority"],
client_credential={"thumbprint": config["thumbprint"], "private_key": key },
)
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。