Skip to content

Commit 2079b9d

Browse files
committed
Use iam default client
1 parent fd98369 commit 2079b9d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

gcl_iam/tests/functional/clients.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
SECRET = "secret"
3030
DEFAULT_ENDPOINT = "http://localhost:11010/v1/"
31+
DEFAULT_CLIENT_ALIAS = "default"
3132

3233

3334
class GenesisCoreAuth:
@@ -36,7 +37,7 @@ def __init__(
3637
username: str,
3738
password: str,
3839
grant_type: str = "password",
39-
client_uuid: str = "00000000-0000-0000-0000-000000000000",
40+
client_uuid: str = DEFAULT_CLIENT_ALIAS,
4041
client_id: str = "GenesisCoreClientId",
4142
client_secret: str = "GenesisCoreSecret",
4243
uuid: str = "00000000-0000-0000-0000-000000000000",
@@ -143,11 +144,12 @@ def project_id(self):
143144
def get_password_auth_params(self):
144145
params = {
145146
"grant_type": self._grant_type,
146-
"client_id": self._client_id,
147-
"client_secret": self._client_secret,
148147
"password": self._password,
149148
"scope": (f"project:{self._project_id}" if self._project_id else ""),
150149
}
150+
if self._client_uuid != DEFAULT_CLIENT_ALIAS:
151+
params["client_id"] = self._client_id
152+
params["client_secret"] = self._client_secret
151153
if self.grant_type in ("password", "username+password"):
152154
params["username"] = self._username
153155
elif self.grant_type == "email+password":

0 commit comments

Comments
 (0)