Skip to content

Commit def7f11

Browse files
authored
rename audit log to audit trail (#14)
* rename audit log to audit trail * bump version
1 parent 553c6ca commit def7f11

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

tests/test_audit_log.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
import pytest
66

77
import workos
8-
from workos.audit_log import AuditLog
8+
from workos.audit_trail import AuditTrail
99

1010

1111
class TestSSO(object):
1212
@pytest.fixture(autouse=True)
1313
def setup(self, set_api_key_and_project_id):
14-
self.audit_log = AuditLog()
14+
self.audit_trail = AuditTrail()
1515

16-
def test_create_audit_log_event_succeeds(self, mock_request_method):
16+
def test_create_audit_trail_event_succeeds(self, mock_request_method):
1717
event = {
1818
"group": "Terrace House",
1919
"location": "1.1.1.1",
@@ -29,10 +29,10 @@ def test_create_audit_log_event_succeeds(self, mock_request_method):
2929
mock_response = Response()
3030
mock_response.status_code = 200
3131
mock_request_method("post", mock_response, 200)
32-
response = self.audit_log.create_event(event)
32+
response = self.audit_trail.create_event(event)
3333
assert response.status_code == 200
3434

35-
def test_create_audit_log_event_fails_with_long_metadata(self):
35+
def test_create_audit_trail_event_fails_with_long_metadata(self):
3636
with pytest.raises(Exception, match=r"Number of metadata keys exceeds .*"):
3737
metadata = {str(num): num for num in range(51)}
3838
event = {
@@ -47,4 +47,4 @@ def test_create_audit_log_event_fails_with_long_metadata(self):
4747
"occurred_at": datetime.utcnow().isoformat(),
4848
"metadata": metadata,
4949
}
50-
self.audit_log.create_event(event)
50+
self.audit_trail.create_event(event)

tests/test_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ class TestClient(object):
88
@pytest.fixture(autouse=True)
99
def setup(self):
1010
client._sso = None
11-
client._audit_log = None
11+
client._audit_trail = None
1212

1313
def test_initialize_sso(self, set_api_key_and_project_id):
1414
assert bool(client.sso)
1515

1616
def test_initialize_audit_log(self, set_api_key_and_project_id):
17-
assert bool(client.audit_log)
17+
assert bool(client.audit_trail)
1818

1919
def test_initialize_sso_missing_api_key(self, set_project_id):
2020
with pytest.raises(ConfigurationException) as ex:
@@ -42,9 +42,9 @@ def test_initialize_sso_missing_api_key_and_project_id(self):
4242

4343
assert all(setting in message for setting in ("api_key", "project_id",))
4444

45-
def test_initialize_audit_log_missing_api_key(self):
45+
def test_initialize_audit_trail_missing_api_key(self):
4646
with pytest.raises(ConfigurationException) as ex:
47-
client.audit_log
47+
client.audit_trail
4848

4949
message = str(ex)
5050

workos/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
__package_url__ = "https://github.com/workos-inc/workos-python"
1414

15-
__version__ = "0.1.1"
15+
__version__ = "0.2.0"
1616

1717
__author__ = "WorkOS"
1818

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import workos
22
from workos.exceptions import ConfigurationException
33
from workos.utils.request import RequestHelper, REQUEST_METHOD_POST
4-
from workos.utils.validation import AUDIT_LOG_MODULE, validate_settings
4+
from workos.utils.validation import AUDIT_TRAIL_MODULE, validate_settings
55

66
EVENTS_PATH = "events"
77
METADATA_LIMIT = 50
88

99

10-
class AuditLog(object):
11-
"""Offers methods through the WorkOS Audit Log service."""
10+
class AuditTrail(object):
11+
"""Offers methods through the WorkOS Audit Trail service."""
1212

13-
@validate_settings(AUDIT_LOG_MODULE)
13+
@validate_settings(AUDIT_TRAIL_MODULE)
1414
def __init__(self):
1515
pass
1616

@@ -21,7 +21,7 @@ def request_helper(self):
2121
return self._request_helper
2222

2323
def create_event(self, event, idempotency_key=None):
24-
"""Create an Audit Log event.
24+
"""Create an Audit Trail event.
2525
2626
Args:
2727
event (dict) - An event object

workos/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from workos.audit_log import AuditLog
1+
from workos.audit_trail import AuditTrail
22
from workos.sso import SSO
33

44

@@ -12,10 +12,10 @@ def sso(self):
1212
return self._sso
1313

1414
@property
15-
def audit_log(self):
16-
if not getattr(self, "_audit_log", None):
17-
self._audit_log = AuditLog()
18-
return self._audit_log
15+
def audit_trail(self):
16+
if not getattr(self, "_audit_trail", None):
17+
self._audit_trail = AuditTrail()
18+
return self._audit_trail
1919

2020

2121
client = Client()

workos/utils/validation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
import workos
44
from workos.exceptions import ConfigurationException
55

6-
AUDIT_LOG_MODULE = "AuditLog"
6+
AUDIT_TRAIL_MODULE = "AuditTrail"
77
SSO_MODULE = "SSO"
88

99
REQUIRED_SETTINGS_FOR_MODULE = {
10-
AUDIT_LOG_MODULE: ["api_key",],
10+
AUDIT_TRAIL_MODULE: ["api_key",],
1111
SSO_MODULE: ["api_key", "project_id",],
1212
}
1313

0 commit comments

Comments
 (0)