timber-common 0.2.0__tar.gz → 0.2.2__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.
- {timber_common-0.2.0 → timber_common-0.2.2}/PKG-INFO +1 -1
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/security/oauth_service.py +33 -7
- {timber_common-0.2.0 → timber_common-0.2.2}/pyproject.toml +1 -1
- {timber_common-0.2.0 → timber_common-0.2.2}/CHANGELOG.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/LICENSE +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/README.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/config/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/config/model_loader.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/engine/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/engine/config_executor.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/engine/operation_registry.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/init.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/models/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/models/base.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/models/configs/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/models/core/__init.__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/models/core/tag.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/models/core/user.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/models/factory.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/models/mixins.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/models/registry.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_fetcher/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_fetcher/alphavantage.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_fetcher/base.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_fetcher/curated_data.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_fetcher/polygon.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_fetcher/stock.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_fetcher/yfinance.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_processor/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_processor/portfolio_metrics.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_processor/returns.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_processor/risk_metrics.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_processor/standardization.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_processor/technical_indicators.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/db_service.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/encryption/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/encryption/field_encryption.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/gdpr/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/gdpr/deletion.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/inventory/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/inventory/available_capabilities.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/inventory/cached_capabilities.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/inventory/loader.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/persistence/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/persistence/base.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/persistence/cache.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/persistence/instances.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/persistence/manager.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/persistence/notification.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/persistence/research.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/persistence/session.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/persistence/tracker.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/security/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/vector/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/vector/auto_ingestion.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/services/vector/tag_embedding.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/utils/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/utils/config.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/utils/db_utils.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/utils/helpers.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/utils/time_helpers.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/common/utils/validators.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/data/models/00_association_tables.yaml +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/data/models/cache_models.yaml +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/data/models/narrative_models.yaml +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/data/models/notification_models.yaml +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/data/models/oauth_models.yaml +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/data/models/portfolio_models.yaml +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/data/models/stock_research_models.yaml +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/data/models/user_preferences_models.yaml +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/data/models/vector_db_models.yaml +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/DOCUMENTATION_INDEX.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/DOCUMENTATION_SUMMARY.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/PROGRESS_UPDATE.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/TIMBER_SESSION_API_REFERENCE.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/best_practices/01_model_design_patterns.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/best_practices/02_service_architecture.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/best_practices/03_data_fetching_strategies.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/best_practices/04_caching_strategies.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/best_practices/05_error_handling.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/best_practices/06_performance_optimization.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/best_practices/07_security_best_practices.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/design_guides/01_system_architecture.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/design_guides/02_config_driven_models.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/design_guides/03_persistence_layer.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/design_guides/04_vector_integration.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/design_guides/05_multi_app_support.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/how_to/01_getting_started.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/how_to/02_creating_models.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/how_to/03_using_services.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/how_to/04_financial_data_fetching.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/how_to/05_encryption_and_security.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/how_to/06_vector_search.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/how_to/07_gdpr_compliance.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/documentation/how_to/08_testing_guide.md +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/modules/__init__.py +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/modules/config/custom_analysis.yaml +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/modules/config/investing_operations_config.yaml +0 -0
- {timber_common-0.2.0 → timber_common-0.2.2}/modules/investing_operations.py +0 -0
|
@@ -62,12 +62,16 @@ def _patch_oauth2_client_methods():
|
|
|
62
62
|
bool: True if method is supported for this endpoint
|
|
63
63
|
"""
|
|
64
64
|
if endpoint == 'token':
|
|
65
|
-
# If client has a configured method, use it
|
|
65
|
+
# If client has a configured method, use it strictly
|
|
66
66
|
if hasattr(self, 'token_endpoint_auth_method') and self.token_endpoint_auth_method:
|
|
67
|
-
|
|
67
|
+
result = method == self.token_endpoint_auth_method
|
|
68
|
+
logger.debug(f"Client {self.client_id}: checking {method} against configured {self.token_endpoint_auth_method} = {result}")
|
|
69
|
+
return result
|
|
68
70
|
|
|
69
71
|
# Otherwise allow common methods
|
|
70
|
-
|
|
72
|
+
result = method in ['client_secret_post', 'client_secret_basic', 'none']
|
|
73
|
+
logger.debug(f"Client {self.client_id}: {method} allowed by default = {result}")
|
|
74
|
+
return result
|
|
71
75
|
|
|
72
76
|
return False
|
|
73
77
|
|
|
@@ -565,6 +569,8 @@ class MyPasswordGrant(grants.ResourceOwnerPasswordCredentialsGrant):
|
|
|
565
569
|
Returns:
|
|
566
570
|
User object if authentication succeeds, None otherwise
|
|
567
571
|
"""
|
|
572
|
+
logger.info(f"authenticate_user called with username: {username}")
|
|
573
|
+
|
|
568
574
|
User = _get_model('User')
|
|
569
575
|
if not User:
|
|
570
576
|
logger.error("User model not found in registry")
|
|
@@ -573,25 +579,45 @@ class MyPasswordGrant(grants.ResourceOwnerPasswordCredentialsGrant):
|
|
|
573
579
|
try:
|
|
574
580
|
with db_service.session_scope() as session:
|
|
575
581
|
# Find user by email
|
|
582
|
+
logger.debug(f"Querying for user with email: {username}")
|
|
576
583
|
user = session.query(User).filter_by(email=username).first()
|
|
577
584
|
|
|
578
585
|
if not user:
|
|
579
586
|
logger.warning(f"Password grant: User not found: {username}")
|
|
587
|
+
# List available users for debugging
|
|
588
|
+
all_users = session.query(User).all()
|
|
589
|
+
logger.debug(f"Available users in database: {[u.email for u in all_users[:5]]}")
|
|
580
590
|
return None
|
|
581
591
|
|
|
592
|
+
logger.debug(f"User found: {user.email}, ID: {user.id}")
|
|
593
|
+
|
|
582
594
|
# Check if user is active
|
|
583
|
-
|
|
595
|
+
is_active = getattr(user, 'is_active', True)
|
|
596
|
+
logger.debug(f"User is_active: {is_active}")
|
|
597
|
+
|
|
598
|
+
if not is_active:
|
|
584
599
|
logger.warning(f"Password grant: User not active: {username}")
|
|
585
600
|
return None
|
|
586
601
|
|
|
587
602
|
# Verify password
|
|
588
|
-
|
|
603
|
+
logger.debug(f"Checking password for user: {username}")
|
|
604
|
+
|
|
605
|
+
if not hasattr(user, 'check_password'):
|
|
606
|
+
logger.error(f"User model has no check_password method!")
|
|
607
|
+
return None
|
|
608
|
+
|
|
609
|
+
password_valid = user.check_password(password)
|
|
610
|
+
logger.debug(f"Password validation result: {password_valid}")
|
|
611
|
+
|
|
612
|
+
if not password_valid:
|
|
589
613
|
logger.warning(f"Password grant: Invalid password for user: {username}")
|
|
590
614
|
return None
|
|
591
615
|
|
|
592
616
|
# Update last login
|
|
593
|
-
user
|
|
594
|
-
|
|
617
|
+
if hasattr(user, 'update_last_login'):
|
|
618
|
+
logger.debug(f"Updating last login for user: {username}")
|
|
619
|
+
user.update_last_login()
|
|
620
|
+
session.flush()
|
|
595
621
|
|
|
596
622
|
# Expunge to avoid detached instance issues
|
|
597
623
|
session.expunge(user)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "timber-common"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.2"
|
|
4
4
|
description = "Configuration-driven persistence library with automatic encryption, caching, vector search, and GDPR compliance for Python applications"
|
|
5
5
|
authors = ["Pumulo Sikaneta <pumulo@gmail.com>"]
|
|
6
6
|
maintainers = ["Pumulo Sikaneta <pumulo@gmail.com>"]
|
|
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
|
{timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_processor/portfolio_metrics.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_processor/standardization.py
RENAMED
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/common/services/data_processor/technical_indicators.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/common/services/inventory/available_capabilities.py
RENAMED
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/common/services/inventory/cached_capabilities.py
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
|
|
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
|
{timber_common-0.2.0 → timber_common-0.2.2}/documentation/best_practices/01_model_design_patterns.md
RENAMED
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/documentation/best_practices/02_service_architecture.md
RENAMED
|
File without changes
|
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/documentation/best_practices/04_caching_strategies.md
RENAMED
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/documentation/best_practices/05_error_handling.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/documentation/design_guides/01_system_architecture.md
RENAMED
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/documentation/design_guides/02_config_driven_models.md
RENAMED
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/documentation/design_guides/03_persistence_layer.md
RENAMED
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/documentation/design_guides/04_vector_integration.md
RENAMED
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/documentation/design_guides/05_multi_app_support.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/documentation/how_to/04_financial_data_fetching.md
RENAMED
|
File without changes
|
{timber_common-0.2.0 → timber_common-0.2.2}/documentation/how_to/05_encryption_and_security.md
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
|