artemis-model 0.1.162__py3-none-any.whl → 0.1.163__py3-none-any.whl

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.

@@ -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
  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
@@ -16,11 +16,12 @@ artemis_model/organization_include_pal_setting.py,sha256=OhNRn4aH96IquJcJBsubvZE
16
16
  artemis_model/otp.py,sha256=guIRGtyFlHUBthCAEsTh5_Hs-1yiGN_qfEO4uHNcv4s,1017
17
17
  artemis_model/permission.py,sha256=Bn1Bg1aCS4Z4_3tqEqvtrzqAYDCImsvmGyIEMoVycEk,1452
18
18
  artemis_model/playlist.py,sha256=O60zlP1LrDkzNrrfNA7TD_kotd5A9i8PuFhwonXFhN0,6559
19
- artemis_model/redis/__init__.py,sha256=hwxNaoTAwFWJxHL6ijp5MOJkapWPv9PEPoY6rtUhCyI,944
19
+ artemis_model/redis/__init__.py,sha256=uagGPkaIkSsCqEFVMYj3kr8d7dWiBNCg0gqe_iqUdgI,991
20
20
  artemis_model/redis/bucket.py,sha256=DlmIf6GxfKq9CzcXmMx5IcviaqOTvuWwIb6lAVcZQGs,1537
21
21
  artemis_model/redis/device.py,sha256=MmCIpBmWxm80CHeZinAXYZOdtPE49xXLo9oRa4FyjcY,505
22
- artemis_model/redis/keys.py,sha256=IdYexbBfBJR9AGtKB5SXFl1fxVY16yYmUXE-feYYT84,634
22
+ artemis_model/redis/keys.py,sha256=B5QMZGLd8BCJLj4cLv3-tREKVhk8UJbufDahl80Xpuk,767
23
23
  artemis_model/redis/play_history.py,sha256=Jm0guS0UZDxfCXeWJ8vqcjjl93W_EeC7XcBXcclKPiE,1259
24
+ artemis_model/redis/user.py,sha256=nhaebEx9uaDZlu7KjfnvnUfGyxFPqc5w4kMbXkp63lI,183
24
25
  artemis_model/redis/zone_state.py,sha256=A5z2ss1-zq6_UHavs6mBgxsllXLz5hYbKCNRAjD-ONw,3152
25
26
  artemis_model/schedule.py,sha256=CkLHWz-BwvUY2EQCfoU4SymgCariPzoQdtRLITqBPmk,2451
26
27
  artemis_model/setting.py,sha256=xe5SHDziY8RzFxzB1GzousxI1FXYhyXZ5proEseS60g,1190
@@ -30,6 +31,6 @@ artemis_model/track.py,sha256=QwUF0QKVn1I64648B-NI75-IzGQvnLt9B0emD4GnS6E,3757
30
31
  artemis_model/user.py,sha256=eqIdCiBJRNLjCwPPCn-gQ6si0O5JUBGfp9oWJL5zVW4,2131
31
32
  artemis_model/zone.py,sha256=iGRUtzUwKh9LHT3MOfzzg1DnkPBts_ZBzZVTi2EmIgs,2282
32
33
  artemis_model/zone_activity.py,sha256=BY4iODavY9ceJ5oRChdjjxf26S3U30Yb7Pxm5YRFpCo,1590
33
- artemis_model-0.1.162.dist-info/METADATA,sha256=3XZN_7l9gN4TsDWsJ8OLH_e99p_ZZEtIR_Gm4IIjYwU,3496
34
- artemis_model-0.1.162.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
35
- artemis_model-0.1.162.dist-info/RECORD,,
34
+ artemis_model-0.1.163.dist-info/METADATA,sha256=NEHYvHPgrd3ZAe-R5e8mF55sO5gmTP_MtZwz8f7vGMk,3496
35
+ artemis_model-0.1.163.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
36
+ artemis_model-0.1.163.dist-info/RECORD,,