Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions minio/credentials/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,19 +556,29 @@ class LdapIdentityProvider(Provider):

def __init__(
self,
*,
sts_endpoint: str,
ldap_username: str,
ldap_password: str,
duration_seconds: Optional[int] = None,
policy: Optional[str] = None,
token_revoke_type: Optional[str] = None,
http_client: Optional[PoolManager] = None,
):
self._sts_endpoint = sts_endpoint + "?" + urlencode(
{
"Action": "AssumeRoleWithLDAPIdentity",
"Version": "2011-06-15",
"LDAPUsername": ldap_username,
"LDAPPassword": ldap_password,
},
)
query_params = {
"Action": "AssumeRoleWithLDAPIdentity",
"Version": "2011-06-15",
"LDAPUsername": ldap_username,
"LDAPPassword": ldap_password,
}
if duration_seconds:
query_params["DurationSeconds"] = str(duration_seconds)
if policy:
query_params["Policy"] = policy
if token_revoke_type:
query_params["TokenRevokeType"] = token_revoke_type

self._sts_endpoint = sts_endpoint + "?" + urlencode(query_params)
self._http_client = http_client or PoolManager(
retries=Retry(
total=5,
Expand Down