Skip to content

Commit a431e2a

Browse files
committed
feat: address comments
1 parent 1baae8b commit a431e2a

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

openfga_sdk/credentials.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def validate_credentials_config(self):
218218
or none_or_empty(self.configuration.api_issuer)
219219
):
220220
raise ApiValueError(
221-
"configuration `{}` requires client_id, client_secret and api_issuer defined for client_credentials method."
221+
f"configuration `{self.configuration}` requires client_id, client_secret and api_issuer defined for client_credentials method."
222222
)
223223

224224
# Normalize blank/whitespace values to None
@@ -235,7 +235,7 @@ def validate_credentials_config(self):
235235
self.configuration.scopes = None
236236
if isinstance(self.configuration.scopes, list):
237237
self.configuration.scopes = [
238-
s
238+
s.strip()
239239
for s in self.configuration.scopes
240240
if isinstance(s, str) and s.strip()
241241
]

openfga_sdk/oauth2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async def _obtain_token(self, client):
7676
# Add scope parameter if scopes are configured
7777
if configuration.scopes is not None:
7878
if isinstance(configuration.scopes, list):
79-
scope_str = " ".join(s for s in configuration.scopes if s and s.strip())
79+
scope_str = " ".join(s.strip() for s in configuration.scopes if s and s.strip())
8080
else:
8181
scope_str = (
8282
configuration.scopes.strip()

openfga_sdk/sync/oauth2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def _obtain_token(self, client):
7676
# Add scope parameter if scopes are configured
7777
if configuration.scopes is not None:
7878
if isinstance(configuration.scopes, list):
79-
scope_str = " ".join(s for s in configuration.scopes if s and s.strip())
79+
scope_str = " ".join(s.strip() for s in configuration.scopes if s and s.strip())
8080
else:
8181
scope_str = (
8282
configuration.scopes.strip()

test/sync/oauth2_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,4 +478,3 @@ def test_get_authentication_with_scopes_no_audience(self, mock_request):
478478
)
479479
rest_client.close()
480480

481-
rest_client.close()

0 commit comments

Comments
 (0)