Skip to content

Commit 5d0c55e

Browse files
committed
improve: rename to customer_id
1 parent ed68206 commit 5d0c55e

3 files changed

Lines changed: 16 additions & 14 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import deepinspection
99

1010

1111
client = 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

2727
exports
2828

deepinspection/track/client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,23 @@ def fastenings(self):
4141

4242

4343
class 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())

tests/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55

66
class 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

1212
config = Config()
1313

1414

1515
def 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
)

0 commit comments

Comments
 (0)