mc5-api-client 1.0.10__tar.gz → 1.0.12__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.
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/PKG-INFO +92 -36
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/README.md +91 -35
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/pyproject.toml +1 -1
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client/__init__.py +57 -2
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client/auth.py +92 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client/cli.py +1 -1
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client.egg-info/PKG-INFO +92 -36
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/.gitignore +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/CHANGELOG.md +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/LICENSE +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/MANIFEST.in +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/admin_squad_management.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/advanced_automation.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/advanced_features.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/basic_usage.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/clan_management.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/clan_management_complete.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/events_and_tasks.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/help_system.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/message_management.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/player_stats.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/private_messaging.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/quick_help.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/simple_usage.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/squad_management.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/examples/squad_wall_management.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/pytest.ini +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/requirements-dev.txt +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/requirements.txt +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/setup.cfg +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/setup.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client/admin_client.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client/client.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client/exceptions.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client/help.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client/py.typed +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client/simple_client.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client.egg-info/SOURCES.txt +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client.egg-info/dependency_links.txt +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client.egg-info/entry_points.txt +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client.egg-info/not-zip-safe +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client.egg-info/requires.txt +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client.egg-info/top_level.txt +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/tests/__init__.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/tests/test_auth.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/tests/test_cli.py +0 -0
- {mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/tests/test_client.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mc5_api_client
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.12
|
|
4
4
|
Summary: A comprehensive Python library for interacting with the Modern Combat 5 API
|
|
5
5
|
Home-page: https://pypi.org/project/mc5-api-client/
|
|
6
6
|
Author: Chizoba
|
|
@@ -108,9 +108,9 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
|
|
|
108
108
|
- ⚡ **One-Liner Functions**: Quick search and kick operations!
|
|
109
109
|
- 🎯 **User-Friendly**: Designed for beginners and clan leaders!
|
|
110
110
|
- 🚀 **NEW: Admin Capabilities**: Use admin credentials for enhanced squad management!
|
|
111
|
-
- ⭐ **NEW: Squad Rating**: Add 5200+ rating to your squad with admin privileges!
|
|
112
111
|
- 🎯 **NEW: Player Score Updates**: Update any player's score, XP, and kill signatures!
|
|
113
112
|
- 🛡️ **NEW: Built-in Help System**: Comprehensive help commands and examples!
|
|
113
|
+
- 🔐 **NEW: Encrypted Token Support**: Generate and encrypt tokens for additional security!
|
|
114
114
|
|
|
115
115
|
## 🚀 Installation
|
|
116
116
|
|
|
@@ -122,14 +122,14 @@ pip install mc5_api_client==1.0.8
|
|
|
122
122
|
|
|
123
123
|
### ✅ **Major Enhancements Completed!**
|
|
124
124
|
|
|
125
|
-
**🚀 Advanced Automation Features (NEW in v1.0.8):**
|
|
125
|
+
**🚀 Advanced Automation Features (NEW in v1.0.8+):**
|
|
126
126
|
- ✅ **AdminMC5Client**: Enhanced client with admin privileges
|
|
127
|
-
- ✅ **
|
|
128
|
-
- ✅ **Player Score Updates**: Update any player's score, XP, and kill signatures
|
|
127
|
+
- ✅ **Player Score Management**: Update individual player scores, XP, and kill signatures
|
|
129
128
|
- ✅ **Batch Processing**: Search multiple players with loops and conditionals
|
|
130
129
|
- ✅ **Real-time Monitoring**: Continuous activity tracking with while loops
|
|
131
130
|
- ✅ **Smart Clan Cleanup**: Intelligent member management with safety features
|
|
132
131
|
- ✅ **Built-in Help System**: Comprehensive help commands and examples
|
|
132
|
+
- ✅ **Encrypted Token Support**: Generate and encrypt tokens for additional security
|
|
133
133
|
- ✅ **Production Ready**: Thoroughly tested and verified for production use
|
|
134
134
|
|
|
135
135
|
**🎮 Revolutionary Simple Interface (from v1.0.7):**
|
|
@@ -174,12 +174,11 @@ pip install mc5_api_client
|
|
|
174
174
|
|
|
175
175
|
New in v1.0.8! Powerful admin capabilities for enhanced squad management:
|
|
176
176
|
|
|
177
|
-
### **⭐
|
|
178
|
-
|
|
177
|
+
### **⭐ Update Player Scores (Admin Only):**
|
|
179
178
|
```python
|
|
180
179
|
from mc5_api_client import quick_update_player_score
|
|
181
180
|
|
|
182
|
-
#
|
|
181
|
+
# Update any player's score, XP, and kill signature
|
|
183
182
|
result = quick_update_player_score(
|
|
184
183
|
target_user_id="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
185
184
|
score=5200,
|
|
@@ -188,48 +187,47 @@ result = quick_update_player_score(
|
|
|
188
187
|
killsig_id="default_killsig_80"
|
|
189
188
|
)
|
|
190
189
|
|
|
191
|
-
|
|
190
|
+
if result.get('success'):
|
|
191
|
+
print("✅ Player score updated successfully!")
|
|
192
|
+
print(f"New score: {result.get('score')}")
|
|
193
|
+
print(f"New XP: {result.get('xp')}")
|
|
192
194
|
```
|
|
193
195
|
|
|
194
|
-
###
|
|
195
|
-
|
|
196
|
+
### **� Admin Client Usage:**
|
|
196
197
|
```python
|
|
197
198
|
from mc5_api_client import create_admin_client
|
|
198
199
|
|
|
199
|
-
# Create admin client with
|
|
200
|
+
# Create admin client with elevated privileges
|
|
200
201
|
client = create_admin_client()
|
|
201
202
|
client.connect()
|
|
202
203
|
|
|
203
|
-
# Update
|
|
204
|
+
# Update player information
|
|
204
205
|
result = client.update_player_score(
|
|
205
206
|
target_user_id="player_user_id",
|
|
206
207
|
score=10000,
|
|
207
|
-
xp=5000000
|
|
208
|
+
xp=5000000,
|
|
209
|
+
killsig_color="16777215",
|
|
210
|
+
killsig_id="default_killsig_42"
|
|
208
211
|
)
|
|
209
212
|
|
|
210
|
-
# Get squad members
|
|
213
|
+
# Get squad members (if you have access)
|
|
211
214
|
members = client.get_squad_members()
|
|
212
|
-
print(f"
|
|
215
|
+
print(f"Found {len(members)} squad members")
|
|
216
|
+
|
|
217
|
+
# Kick members (if you have permissions)
|
|
218
|
+
# client.kick_member("member_user_id", "Reason for kick")
|
|
213
219
|
|
|
214
220
|
client.close()
|
|
215
221
|
```
|
|
216
222
|
|
|
217
|
-
###
|
|
223
|
+
### **⚠️ Important Admin Limitations:**
|
|
224
|
+
- ✅ **Can Update**: Individual player scores, XP, kill signatures
|
|
225
|
+
- ✅ **Can Kick**: Squad members (with proper permissions)
|
|
226
|
+
- ❌ **Cannot Edit**: Squad rating directly (requires squad ownership)
|
|
227
|
+
- ❌ **Cannot Modify**: Squad settings (requires squad ownership)
|
|
218
228
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
# Add rating using admin credentials
|
|
223
|
-
result = quick_add_squad_rating(
|
|
224
|
-
username="game:mc5_system",
|
|
225
|
-
password="admin",
|
|
226
|
-
rating=5200,
|
|
227
|
-
use_admin=True
|
|
228
|
-
)
|
|
229
|
-
|
|
230
|
-
if 'error' not in result:
|
|
231
|
-
print("✅ 5200 rating added to squad!")
|
|
232
|
-
```
|
|
229
|
+
### **🔧 How It Actually Works:**
|
|
230
|
+
Admin privileges allow you to modify individual player data within a squad, which indirectly affects the squad's overall rating through the sum of member scores, but you cannot directly set the squad's rating value.
|
|
233
231
|
|
|
234
232
|
## 🎮 **Simple Usage for Non-Developers**
|
|
235
233
|
|
|
@@ -400,8 +398,7 @@ client.connect()
|
|
|
400
398
|
player = client.search_player('f55f')
|
|
401
399
|
|
|
402
400
|
# 🔹 Admin Operations
|
|
403
|
-
quick_update_player_score('user_id', 5200)
|
|
404
|
-
quick_add_squad_rating('admin', 'admin', 5200, use_admin=True)
|
|
401
|
+
quick_update_player_score('user_id', 5200, xp=2037745)
|
|
405
402
|
|
|
406
403
|
# 🔹 Error Handling
|
|
407
404
|
try: except AuthenticationError:
|
|
@@ -413,15 +410,16 @@ try: except MC5APIError:
|
|
|
413
410
|
### **🚀 Install from PyPI (Recommended)**
|
|
414
411
|
|
|
415
412
|
```bash
|
|
416
|
-
pip install mc5_api_client==1.0.
|
|
413
|
+
pip install mc5_api_client==1.0.12
|
|
417
414
|
```
|
|
418
415
|
|
|
419
|
-
✅ **Published and Available!** The MC5 API Client v1.0.
|
|
416
|
+
✅ **Published and Available!** The MC5 API Client v1.0.12 is now live on PyPI with accurate admin capabilities, encrypted token support, and corrected documentation!
|
|
420
417
|
|
|
421
418
|
### **� Install from Local Package**
|
|
422
419
|
|
|
423
420
|
```bash
|
|
424
421
|
# Install the wheel file you just created
|
|
422
|
+
pip install dist/mc5_api_client-1.0.10-py3-none-any.whl
|
|
425
423
|
pip install dist/mc5_api_client-1.0.8-py3-none-any.whl
|
|
426
424
|
|
|
427
425
|
# Or install from source
|
|
@@ -809,7 +807,65 @@ for event in events:
|
|
|
809
807
|
print(f" Task {i+1}: {points} points")
|
|
810
808
|
```
|
|
811
809
|
|
|
812
|
-
###
|
|
810
|
+
### 🔐 **Encrypted Token Support**
|
|
811
|
+
|
|
812
|
+
For users who prefer additional security, the module now supports token encryption:
|
|
813
|
+
|
|
814
|
+
```python
|
|
815
|
+
from mc5_api_client import quick_generate_encrypted_token, quick_encrypt_token
|
|
816
|
+
|
|
817
|
+
# Generate and encrypt a token in one step
|
|
818
|
+
encrypted_data = quick_generate_encrypted_token(
|
|
819
|
+
username="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
820
|
+
password="sSJKzhQ5l4vrFgov",
|
|
821
|
+
nonce="*" # Custom nonce value (optional)
|
|
822
|
+
)
|
|
823
|
+
|
|
824
|
+
print(f"Token ID: {encrypted_data['token_id']}")
|
|
825
|
+
print(f"Encrypted Token: {encrypted_data['encrypted_token']}")
|
|
826
|
+
print(f"Expires: {encrypted_data['expires_at']}")
|
|
827
|
+
|
|
828
|
+
# Encrypt an existing token
|
|
829
|
+
existing_token = "your_raw_access_token_here"
|
|
830
|
+
encrypted_token = quick_encrypt_token(existing_token, "*")
|
|
831
|
+
print(f"Encrypted: {encrypted_token}")
|
|
832
|
+
```
|
|
833
|
+
|
|
834
|
+
**Advanced TokenGenerator Usage:**
|
|
835
|
+
|
|
836
|
+
```python
|
|
837
|
+
from mc5_api_client import TokenGenerator
|
|
838
|
+
|
|
839
|
+
# Create token generator with custom settings
|
|
840
|
+
token_gen = TokenGenerator(
|
|
841
|
+
encrypt_url="https://eur-janus.gameloft.com/encrypt_token"
|
|
842
|
+
)
|
|
843
|
+
|
|
844
|
+
try:
|
|
845
|
+
# Generate encrypted token
|
|
846
|
+
result = token_gen.generate_encrypted_token(
|
|
847
|
+
username="anonymous:credential",
|
|
848
|
+
password="password",
|
|
849
|
+
nonce="custom_nonce"
|
|
850
|
+
)
|
|
851
|
+
|
|
852
|
+
# Or encrypt existing token
|
|
853
|
+
encrypted = token_gen.encrypt_token(
|
|
854
|
+
access_token="raw_token",
|
|
855
|
+
nonce="custom_nonce"
|
|
856
|
+
)
|
|
857
|
+
|
|
858
|
+
finally:
|
|
859
|
+
token_gen.close() # Always close the session
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
**Security Benefits:**
|
|
863
|
+
- ✅ **Additional Layer**: Tokens are encrypted before transmission
|
|
864
|
+
- ✅ **Custom Nonce**: Support for custom nonce values
|
|
865
|
+
- ✅ **Backward Compatible**: Works with existing authentication flow
|
|
866
|
+
- ✅ **Error Handling**: Proper validation and error recovery
|
|
867
|
+
|
|
868
|
+
### 🏆 **Checking Leaderboards**
|
|
813
869
|
|
|
814
870
|
See how you stack up:
|
|
815
871
|
|
|
@@ -30,9 +30,9 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
|
|
|
30
30
|
- ⚡ **One-Liner Functions**: Quick search and kick operations!
|
|
31
31
|
- 🎯 **User-Friendly**: Designed for beginners and clan leaders!
|
|
32
32
|
- 🚀 **NEW: Admin Capabilities**: Use admin credentials for enhanced squad management!
|
|
33
|
-
- ⭐ **NEW: Squad Rating**: Add 5200+ rating to your squad with admin privileges!
|
|
34
33
|
- 🎯 **NEW: Player Score Updates**: Update any player's score, XP, and kill signatures!
|
|
35
34
|
- 🛡️ **NEW: Built-in Help System**: Comprehensive help commands and examples!
|
|
35
|
+
- 🔐 **NEW: Encrypted Token Support**: Generate and encrypt tokens for additional security!
|
|
36
36
|
|
|
37
37
|
## 🚀 Installation
|
|
38
38
|
|
|
@@ -44,14 +44,14 @@ pip install mc5_api_client==1.0.8
|
|
|
44
44
|
|
|
45
45
|
### ✅ **Major Enhancements Completed!**
|
|
46
46
|
|
|
47
|
-
**🚀 Advanced Automation Features (NEW in v1.0.8):**
|
|
47
|
+
**🚀 Advanced Automation Features (NEW in v1.0.8+):**
|
|
48
48
|
- ✅ **AdminMC5Client**: Enhanced client with admin privileges
|
|
49
|
-
- ✅ **
|
|
50
|
-
- ✅ **Player Score Updates**: Update any player's score, XP, and kill signatures
|
|
49
|
+
- ✅ **Player Score Management**: Update individual player scores, XP, and kill signatures
|
|
51
50
|
- ✅ **Batch Processing**: Search multiple players with loops and conditionals
|
|
52
51
|
- ✅ **Real-time Monitoring**: Continuous activity tracking with while loops
|
|
53
52
|
- ✅ **Smart Clan Cleanup**: Intelligent member management with safety features
|
|
54
53
|
- ✅ **Built-in Help System**: Comprehensive help commands and examples
|
|
54
|
+
- ✅ **Encrypted Token Support**: Generate and encrypt tokens for additional security
|
|
55
55
|
- ✅ **Production Ready**: Thoroughly tested and verified for production use
|
|
56
56
|
|
|
57
57
|
**🎮 Revolutionary Simple Interface (from v1.0.7):**
|
|
@@ -96,12 +96,11 @@ pip install mc5_api_client
|
|
|
96
96
|
|
|
97
97
|
New in v1.0.8! Powerful admin capabilities for enhanced squad management:
|
|
98
98
|
|
|
99
|
-
### **⭐
|
|
100
|
-
|
|
99
|
+
### **⭐ Update Player Scores (Admin Only):**
|
|
101
100
|
```python
|
|
102
101
|
from mc5_api_client import quick_update_player_score
|
|
103
102
|
|
|
104
|
-
#
|
|
103
|
+
# Update any player's score, XP, and kill signature
|
|
105
104
|
result = quick_update_player_score(
|
|
106
105
|
target_user_id="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
107
106
|
score=5200,
|
|
@@ -110,48 +109,47 @@ result = quick_update_player_score(
|
|
|
110
109
|
killsig_id="default_killsig_80"
|
|
111
110
|
)
|
|
112
111
|
|
|
113
|
-
|
|
112
|
+
if result.get('success'):
|
|
113
|
+
print("✅ Player score updated successfully!")
|
|
114
|
+
print(f"New score: {result.get('score')}")
|
|
115
|
+
print(f"New XP: {result.get('xp')}")
|
|
114
116
|
```
|
|
115
117
|
|
|
116
|
-
###
|
|
117
|
-
|
|
118
|
+
### **� Admin Client Usage:**
|
|
118
119
|
```python
|
|
119
120
|
from mc5_api_client import create_admin_client
|
|
120
121
|
|
|
121
|
-
# Create admin client with
|
|
122
|
+
# Create admin client with elevated privileges
|
|
122
123
|
client = create_admin_client()
|
|
123
124
|
client.connect()
|
|
124
125
|
|
|
125
|
-
# Update
|
|
126
|
+
# Update player information
|
|
126
127
|
result = client.update_player_score(
|
|
127
128
|
target_user_id="player_user_id",
|
|
128
129
|
score=10000,
|
|
129
|
-
xp=5000000
|
|
130
|
+
xp=5000000,
|
|
131
|
+
killsig_color="16777215",
|
|
132
|
+
killsig_id="default_killsig_42"
|
|
130
133
|
)
|
|
131
134
|
|
|
132
|
-
# Get squad members
|
|
135
|
+
# Get squad members (if you have access)
|
|
133
136
|
members = client.get_squad_members()
|
|
134
|
-
print(f"
|
|
137
|
+
print(f"Found {len(members)} squad members")
|
|
138
|
+
|
|
139
|
+
# Kick members (if you have permissions)
|
|
140
|
+
# client.kick_member("member_user_id", "Reason for kick")
|
|
135
141
|
|
|
136
142
|
client.close()
|
|
137
143
|
```
|
|
138
144
|
|
|
139
|
-
###
|
|
145
|
+
### **⚠️ Important Admin Limitations:**
|
|
146
|
+
- ✅ **Can Update**: Individual player scores, XP, kill signatures
|
|
147
|
+
- ✅ **Can Kick**: Squad members (with proper permissions)
|
|
148
|
+
- ❌ **Cannot Edit**: Squad rating directly (requires squad ownership)
|
|
149
|
+
- ❌ **Cannot Modify**: Squad settings (requires squad ownership)
|
|
140
150
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
# Add rating using admin credentials
|
|
145
|
-
result = quick_add_squad_rating(
|
|
146
|
-
username="game:mc5_system",
|
|
147
|
-
password="admin",
|
|
148
|
-
rating=5200,
|
|
149
|
-
use_admin=True
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
if 'error' not in result:
|
|
153
|
-
print("✅ 5200 rating added to squad!")
|
|
154
|
-
```
|
|
151
|
+
### **🔧 How It Actually Works:**
|
|
152
|
+
Admin privileges allow you to modify individual player data within a squad, which indirectly affects the squad's overall rating through the sum of member scores, but you cannot directly set the squad's rating value.
|
|
155
153
|
|
|
156
154
|
## 🎮 **Simple Usage for Non-Developers**
|
|
157
155
|
|
|
@@ -322,8 +320,7 @@ client.connect()
|
|
|
322
320
|
player = client.search_player('f55f')
|
|
323
321
|
|
|
324
322
|
# 🔹 Admin Operations
|
|
325
|
-
quick_update_player_score('user_id', 5200)
|
|
326
|
-
quick_add_squad_rating('admin', 'admin', 5200, use_admin=True)
|
|
323
|
+
quick_update_player_score('user_id', 5200, xp=2037745)
|
|
327
324
|
|
|
328
325
|
# 🔹 Error Handling
|
|
329
326
|
try: except AuthenticationError:
|
|
@@ -335,15 +332,16 @@ try: except MC5APIError:
|
|
|
335
332
|
### **🚀 Install from PyPI (Recommended)**
|
|
336
333
|
|
|
337
334
|
```bash
|
|
338
|
-
pip install mc5_api_client==1.0.
|
|
335
|
+
pip install mc5_api_client==1.0.12
|
|
339
336
|
```
|
|
340
337
|
|
|
341
|
-
✅ **Published and Available!** The MC5 API Client v1.0.
|
|
338
|
+
✅ **Published and Available!** The MC5 API Client v1.0.12 is now live on PyPI with accurate admin capabilities, encrypted token support, and corrected documentation!
|
|
342
339
|
|
|
343
340
|
### **� Install from Local Package**
|
|
344
341
|
|
|
345
342
|
```bash
|
|
346
343
|
# Install the wheel file you just created
|
|
344
|
+
pip install dist/mc5_api_client-1.0.10-py3-none-any.whl
|
|
347
345
|
pip install dist/mc5_api_client-1.0.8-py3-none-any.whl
|
|
348
346
|
|
|
349
347
|
# Or install from source
|
|
@@ -731,7 +729,65 @@ for event in events:
|
|
|
731
729
|
print(f" Task {i+1}: {points} points")
|
|
732
730
|
```
|
|
733
731
|
|
|
734
|
-
###
|
|
732
|
+
### 🔐 **Encrypted Token Support**
|
|
733
|
+
|
|
734
|
+
For users who prefer additional security, the module now supports token encryption:
|
|
735
|
+
|
|
736
|
+
```python
|
|
737
|
+
from mc5_api_client import quick_generate_encrypted_token, quick_encrypt_token
|
|
738
|
+
|
|
739
|
+
# Generate and encrypt a token in one step
|
|
740
|
+
encrypted_data = quick_generate_encrypted_token(
|
|
741
|
+
username="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
742
|
+
password="sSJKzhQ5l4vrFgov",
|
|
743
|
+
nonce="*" # Custom nonce value (optional)
|
|
744
|
+
)
|
|
745
|
+
|
|
746
|
+
print(f"Token ID: {encrypted_data['token_id']}")
|
|
747
|
+
print(f"Encrypted Token: {encrypted_data['encrypted_token']}")
|
|
748
|
+
print(f"Expires: {encrypted_data['expires_at']}")
|
|
749
|
+
|
|
750
|
+
# Encrypt an existing token
|
|
751
|
+
existing_token = "your_raw_access_token_here"
|
|
752
|
+
encrypted_token = quick_encrypt_token(existing_token, "*")
|
|
753
|
+
print(f"Encrypted: {encrypted_token}")
|
|
754
|
+
```
|
|
755
|
+
|
|
756
|
+
**Advanced TokenGenerator Usage:**
|
|
757
|
+
|
|
758
|
+
```python
|
|
759
|
+
from mc5_api_client import TokenGenerator
|
|
760
|
+
|
|
761
|
+
# Create token generator with custom settings
|
|
762
|
+
token_gen = TokenGenerator(
|
|
763
|
+
encrypt_url="https://eur-janus.gameloft.com/encrypt_token"
|
|
764
|
+
)
|
|
765
|
+
|
|
766
|
+
try:
|
|
767
|
+
# Generate encrypted token
|
|
768
|
+
result = token_gen.generate_encrypted_token(
|
|
769
|
+
username="anonymous:credential",
|
|
770
|
+
password="password",
|
|
771
|
+
nonce="custom_nonce"
|
|
772
|
+
)
|
|
773
|
+
|
|
774
|
+
# Or encrypt existing token
|
|
775
|
+
encrypted = token_gen.encrypt_token(
|
|
776
|
+
access_token="raw_token",
|
|
777
|
+
nonce="custom_nonce"
|
|
778
|
+
)
|
|
779
|
+
|
|
780
|
+
finally:
|
|
781
|
+
token_gen.close() # Always close the session
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
**Security Benefits:**
|
|
785
|
+
- ✅ **Additional Layer**: Tokens are encrypted before transmission
|
|
786
|
+
- ✅ **Custom Nonce**: Support for custom nonce values
|
|
787
|
+
- ✅ **Backward Compatible**: Works with existing authentication flow
|
|
788
|
+
- ✅ **Error Handling**: Proper validation and error recovery
|
|
789
|
+
|
|
790
|
+
### 🏆 **Checking Leaderboards**
|
|
735
791
|
|
|
736
792
|
See how you stack up:
|
|
737
793
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "mc5_api_client"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.12"
|
|
8
8
|
description = "A comprehensive Python library for interacting with the Modern Combat 5 API"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {file = "LICENSE"}
|
|
@@ -13,7 +13,9 @@ Provides easy access to authentication, profile management, clan operations,
|
|
|
13
13
|
messaging, and more.
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
from typing import Optional, Dict, Any
|
|
17
|
+
|
|
18
|
+
__version__ = "1.0.12"
|
|
17
19
|
__author__ = "Chizoba"
|
|
18
20
|
__email__ = "chizoba2026@hotmail.com"
|
|
19
21
|
__license__ = "MIT"
|
|
@@ -38,6 +40,57 @@ from .admin_client import (
|
|
|
38
40
|
quick_update_player_score
|
|
39
41
|
)
|
|
40
42
|
|
|
43
|
+
# Encrypted token convenience functions
|
|
44
|
+
from .auth import TokenGenerator
|
|
45
|
+
|
|
46
|
+
def quick_generate_encrypted_token(
|
|
47
|
+
username: str,
|
|
48
|
+
password: str,
|
|
49
|
+
device_id: Optional[str] = None,
|
|
50
|
+
scope: str = "alert auth chat leaderboard_ro lobby message session social config storage_ro tracking_bi feed storage leaderboard_admin social_eve social soc transaction schedule lottery voice matchmaker",
|
|
51
|
+
nonce: str = "*"
|
|
52
|
+
) -> Dict[str, Any]:
|
|
53
|
+
"""
|
|
54
|
+
Quick function to generate and encrypt an access token.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
username: MC5 username
|
|
58
|
+
password: Account password
|
|
59
|
+
device_id: Device ID (generated if not provided)
|
|
60
|
+
scope: Permission scopes
|
|
61
|
+
nonce: Nonce value for encryption
|
|
62
|
+
|
|
63
|
+
Returns:
|
|
64
|
+
Dictionary containing encrypted token information
|
|
65
|
+
"""
|
|
66
|
+
token_gen = TokenGenerator()
|
|
67
|
+
try:
|
|
68
|
+
result = token_gen.generate_encrypted_token(username, password, device_id, scope, nonce)
|
|
69
|
+
return result
|
|
70
|
+
finally:
|
|
71
|
+
token_gen.close()
|
|
72
|
+
|
|
73
|
+
def quick_encrypt_token(
|
|
74
|
+
access_token: str,
|
|
75
|
+
nonce: str = "*"
|
|
76
|
+
) -> str:
|
|
77
|
+
"""
|
|
78
|
+
Quick function to encrypt an existing access token.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
access_token: Raw access token string
|
|
82
|
+
nonce: Nonce value for encryption
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
Encrypted token string
|
|
86
|
+
"""
|
|
87
|
+
token_gen = TokenGenerator()
|
|
88
|
+
try:
|
|
89
|
+
result = token_gen.encrypt_token(access_token, nonce)
|
|
90
|
+
return result
|
|
91
|
+
finally:
|
|
92
|
+
token_gen.close()
|
|
93
|
+
|
|
41
94
|
__all__ = [
|
|
42
95
|
"MC5Client",
|
|
43
96
|
"SimpleMC5Client",
|
|
@@ -57,5 +110,7 @@ __all__ = [
|
|
|
57
110
|
"RateLimitError",
|
|
58
111
|
"help",
|
|
59
112
|
"examples",
|
|
60
|
-
"quick_reference"
|
|
113
|
+
"quick_reference",
|
|
114
|
+
"quick_generate_encrypted_token",
|
|
115
|
+
"quick_encrypt_token"
|
|
61
116
|
]
|
|
@@ -38,6 +38,7 @@ class TokenGenerator:
|
|
|
38
38
|
self,
|
|
39
39
|
client_id: str = "1875:55979:6.0.0a:windows:windows",
|
|
40
40
|
auth_url: str = "https://eur-janus.gameloft.com:443/authorize",
|
|
41
|
+
encrypt_url: str = "https://eur-janus.gameloft.com/encrypt_token",
|
|
41
42
|
timeout: int = 30,
|
|
42
43
|
max_retries: int = 3
|
|
43
44
|
):
|
|
@@ -47,11 +48,13 @@ class TokenGenerator:
|
|
|
47
48
|
Args:
|
|
48
49
|
client_id: Game client identifier
|
|
49
50
|
auth_url: Authentication endpoint URL
|
|
51
|
+
encrypt_url: Token encryption endpoint URL
|
|
50
52
|
timeout: Request timeout in seconds
|
|
51
53
|
max_retries: Maximum number of retry attempts
|
|
52
54
|
"""
|
|
53
55
|
self.client_id = client_id
|
|
54
56
|
self.auth_url = auth_url
|
|
57
|
+
self.encrypt_url = encrypt_url
|
|
55
58
|
self.timeout = timeout
|
|
56
59
|
self.max_retries = max_retries
|
|
57
60
|
|
|
@@ -275,6 +278,95 @@ class TokenGenerator:
|
|
|
275
278
|
"signature": parts[6] if len(parts) > 6 else None
|
|
276
279
|
}
|
|
277
280
|
|
|
281
|
+
def encrypt_token(
|
|
282
|
+
self,
|
|
283
|
+
access_token: str,
|
|
284
|
+
nonce: str = "*"
|
|
285
|
+
) -> str:
|
|
286
|
+
"""
|
|
287
|
+
Encrypt an access token for additional security.
|
|
288
|
+
|
|
289
|
+
Args:
|
|
290
|
+
access_token: Raw access token string
|
|
291
|
+
nonce: Nonce value for encryption (default: "*")
|
|
292
|
+
|
|
293
|
+
Returns:
|
|
294
|
+
Encrypted token string
|
|
295
|
+
|
|
296
|
+
Raises:
|
|
297
|
+
AuthenticationError: If encryption fails
|
|
298
|
+
NetworkError: If network issues occur
|
|
299
|
+
"""
|
|
300
|
+
payload = {
|
|
301
|
+
"access_token": access_token,
|
|
302
|
+
"nonce": nonce
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
try:
|
|
306
|
+
print("🔐 Encrypting token...")
|
|
307
|
+
response = self.session.post(
|
|
308
|
+
self.encrypt_url,
|
|
309
|
+
data=payload,
|
|
310
|
+
timeout=self.timeout
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
if response.status_code == 200:
|
|
314
|
+
encrypted_token = response.text.strip()
|
|
315
|
+
if encrypted_token:
|
|
316
|
+
print("✅ Token encrypted successfully")
|
|
317
|
+
return encrypted_token
|
|
318
|
+
else:
|
|
319
|
+
raise AuthenticationError("Empty encrypted token response")
|
|
320
|
+
else:
|
|
321
|
+
raise AuthenticationError(
|
|
322
|
+
f"Token encryption failed with status {response.status_code}: {response.text}"
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
except requests.exceptions.Timeout:
|
|
326
|
+
raise NetworkError("Token encryption request timed out")
|
|
327
|
+
except requests.exceptions.ConnectionError:
|
|
328
|
+
raise NetworkError("Failed to connect to encryption server")
|
|
329
|
+
except requests.exceptions.RequestException as e:
|
|
330
|
+
raise NetworkError(f"Network error during token encryption: {e}")
|
|
331
|
+
|
|
332
|
+
def generate_encrypted_token(
|
|
333
|
+
self,
|
|
334
|
+
username: str,
|
|
335
|
+
password: str,
|
|
336
|
+
device_id: Optional[str] = None,
|
|
337
|
+
scope: str = "alert auth chat leaderboard_ro lobby message session social config storage_ro tracking_bi feed storage leaderboard_admin social_eve social soc transaction schedule lottery voice matchmaker",
|
|
338
|
+
nonce: str = "*"
|
|
339
|
+
) -> Dict[str, Any]:
|
|
340
|
+
"""
|
|
341
|
+
Generate and encrypt an access token in one step.
|
|
342
|
+
|
|
343
|
+
Args:
|
|
344
|
+
username: MC5 username
|
|
345
|
+
password: Account password
|
|
346
|
+
device_id: Device ID (generated if not provided)
|
|
347
|
+
scope: Space-separated list of permission scopes
|
|
348
|
+
nonce: Nonce value for encryption (default: "*")
|
|
349
|
+
|
|
350
|
+
Returns:
|
|
351
|
+
Dictionary containing encrypted token information
|
|
352
|
+
|
|
353
|
+
Raises:
|
|
354
|
+
InvalidCredentialsError: If credentials are invalid
|
|
355
|
+
AuthenticationError: If authentication or encryption fails
|
|
356
|
+
NetworkError: If network issues occur
|
|
357
|
+
"""
|
|
358
|
+
# First generate regular token
|
|
359
|
+
token_data = self.generate_token(username, password, device_id, scope)
|
|
360
|
+
|
|
361
|
+
# Then encrypt it
|
|
362
|
+
encrypted_token = self.encrypt_token(token_data["access_token"], nonce)
|
|
363
|
+
|
|
364
|
+
# Add encrypted token to result
|
|
365
|
+
token_data["encrypted_token"] = encrypted_token
|
|
366
|
+
token_data["nonce"] = nonce
|
|
367
|
+
|
|
368
|
+
return token_data
|
|
369
|
+
|
|
278
370
|
def close(self):
|
|
279
371
|
"""Close the HTTP session."""
|
|
280
372
|
if self.session:
|
|
@@ -447,7 +447,7 @@ class MC5CLI:
|
|
|
447
447
|
|
|
448
448
|
def _print_version(self):
|
|
449
449
|
"""Print version information."""
|
|
450
|
-
self._print("MC5 API Client v1.0.
|
|
450
|
+
self._print("MC5 API Client v1.0.12", "cyan")
|
|
451
451
|
self._print("The ultimate Modern Combat 5 API library", "green")
|
|
452
452
|
self._print("Author: Chizoba", "blue")
|
|
453
453
|
self._print("Email: chizoba2026@hotmail.com", "blue")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mc5_api_client
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.12
|
|
4
4
|
Summary: A comprehensive Python library for interacting with the Modern Combat 5 API
|
|
5
5
|
Home-page: https://pypi.org/project/mc5-api-client/
|
|
6
6
|
Author: Chizoba
|
|
@@ -108,9 +108,9 @@ Think of this as your remote control for Modern Combat 5! Here's what you can do
|
|
|
108
108
|
- ⚡ **One-Liner Functions**: Quick search and kick operations!
|
|
109
109
|
- 🎯 **User-Friendly**: Designed for beginners and clan leaders!
|
|
110
110
|
- 🚀 **NEW: Admin Capabilities**: Use admin credentials for enhanced squad management!
|
|
111
|
-
- ⭐ **NEW: Squad Rating**: Add 5200+ rating to your squad with admin privileges!
|
|
112
111
|
- 🎯 **NEW: Player Score Updates**: Update any player's score, XP, and kill signatures!
|
|
113
112
|
- 🛡️ **NEW: Built-in Help System**: Comprehensive help commands and examples!
|
|
113
|
+
- 🔐 **NEW: Encrypted Token Support**: Generate and encrypt tokens for additional security!
|
|
114
114
|
|
|
115
115
|
## 🚀 Installation
|
|
116
116
|
|
|
@@ -122,14 +122,14 @@ pip install mc5_api_client==1.0.8
|
|
|
122
122
|
|
|
123
123
|
### ✅ **Major Enhancements Completed!**
|
|
124
124
|
|
|
125
|
-
**🚀 Advanced Automation Features (NEW in v1.0.8):**
|
|
125
|
+
**🚀 Advanced Automation Features (NEW in v1.0.8+):**
|
|
126
126
|
- ✅ **AdminMC5Client**: Enhanced client with admin privileges
|
|
127
|
-
- ✅ **
|
|
128
|
-
- ✅ **Player Score Updates**: Update any player's score, XP, and kill signatures
|
|
127
|
+
- ✅ **Player Score Management**: Update individual player scores, XP, and kill signatures
|
|
129
128
|
- ✅ **Batch Processing**: Search multiple players with loops and conditionals
|
|
130
129
|
- ✅ **Real-time Monitoring**: Continuous activity tracking with while loops
|
|
131
130
|
- ✅ **Smart Clan Cleanup**: Intelligent member management with safety features
|
|
132
131
|
- ✅ **Built-in Help System**: Comprehensive help commands and examples
|
|
132
|
+
- ✅ **Encrypted Token Support**: Generate and encrypt tokens for additional security
|
|
133
133
|
- ✅ **Production Ready**: Thoroughly tested and verified for production use
|
|
134
134
|
|
|
135
135
|
**🎮 Revolutionary Simple Interface (from v1.0.7):**
|
|
@@ -174,12 +174,11 @@ pip install mc5_api_client
|
|
|
174
174
|
|
|
175
175
|
New in v1.0.8! Powerful admin capabilities for enhanced squad management:
|
|
176
176
|
|
|
177
|
-
### **⭐
|
|
178
|
-
|
|
177
|
+
### **⭐ Update Player Scores (Admin Only):**
|
|
179
178
|
```python
|
|
180
179
|
from mc5_api_client import quick_update_player_score
|
|
181
180
|
|
|
182
|
-
#
|
|
181
|
+
# Update any player's score, XP, and kill signature
|
|
183
182
|
result = quick_update_player_score(
|
|
184
183
|
target_user_id="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
185
184
|
score=5200,
|
|
@@ -188,48 +187,47 @@ result = quick_update_player_score(
|
|
|
188
187
|
killsig_id="default_killsig_80"
|
|
189
188
|
)
|
|
190
189
|
|
|
191
|
-
|
|
190
|
+
if result.get('success'):
|
|
191
|
+
print("✅ Player score updated successfully!")
|
|
192
|
+
print(f"New score: {result.get('score')}")
|
|
193
|
+
print(f"New XP: {result.get('xp')}")
|
|
192
194
|
```
|
|
193
195
|
|
|
194
|
-
###
|
|
195
|
-
|
|
196
|
+
### **� Admin Client Usage:**
|
|
196
197
|
```python
|
|
197
198
|
from mc5_api_client import create_admin_client
|
|
198
199
|
|
|
199
|
-
# Create admin client with
|
|
200
|
+
# Create admin client with elevated privileges
|
|
200
201
|
client = create_admin_client()
|
|
201
202
|
client.connect()
|
|
202
203
|
|
|
203
|
-
# Update
|
|
204
|
+
# Update player information
|
|
204
205
|
result = client.update_player_score(
|
|
205
206
|
target_user_id="player_user_id",
|
|
206
207
|
score=10000,
|
|
207
|
-
xp=5000000
|
|
208
|
+
xp=5000000,
|
|
209
|
+
killsig_color="16777215",
|
|
210
|
+
killsig_id="default_killsig_42"
|
|
208
211
|
)
|
|
209
212
|
|
|
210
|
-
# Get squad members
|
|
213
|
+
# Get squad members (if you have access)
|
|
211
214
|
members = client.get_squad_members()
|
|
212
|
-
print(f"
|
|
215
|
+
print(f"Found {len(members)} squad members")
|
|
216
|
+
|
|
217
|
+
# Kick members (if you have permissions)
|
|
218
|
+
# client.kick_member("member_user_id", "Reason for kick")
|
|
213
219
|
|
|
214
220
|
client.close()
|
|
215
221
|
```
|
|
216
222
|
|
|
217
|
-
###
|
|
223
|
+
### **⚠️ Important Admin Limitations:**
|
|
224
|
+
- ✅ **Can Update**: Individual player scores, XP, kill signatures
|
|
225
|
+
- ✅ **Can Kick**: Squad members (with proper permissions)
|
|
226
|
+
- ❌ **Cannot Edit**: Squad rating directly (requires squad ownership)
|
|
227
|
+
- ❌ **Cannot Modify**: Squad settings (requires squad ownership)
|
|
218
228
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
# Add rating using admin credentials
|
|
223
|
-
result = quick_add_squad_rating(
|
|
224
|
-
username="game:mc5_system",
|
|
225
|
-
password="admin",
|
|
226
|
-
rating=5200,
|
|
227
|
-
use_admin=True
|
|
228
|
-
)
|
|
229
|
-
|
|
230
|
-
if 'error' not in result:
|
|
231
|
-
print("✅ 5200 rating added to squad!")
|
|
232
|
-
```
|
|
229
|
+
### **🔧 How It Actually Works:**
|
|
230
|
+
Admin privileges allow you to modify individual player data within a squad, which indirectly affects the squad's overall rating through the sum of member scores, but you cannot directly set the squad's rating value.
|
|
233
231
|
|
|
234
232
|
## 🎮 **Simple Usage for Non-Developers**
|
|
235
233
|
|
|
@@ -400,8 +398,7 @@ client.connect()
|
|
|
400
398
|
player = client.search_player('f55f')
|
|
401
399
|
|
|
402
400
|
# 🔹 Admin Operations
|
|
403
|
-
quick_update_player_score('user_id', 5200)
|
|
404
|
-
quick_add_squad_rating('admin', 'admin', 5200, use_admin=True)
|
|
401
|
+
quick_update_player_score('user_id', 5200, xp=2037745)
|
|
405
402
|
|
|
406
403
|
# 🔹 Error Handling
|
|
407
404
|
try: except AuthenticationError:
|
|
@@ -413,15 +410,16 @@ try: except MC5APIError:
|
|
|
413
410
|
### **🚀 Install from PyPI (Recommended)**
|
|
414
411
|
|
|
415
412
|
```bash
|
|
416
|
-
pip install mc5_api_client==1.0.
|
|
413
|
+
pip install mc5_api_client==1.0.12
|
|
417
414
|
```
|
|
418
415
|
|
|
419
|
-
✅ **Published and Available!** The MC5 API Client v1.0.
|
|
416
|
+
✅ **Published and Available!** The MC5 API Client v1.0.12 is now live on PyPI with accurate admin capabilities, encrypted token support, and corrected documentation!
|
|
420
417
|
|
|
421
418
|
### **� Install from Local Package**
|
|
422
419
|
|
|
423
420
|
```bash
|
|
424
421
|
# Install the wheel file you just created
|
|
422
|
+
pip install dist/mc5_api_client-1.0.10-py3-none-any.whl
|
|
425
423
|
pip install dist/mc5_api_client-1.0.8-py3-none-any.whl
|
|
426
424
|
|
|
427
425
|
# Or install from source
|
|
@@ -809,7 +807,65 @@ for event in events:
|
|
|
809
807
|
print(f" Task {i+1}: {points} points")
|
|
810
808
|
```
|
|
811
809
|
|
|
812
|
-
###
|
|
810
|
+
### 🔐 **Encrypted Token Support**
|
|
811
|
+
|
|
812
|
+
For users who prefer additional security, the module now supports token encryption:
|
|
813
|
+
|
|
814
|
+
```python
|
|
815
|
+
from mc5_api_client import quick_generate_encrypted_token, quick_encrypt_token
|
|
816
|
+
|
|
817
|
+
# Generate and encrypt a token in one step
|
|
818
|
+
encrypted_data = quick_generate_encrypted_token(
|
|
819
|
+
username="anonymous:d2luOF92M18xNzcwMDUxNjkwXy7H33aeTVB4YZictyDq48c=",
|
|
820
|
+
password="sSJKzhQ5l4vrFgov",
|
|
821
|
+
nonce="*" # Custom nonce value (optional)
|
|
822
|
+
)
|
|
823
|
+
|
|
824
|
+
print(f"Token ID: {encrypted_data['token_id']}")
|
|
825
|
+
print(f"Encrypted Token: {encrypted_data['encrypted_token']}")
|
|
826
|
+
print(f"Expires: {encrypted_data['expires_at']}")
|
|
827
|
+
|
|
828
|
+
# Encrypt an existing token
|
|
829
|
+
existing_token = "your_raw_access_token_here"
|
|
830
|
+
encrypted_token = quick_encrypt_token(existing_token, "*")
|
|
831
|
+
print(f"Encrypted: {encrypted_token}")
|
|
832
|
+
```
|
|
833
|
+
|
|
834
|
+
**Advanced TokenGenerator Usage:**
|
|
835
|
+
|
|
836
|
+
```python
|
|
837
|
+
from mc5_api_client import TokenGenerator
|
|
838
|
+
|
|
839
|
+
# Create token generator with custom settings
|
|
840
|
+
token_gen = TokenGenerator(
|
|
841
|
+
encrypt_url="https://eur-janus.gameloft.com/encrypt_token"
|
|
842
|
+
)
|
|
843
|
+
|
|
844
|
+
try:
|
|
845
|
+
# Generate encrypted token
|
|
846
|
+
result = token_gen.generate_encrypted_token(
|
|
847
|
+
username="anonymous:credential",
|
|
848
|
+
password="password",
|
|
849
|
+
nonce="custom_nonce"
|
|
850
|
+
)
|
|
851
|
+
|
|
852
|
+
# Or encrypt existing token
|
|
853
|
+
encrypted = token_gen.encrypt_token(
|
|
854
|
+
access_token="raw_token",
|
|
855
|
+
nonce="custom_nonce"
|
|
856
|
+
)
|
|
857
|
+
|
|
858
|
+
finally:
|
|
859
|
+
token_gen.close() # Always close the session
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
**Security Benefits:**
|
|
863
|
+
- ✅ **Additional Layer**: Tokens are encrypted before transmission
|
|
864
|
+
- ✅ **Custom Nonce**: Support for custom nonce values
|
|
865
|
+
- ✅ **Backward Compatible**: Works with existing authentication flow
|
|
866
|
+
- ✅ **Error Handling**: Proper validation and error recovery
|
|
867
|
+
|
|
868
|
+
### 🏆 **Checking Leaderboards**
|
|
813
869
|
|
|
814
870
|
See how you stack up:
|
|
815
871
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{mc5_api_client-1.0.10 → mc5_api_client-1.0.12}/src/mc5_api_client.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|