@@ -69,8 +69,6 @@ class Finch(SyncAPIClient):
69
69
access_token : str | None
70
70
client_id : str | None
71
71
client_secret : str | None
72
- sandbox_client_id : str | None
73
- sandbox_client_secret : str | None
74
72
webhook_secret : str | None
75
73
76
74
def __init__ (
@@ -79,8 +77,6 @@ def __init__(
79
77
access_token : str | None = None ,
80
78
client_id : str | None = None ,
81
79
client_secret : str | None = None ,
82
- sandbox_client_id : str | None = None ,
83
- sandbox_client_secret : str | None = None ,
84
80
webhook_secret : str | None = None ,
85
81
base_url : str | httpx .URL | None = None ,
86
82
timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
@@ -112,8 +108,6 @@ def __init__(
112
108
This automatically infers the following arguments from their corresponding environment variables if they are not provided:
113
109
- `client_id` from `FINCH_CLIENT_ID`
114
110
- `client_secret` from `FINCH_CLIENT_SECRET`
115
- - `sandbox_client_id` from `FINCH_SANDBOX_CLIENT_ID`
116
- - `sandbox_client_secret` from `FINCH_SANDBOX_CLIENT_SECRET`
117
111
- `webhook_secret` from `FINCH_WEBHOOK_SECRET`
118
112
"""
119
113
self .access_token = access_token
@@ -126,14 +120,6 @@ def __init__(
126
120
client_secret = os .environ .get ("FINCH_CLIENT_SECRET" )
127
121
self .client_secret = client_secret
128
122
129
- if sandbox_client_id is None :
130
- sandbox_client_id = os .environ .get ("FINCH_SANDBOX_CLIENT_ID" )
131
- self .sandbox_client_id = sandbox_client_id
132
-
133
- if sandbox_client_secret is None :
134
- sandbox_client_secret = os .environ .get ("FINCH_SANDBOX_CLIENT_SECRET" )
135
- self .sandbox_client_secret = sandbox_client_secret
136
-
137
123
if webhook_secret is None :
138
124
webhook_secret = os .environ .get ("FINCH_WEBHOOK_SECRET" )
139
125
self .webhook_secret = webhook_secret
@@ -193,11 +179,11 @@ def _bearer_auth(self) -> dict[str, str]:
193
179
194
180
@property
195
181
def _basic_auth (self ) -> dict [str , str ]:
196
- if self .sandbox_client_id is None :
182
+ if self .client_id is None :
197
183
return {}
198
- if self .sandbox_client_secret is None :
184
+ if self .client_secret is None :
199
185
return {}
200
- credentials = f"{ self .sandbox_client_id } :{ self .sandbox_client_secret } " .encode ("ascii" )
186
+ credentials = f"{ self .client_id } :{ self .client_secret } " .encode ("ascii" )
201
187
header = f"Basic { base64 .b64encode (credentials ).decode ('ascii' )} "
202
188
return {"Authorization" : header }
203
189
@@ -218,13 +204,13 @@ def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None:
218
204
if isinstance (custom_headers .get ("Authorization" ), Omit ):
219
205
return
220
206
221
- if self .sandbox_client_id and self .sandbox_client_secret and headers .get ("Authorization" ):
207
+ if self .client_id and self .client_secret and headers .get ("Authorization" ):
222
208
return
223
209
if isinstance (custom_headers .get ("Authorization" ), Omit ):
224
210
return
225
211
226
212
raise TypeError (
227
- '"Could not resolve authentication method. Expected either access_token, sandbox_client_id or sandbox_client_secret to be set. Or for one of the `Authorization` or `Authorization` headers to be explicitly omitted"'
213
+ '"Could not resolve authentication method. Expected either access_token, client_id or client_secret to be set. Or for one of the `Authorization` or `Authorization` headers to be explicitly omitted"'
228
214
)
229
215
230
216
def copy (
@@ -233,8 +219,6 @@ def copy(
233
219
access_token : str | None = None ,
234
220
client_id : str | None = None ,
235
221
client_secret : str | None = None ,
236
- sandbox_client_id : str | None = None ,
237
- sandbox_client_secret : str | None = None ,
238
222
webhook_secret : str | None = None ,
239
223
base_url : str | httpx .URL | None = None ,
240
224
timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
@@ -290,8 +274,6 @@ def copy(
290
274
access_token = access_token or self .access_token ,
291
275
client_id = client_id or self .client_id ,
292
276
client_secret = client_secret or self .client_secret ,
293
- sandbox_client_id = sandbox_client_id or self .sandbox_client_id ,
294
- sandbox_client_secret = sandbox_client_secret or self .sandbox_client_secret ,
295
277
webhook_secret = webhook_secret or self .webhook_secret ,
296
278
base_url = base_url or self .base_url ,
297
279
timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
@@ -423,8 +405,6 @@ class AsyncFinch(AsyncAPIClient):
423
405
access_token : str | None
424
406
client_id : str | None
425
407
client_secret : str | None
426
- sandbox_client_id : str | None
427
- sandbox_client_secret : str | None
428
408
webhook_secret : str | None
429
409
430
410
def __init__ (
@@ -433,8 +413,6 @@ def __init__(
433
413
access_token : str | None = None ,
434
414
client_id : str | None = None ,
435
415
client_secret : str | None = None ,
436
- sandbox_client_id : str | None = None ,
437
- sandbox_client_secret : str | None = None ,
438
416
webhook_secret : str | None = None ,
439
417
base_url : str | httpx .URL | None = None ,
440
418
timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
@@ -466,8 +444,6 @@ def __init__(
466
444
This automatically infers the following arguments from their corresponding environment variables if they are not provided:
467
445
- `client_id` from `FINCH_CLIENT_ID`
468
446
- `client_secret` from `FINCH_CLIENT_SECRET`
469
- - `sandbox_client_id` from `FINCH_SANDBOX_CLIENT_ID`
470
- - `sandbox_client_secret` from `FINCH_SANDBOX_CLIENT_SECRET`
471
447
- `webhook_secret` from `FINCH_WEBHOOK_SECRET`
472
448
"""
473
449
self .access_token = access_token
@@ -480,14 +456,6 @@ def __init__(
480
456
client_secret = os .environ .get ("FINCH_CLIENT_SECRET" )
481
457
self .client_secret = client_secret
482
458
483
- if sandbox_client_id is None :
484
- sandbox_client_id = os .environ .get ("FINCH_SANDBOX_CLIENT_ID" )
485
- self .sandbox_client_id = sandbox_client_id
486
-
487
- if sandbox_client_secret is None :
488
- sandbox_client_secret = os .environ .get ("FINCH_SANDBOX_CLIENT_SECRET" )
489
- self .sandbox_client_secret = sandbox_client_secret
490
-
491
459
if webhook_secret is None :
492
460
webhook_secret = os .environ .get ("FINCH_WEBHOOK_SECRET" )
493
461
self .webhook_secret = webhook_secret
@@ -547,11 +515,11 @@ def _bearer_auth(self) -> dict[str, str]:
547
515
548
516
@property
549
517
def _basic_auth (self ) -> dict [str , str ]:
550
- if self .sandbox_client_id is None :
518
+ if self .client_id is None :
551
519
return {}
552
- if self .sandbox_client_secret is None :
520
+ if self .client_secret is None :
553
521
return {}
554
- credentials = f"{ self .sandbox_client_id } :{ self .sandbox_client_secret } " .encode ("ascii" )
522
+ credentials = f"{ self .client_id } :{ self .client_secret } " .encode ("ascii" )
555
523
header = f"Basic { base64 .b64encode (credentials ).decode ('ascii' )} "
556
524
return {"Authorization" : header }
557
525
@@ -572,13 +540,13 @@ def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None:
572
540
if isinstance (custom_headers .get ("Authorization" ), Omit ):
573
541
return
574
542
575
- if self .sandbox_client_id and self .sandbox_client_secret and headers .get ("Authorization" ):
543
+ if self .client_id and self .client_secret and headers .get ("Authorization" ):
576
544
return
577
545
if isinstance (custom_headers .get ("Authorization" ), Omit ):
578
546
return
579
547
580
548
raise TypeError (
581
- '"Could not resolve authentication method. Expected either access_token, sandbox_client_id or sandbox_client_secret to be set. Or for one of the `Authorization` or `Authorization` headers to be explicitly omitted"'
549
+ '"Could not resolve authentication method. Expected either access_token, client_id or client_secret to be set. Or for one of the `Authorization` or `Authorization` headers to be explicitly omitted"'
582
550
)
583
551
584
552
def copy (
@@ -587,8 +555,6 @@ def copy(
587
555
access_token : str | None = None ,
588
556
client_id : str | None = None ,
589
557
client_secret : str | None = None ,
590
- sandbox_client_id : str | None = None ,
591
- sandbox_client_secret : str | None = None ,
592
558
webhook_secret : str | None = None ,
593
559
base_url : str | httpx .URL | None = None ,
594
560
timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
@@ -644,8 +610,6 @@ def copy(
644
610
access_token = access_token or self .access_token ,
645
611
client_id = client_id or self .client_id ,
646
612
client_secret = client_secret or self .client_secret ,
647
- sandbox_client_id = sandbox_client_id or self .sandbox_client_id ,
648
- sandbox_client_secret = sandbox_client_secret or self .sandbox_client_secret ,
649
613
webhook_secret = webhook_secret or self .webhook_secret ,
650
614
base_url = base_url or self .base_url ,
651
615
timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
0 commit comments