artemis-model 0.1.162__tar.gz → 0.1.163__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of artemis-model might be problematic. Click here for more details.

Files changed (36) hide show
  1. {artemis_model-0.1.162 → artemis_model-0.1.163}/PKG-INFO +1 -1
  2. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/redis/__init__.py +2 -0
  3. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/redis/keys.py +6 -3
  4. artemis_model-0.1.163/artemis_model/redis/user.py +8 -0
  5. {artemis_model-0.1.162 → artemis_model-0.1.163}/pyproject.toml +1 -1
  6. {artemis_model-0.1.162 → artemis_model-0.1.163}/README.md +0 -0
  7. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/__init__.py +0 -0
  8. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/album.py +0 -0
  9. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/approved_playlist_list.py +0 -0
  10. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/artist.py +0 -0
  11. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/auth.py +0 -0
  12. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/banned_tracks.py +0 -0
  13. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/base.py +0 -0
  14. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/category.py +0 -0
  15. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/dj_set.py +0 -0
  16. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/genre.py +0 -0
  17. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/location.py +0 -0
  18. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/location_genre_exclusion.py +0 -0
  19. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/message.py +0 -0
  20. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/organization.py +0 -0
  21. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/organization_include_pal_setting.py +0 -0
  22. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/otp.py +0 -0
  23. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/permission.py +0 -0
  24. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/playlist.py +0 -0
  25. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/redis/bucket.py +0 -0
  26. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/redis/device.py +0 -0
  27. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/redis/play_history.py +0 -0
  28. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/redis/zone_state.py +0 -0
  29. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/schedule.py +0 -0
  30. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/setting.py +0 -0
  31. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/sqs/__init__.py +0 -0
  32. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/sqs/messages.py +0 -0
  33. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/track.py +0 -0
  34. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/user.py +0 -0
  35. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/zone.py +0 -0
  36. {artemis_model-0.1.162 → artemis_model-0.1.163}/artemis_model/zone_activity.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: artemis-model
3
- Version: 0.1.162
3
+ Version: 0.1.163
4
4
  Summary:
5
5
  Author: Jukeboxy
6
6
  Requires-Python: >=3.10.6,<4.0.0
@@ -12,6 +12,7 @@ from .zone_state import (
12
12
  from .device import ActiveDevice
13
13
  from .bucket import RedisTrackBucketItem
14
14
  from .play_history import RedisTrackPlayHistoryItem
15
+ from .user import hash_token
15
16
  from .keys import (
16
17
  KEY_ZONE_PLAY_HISTORY_TEMPLATE,
17
18
  KEY_ZONE_PUSH_PLAYLIST_BUCKET_TEMPLATE,
@@ -22,6 +23,7 @@ from .keys import (
22
23
 
23
24
 
24
25
  __all__ = [
26
+ "hash_token",
25
27
  "ZoneState",
26
28
  "NowPlaying",
27
29
  "SessionId",
@@ -1,17 +1,20 @@
1
1
  """Redis keys."""
2
2
 
3
+ KEY_USER_REFRESH_TOKEN_TEMPLATE = "user_{user_id}_rt"
4
+ KEY_ZONE_ACTIVE_DEVICE_TEMPLATE = "zone_{zone_id}_active_devices"
3
5
  KEY_ZONE_PLAY_HISTORY_TEMPLATE = "zone_{zone_id}_play_history"
4
6
  KEY_ZONE_PUSH_PLAYLIST_BUCKET_TEMPLATE = "zone_{zone_id}_pp_bucket_{timeslot_ts}"
5
7
  KEY_ZONE_SCHEDULE_BUCKET_TEMPLATE = "zone_{zone_id}_sc_bucket_{timeslot_ts}"
6
- KEY_ZONE_STATE_TEMPLATE = "zone_{zone_id}_state"
7
- KEY_ZONE_ACTIVE_DEVICE_TEMPLATE = "zone_{zone_id}_active_devices"
8
8
  KEY_ZONE_SKIPPED_TRACKS_TEMPLATE = "zone_{zone_id}_skipped_tracks"
9
+ KEY_ZONE_STATE_TEMPLATE = "zone_{zone_id}_state"
9
10
 
10
11
 
11
12
  __all__ = [
13
+ "KEY_USER_REFRESH_TOKEN_TEMPLATE",
14
+ "KEY_ZONE_ACTIVE_DEVICE_TEMPLATE",
12
15
  "KEY_ZONE_PLAY_HISTORY_TEMPLATE",
13
16
  "KEY_ZONE_PUSH_PLAYLIST_BUCKET_TEMPLATE",
14
17
  "KEY_ZONE_SCHEDULE_BUCKET_TEMPLATE",
18
+ "KEY_ZONE_SKIPPED_TRACKS_TEMPLATE",
15
19
  "KEY_ZONE_STATE_TEMPLATE",
16
- "KEY_ZONE_ACTIVE_DEVICE_TEMPLATE",
17
20
  ]
@@ -0,0 +1,8 @@
1
+ """User related data models and helpers."""
2
+
3
+ import hashlib
4
+
5
+
6
+ def hash_token(token: str) -> str:
7
+ """Hash the given token."""
8
+ return hashlib.sha256(token.encode()).hexdigest()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "artemis-model"
3
- version = "0.1.162"
3
+ version = "0.1.163"
4
4
  description = ""
5
5
  authors = ["Jukeboxy"]
6
6
  readme = "README.md"