Skip to content

MinioAdmin: add targetuser in add_service_account #1487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
5 changes: 4 additions & 1 deletion minio/minioadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,8 @@ def add_service_account(self,
policy: dict | None = None,
policy_file: str | os.PathLike | None = None,
expiration: str | None = None,
status: str | None = None) -> str:
status: str | None = None,
targetuser: str | None = None) -> str:
"""
Add a new service account with the given access key and secret key
"""
Expand All @@ -784,6 +785,8 @@ def add_service_account(self,
data["name"] = name
if description:
data["description"] = description
if targetuser:
data["targetuser"] = targetuser
if policy_file:
with open(policy_file, encoding="utf-8") as file:
data["policy"] = json.load(file)
Expand Down