Skip to content

Commit 8e19b47

Browse files
committed
fix: Insert missing string to api key header
1 parent 627f3e7 commit 8e19b47

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

notifire/dsn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def api_url(self):
1818

1919
def auth_header(self):
2020
header = [
21-
('notifire_api_key', self.service_api_key),
21+
('notifire_service_api_key', self.service_api_key),
2222
('notifire_timestamp', (datetime.utcnow() - EPOCH)
2323
.total_seconds()),
2424
('notifire_client', constants.CLIENT)

tests/test_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_build_headers(self, time, notifire_client):
1818
'Content-Type': 'application/json',
1919
'Content-Encoding': 'gzip',
2020
'X-Notifire-Auth': (
21-
'Notifire notifire_api_key=service_api_key, '
21+
'Notifire notifire_service_api_key=service_api_key, '
2222
'notifire_timestamp=123456.789, '
2323
'notifire_client={}'.format('notifire-python')
2424
)
@@ -44,7 +44,7 @@ def test_sendNotification(self, time, host, path, notifire_client, _send):
4444
'Content-Type': 'application/json',
4545
'Content-Encoding': 'gzip',
4646
'X-Notifire-Auth': (
47-
'Notifire notifire_api_key=service_api_key, '
47+
'Notifire notifire_service_api_key=service_api_key, '
4848
'notifire_timestamp=123456.789, '
4949
'notifire_client={}'.format('notifire-python')
5050
)
@@ -75,7 +75,7 @@ def test_send(self, time, host, path, notifire_client, _send):
7575
'Content-Type': 'application/json',
7676
'Content-Encoding': 'gzip',
7777
'X-Notifire-Auth': (
78-
'Notifire notifire_api_key=service_api_key, '
78+
'Notifire notifire_service_api_key=service_api_key, '
7979
'notifire_timestamp=123456.789, '
8080
'notifire_client={}'.format('notifire-python')
8181
)

tests/test_dsn.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def test_auth_header(self):
2323
with mock.patch('notifire.dsn.datetime') as time:
2424
time.utcnow().__sub__().total_seconds.return_value = '123456.789'
2525
assert self.dsn.auth_header() == (
26-
'Notifire notifire_api_key={0}, notifire_timestamp={1}, '
26+
'Notifire notifire_service_api_key={0}, '
27+
'notifire_timestamp={1}, '
2728
'notifire_client={2}'
2829
.format(self.service_api_key, '123456.789', constants.CLIENT)
2930
)

0 commit comments

Comments
 (0)