Skip to content

Commit cf6e9f0

Browse files
committed
Rename oauth_oauth_uri -> oauth_uri
1 parent d854fe5 commit cf6e9f0

File tree

5 files changed

+50
-32
lines changed

5 files changed

+50
-32
lines changed

reportportal_client/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class _ClientOptions(TypedDict, total=False):
4747
project: str
4848
api_key: Optional[str]
4949
# OAuth 2.0 parameters
50-
oauth_oauth_uri: Optional[str]
50+
oauth_uri: Optional[str]
5151
oauth_username: Optional[str]
5252
oauth_password: Optional[str]
5353
oauth_client_id: Optional[str]
@@ -86,7 +86,7 @@ def create_client(
8686
:param endpoint: Endpoint of the ReportPortal service.
8787
:param project: Project name to report to.
8888
:param api_key: Authorization API key.
89-
:param oauth_oauth_uri: OAuth 2.0 token endpoint URI (for OAuth authentication).
89+
:param oauth_uri: OAuth 2.0 token endpoint URI (for OAuth authentication).
9090
:param oauth_username: Username for OAuth 2.0 authentication.
9191
:param oauth_password: Password for OAuth 2.0 authentication.
9292
:param oauth_client_id: OAuth 2.0 client ID.

reportportal_client/aio/client.py

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def __init__(
142142
print_output: OutputType = OutputType.STDOUT,
143143
truncate_attributes: bool = True,
144144
# OAuth 2.0 Password Grant parameters
145-
oauth_oauth_uri: Optional[str] = None,
145+
oauth_uri: Optional[str] = None,
146146
oauth_username: Optional[str] = None,
147147
oauth_password: Optional[str] = None,
148148
oauth_client_id: Optional[str] = None,
@@ -155,6 +155,12 @@ def __init__(
155155
:param endpoint: Endpoint of the ReportPortal service.
156156
:param project: Project name to report to.
157157
:param api_key: Authorization API key.
158+
:param oauth_uri: OAuth 2.0 token endpoint URI (for OAuth authentication).
159+
:param oauth_username: Username for OAuth 2.0 authentication.
160+
:param oauth_password: Password for OAuth 2.0 authentication.
161+
:param oauth_client_id: OAuth 2.0 client ID.
162+
:param oauth_client_secret: OAuth 2.0 client secret (optional).
163+
:param oauth_scope: OAuth 2.0 scope (optional).
158164
:param is_skipped_an_issue: Option to mark skipped tests as not 'To Investigate' items on the
159165
server side.
160166
:param verify_ssl: Option to skip ssl verification.
@@ -167,12 +173,6 @@ def __init__(
167173
:param launch_uuid_print: Print Launch UUID into passed TextIO or by default to stdout.
168174
:param print_output: Set output stream for Launch UUID printing.
169175
:param truncate_attributes: Truncate test item attributes to default maximum length.
170-
:param oauth_oauth_uri: OAuth 2.0 token endpoint URI (optional, for OAuth authentication).
171-
:param oauth_username: Username for OAuth 2.0 authentication (optional).
172-
:param oauth_password: Password for OAuth 2.0 authentication (optional).
173-
:param oauth_client_id: OAuth 2.0 client ID (optional).
174-
:param oauth_client_secret: OAuth 2.0 client secret (optional).
175-
:param oauth_scope: OAuth 2.0 scope (optional).
176176
"""
177177
self.api_v1, self.api_v2 = "v1", "v2"
178178
self.endpoint = endpoint
@@ -204,21 +204,21 @@ def __init__(
204204
)
205205
self.api_key = kwargs["token"]
206206

207-
self.oauth_uri = oauth_oauth_uri
207+
self.oauth_uri = oauth_uri
208208
self.oauth_username = oauth_username
209209
self.oauth_password = oauth_password
210210
self.oauth_client_id = oauth_client_id
211211
self.oauth_client_secret = oauth_client_secret
212212
self.oauth_scope = oauth_scope
213213

214214
# Initialize authentication
215-
oauth_params = [oauth_oauth_uri, oauth_username, oauth_password, oauth_client_id]
215+
oauth_params = [oauth_uri, oauth_username, oauth_password, oauth_client_id]
216216
oauth_provided = all(oauth_params)
217217

218218
if oauth_provided:
219219
# Use OAuth 2.0 Password Grant authentication
220220
self.auth = OAuthPasswordGrantAsync(
221-
oauth_uri=oauth_oauth_uri,
221+
oauth_uri=oauth_uri,
222222
username=oauth_username,
223223
password=oauth_password,
224224
client_id=oauth_client_id,
@@ -663,7 +663,7 @@ def clone(self) -> "Client":
663663
mode=self.mode,
664664
launch_uuid_print=self.launch_uuid_print,
665665
print_output=self.print_output,
666-
oauth_oauth_uri=self.oauth_uri,
666+
oauth_uri=self.oauth_uri,
667667
oauth_username=self.oauth_username,
668668
oauth_password=self.oauth_password,
669669
oauth_client_id=self.oauth_client_id,
@@ -765,6 +765,12 @@ def __init__(
765765
:param endpoint: Endpoint of the ReportPortal service.
766766
:param project: Project name to report to.
767767
:param api_key: Authorization API key.
768+
:param oauth_uri: OAuth 2.0 token endpoint URI (for OAuth authentication).
769+
:param oauth_username: Username for OAuth 2.0 authentication.
770+
:param oauth_password: Password for OAuth 2.0 authentication.
771+
:param oauth_client_id: OAuth 2.0 client ID.
772+
:param oauth_client_secret: OAuth 2.0 client secret (optional).
773+
:param oauth_scope: OAuth 2.0 scope (optional).
768774
:param is_skipped_an_issue: Option to mark skipped tests as not 'To Investigate' items on the
769775
server side.
770776
:param verify_ssl: Option to skip ssl verification.
@@ -1587,6 +1593,12 @@ def __init__(
15871593
:param endpoint: Endpoint of the ReportPortal service.
15881594
:param project: Project name to report to.
15891595
:param api_key: Authorization API key.
1596+
:param oauth_uri: OAuth 2.0 token endpoint URI (for OAuth authentication).
1597+
:param oauth_username: Username for OAuth 2.0 authentication.
1598+
:param oauth_password: Password for OAuth 2.0 authentication.
1599+
:param oauth_client_id: OAuth 2.0 client ID.
1600+
:param oauth_client_secret: OAuth 2.0 client secret (optional).
1601+
:param oauth_scope: OAuth 2.0 scope (optional).
15901602
:param is_skipped_an_issue: Option to mark skipped tests as not 'To Investigate' items on the
15911603
server side.
15921604
:param verify_ssl: Option to skip ssl verification.
@@ -1769,6 +1781,12 @@ def __init__(
17691781
:param endpoint: Endpoint of the ReportPortal service.
17701782
:param project: Project name to report to.
17711783
:param api_key: Authorization API key.
1784+
:param oauth_uri: OAuth 2.0 token endpoint URI (for OAuth authentication).
1785+
:param oauth_username: Username for OAuth 2.0 authentication.
1786+
:param oauth_password: Password for OAuth 2.0 authentication.
1787+
:param oauth_client_id: OAuth 2.0 client ID.
1788+
:param oauth_client_secret: OAuth 2.0 client secret (optional).
1789+
:param oauth_scope: OAuth 2.0 scope (optional).
17721790
:param is_skipped_an_issue: Option to mark skipped tests as not 'To Investigate' items on the
17731791
server side.
17741792
:param verify_ssl: Option to skip ssl verification.

reportportal_client/client.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def __init__(
477477
log_batcher: Optional[LogBatcher[RPRequestLog]] = None,
478478
truncate_attributes: bool = True,
479479
# OAuth 2.0 Password Grant parameters
480-
oauth_oauth_uri: Optional[str] = None,
480+
oauth_uri: Optional[str] = None,
481481
oauth_username: Optional[str] = None,
482482
oauth_password: Optional[str] = None,
483483
oauth_client_id: Optional[str] = None,
@@ -490,6 +490,12 @@ def __init__(
490490
:param endpoint: Endpoint of the ReportPortal service.
491491
:param project: Project name to report to.
492492
:param api_key: Authorization API key.
493+
:param oauth_uri: OAuth 2.0 token endpoint URI (for OAuth authentication).
494+
:param oauth_username: Username for OAuth 2.0 authentication.
495+
:param oauth_password: Password for OAuth 2.0 authentication.
496+
:param oauth_client_id: OAuth 2.0 client ID.
497+
:param oauth_client_secret: OAuth 2.0 client secret (optional).
498+
:param oauth_scope: OAuth 2.0 scope (optional).
493499
:param log_batch_size: Option to set the maximum number of logs that can be processed in one
494500
batch.
495501
:param is_skipped_an_issue: Option to mark skipped tests as not 'To Investigate' items on the
@@ -506,12 +512,6 @@ def __init__(
506512
:param print_output: Set output stream for Launch UUID printing.
507513
:param log_batcher: Use existing LogBatcher instance instead of creation of own one.
508514
:param truncate_attributes: Truncate test item attributes to default maximum length.
509-
:param oauth_oauth_uri: OAuth 2.0 token endpoint URI (optional, for OAuth authentication).
510-
:param oauth_username: Username for OAuth 2.0 authentication (optional).
511-
:param oauth_password: Password for OAuth 2.0 authentication (optional).
512-
:param oauth_client_id: OAuth 2.0 client ID (optional).
513-
:param oauth_client_secret: OAuth 2.0 client secret (optional).
514-
:param oauth_scope: OAuth 2.0 scope (optional).
515515
"""
516516
set_current(self)
517517
self.api_v1, self.api_v2 = "v1", "v2"
@@ -558,21 +558,21 @@ def __init__(
558558
)
559559
self.api_key = kwargs["token"]
560560

561-
self.oauth_uri = oauth_oauth_uri
561+
self.oauth_uri = oauth_uri
562562
self.oauth_username = oauth_username
563563
self.oauth_password = oauth_password
564564
self.oauth_client_id = oauth_client_id
565565
self.oauth_client_secret = oauth_client_secret
566566
self.oauth_scope = oauth_scope
567567

568568
# Initialize authentication
569-
oauth_params = [oauth_oauth_uri, oauth_username, oauth_password, oauth_client_id]
569+
oauth_params = [oauth_uri, oauth_username, oauth_password, oauth_client_id]
570570
oauth_provided = all(oauth_params)
571571

572572
if oauth_provided:
573573
# Use OAuth 2.0 Password Grant authentication
574574
self.auth = OAuthPasswordGrantSync(
575-
oauth_uri=oauth_oauth_uri,
575+
oauth_uri=oauth_uri,
576576
username=oauth_username,
577577
password=oauth_password,
578578
client_id=oauth_client_id,
@@ -1019,7 +1019,7 @@ def clone(self) -> "RPClient":
10191019
log_batch_payload_size=self.log_batch_payload_size,
10201020
mode=self.mode,
10211021
log_batcher=self._log_batcher,
1022-
oauth_oauth_uri=self.oauth_uri,
1022+
oauth_uri=self.oauth_uri,
10231023
oauth_username=self.oauth_username,
10241024
oauth_password=self.oauth_password,
10251025
oauth_client_id=self.oauth_client_id,

tests/aio/test_aio_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def test_oauth_authentication_parameters():
171171
client = Client(
172172
endpoint="http://endpoint",
173173
project="project",
174-
oauth_oauth_uri="https://example.com/oauth/token",
174+
oauth_uri="https://example.com/oauth/token",
175175
oauth_username="test_user",
176176
oauth_password="test_password",
177177
oauth_client_id="test_client_id",
@@ -194,7 +194,7 @@ def test_oauth_authentication_without_optional_parameters():
194194
client = Client(
195195
endpoint="http://endpoint",
196196
project="project",
197-
oauth_oauth_uri="https://example.com/oauth/token",
197+
oauth_uri="https://example.com/oauth/token",
198198
oauth_username="test_user",
199199
oauth_password="test_password",
200200
oauth_client_id="test_client_id",
@@ -226,7 +226,7 @@ def test_partial_oauth_parameters():
226226
Client(
227227
endpoint="http://endpoint",
228228
project="project",
229-
oauth_oauth_uri="https://example.com/oauth/token",
229+
oauth_uri="https://example.com/oauth/token",
230230
oauth_username="test_user",
231231
oauth_password="test_password",
232232
)
@@ -961,7 +961,7 @@ async def test_oauth_authorization_header():
961961
client = Client(
962962
endpoint=ENDPOINT,
963963
project=PROJECT,
964-
oauth_oauth_uri="https://example.com/oauth/token",
964+
oauth_uri="https://example.com/oauth/token",
965965
oauth_username="test_user",
966966
oauth_password="test_password",
967967
oauth_client_id="test_client_id",

tests/test_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def test_oauth_authentication_parameters():
323323
client = RPClient(
324324
endpoint="http://endpoint",
325325
project="project",
326-
oauth_oauth_uri="https://example.com/oauth/token",
326+
oauth_uri="https://example.com/oauth/token",
327327
oauth_username="test_user",
328328
oauth_password="test_password",
329329
oauth_client_id="test_client_id",
@@ -346,7 +346,7 @@ def test_oauth_authentication_without_optional_parameters():
346346
client = RPClient(
347347
endpoint="http://endpoint",
348348
project="project",
349-
oauth_oauth_uri="https://example.com/oauth/token",
349+
oauth_uri="https://example.com/oauth/token",
350350
oauth_username="test_user",
351351
oauth_password="test_password",
352352
oauth_client_id="test_client_id",
@@ -378,7 +378,7 @@ def test_partial_oauth_parameters():
378378
RPClient(
379379
endpoint="http://endpoint",
380380
project="project",
381-
oauth_oauth_uri="https://example.com/oauth/token",
381+
oauth_uri="https://example.com/oauth/token",
382382
oauth_username="test_user",
383383
oauth_password="test_password",
384384
)
@@ -469,7 +469,7 @@ def test_oauth_authorization_header():
469469
client = RPClient(
470470
endpoint="http://endpoint",
471471
project="project",
472-
oauth_oauth_uri="https://example.com/oauth/token",
472+
oauth_uri="https://example.com/oauth/token",
473473
oauth_username="test_user",
474474
oauth_password="test_password",
475475
oauth_client_id="test_client_id",

0 commit comments

Comments
 (0)