File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ import deepinspection
99
1010
1111client = deepinspection.track.client(
12- deepinspection_customer = " customer-identifier " ,
13- deepinspection_client_id = " XYZ" ,
14- deepinspection_client_secret = " XYZ" ,
12+ customer_id = " customer-id " ,
13+ client_id = " XYZ" ,
14+ client_secret = " XYZ" ,
1515)
1616
1717# list exports
@@ -22,7 +22,7 @@ for line in client.exports.fastenings.get_data(exports[0]["id"]):
2222 pass
2323```
2424
25- _ The customer identifier should match with the website url ` https://customer-identifier .track.deepinspection.io/ ` ._
25+ _ The customer id should match with the website url ` https://customer-id .track.deepinspection.io/ ` ._
2626
2727exports
2828
Original file line number Diff line number Diff line change @@ -41,21 +41,23 @@ def fastenings(self):
4141
4242
4343class DeepInspectionTrackClient (BaseModel ):
44- customer_identifier : str
44+ customer_id : str
4545 client_id : str
4646 client_secret : str
4747
4848 def base_url (self ):
49- return f"https://{ self .customer_identifier } .api.track.deepinspection.io/external/v0-alpha"
49+ return (
50+ f"https://{ self .customer_id } .api.track.deepinspection.io/external/v0-alpha"
51+ )
5052
5153 def auth_headers (self ):
5254 return {
5355 "Authorization" : f"Bearer { self .access_token ()} " ,
54- "X-Customer-ID" : self .customer_identifier ,
56+ "X-Customer-ID" : self .customer_id ,
5557 }
5658
5759 def openid_connect_url (self ):
58- return f"https://auth.nextml.com/auth/realms/deepinspection-track-{ self .customer_identifier } /.well-known/openid-configuration"
60+ return f"https://auth.nextml.com/auth/realms/deepinspection-track-{ self .customer_id } /.well-known/openid-configuration"
5961
6062 def access_token (self ) -> str :
6163 response = requests .get (self .openid_connect_url ())
Original file line number Diff line number Diff line change 44
55
66class Config (BaseSettings , env_file = ".env.development.secrets" ):
7- deepinspection_customer : str
8- deepinspection_client_id : str
9- deepinspection_client_secret : str
7+ customer_id : str
8+ client_id : str
9+ client_secret : str
1010
1111
1212config = Config ()
1313
1414
1515def track ():
1616 return deepinspection .track .client (
17- customer_identifier = config .deepinspection_customer ,
18- client_id = config .deepinspection_client_id ,
19- client_secret = config .deepinspection_client_secret ,
17+ customer_id = config .customer_id ,
18+ client_id = config .client_id ,
19+ client_secret = config .client_secret ,
2020 )
You can’t perform that action at this time.
0 commit comments