jac-scale 0.1.0__tar.gz → 0.1.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.
- {jac_scale-0.1.0 → jac_scale-0.1.2}/PKG-INFO +9 -2
- {jac_scale-0.1.0 → jac_scale-0.1.2}/README.md +7 -0
- jac_scale-0.1.2/jac_scale/google_sso_provider.jac +85 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/impl/memory_hierarchy.main.impl.jac +2 -2
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/impl/serve.impl.jac +46 -279
- jac_scale-0.1.2/jac_scale/impl/user_manager.impl.jac +349 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/jserver/impl/jfast_api.impl.jac +50 -2
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/jserver/jfast_api.jac +1 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/plugin.jac +8 -0
- jac_scale-0.1.2/jac_scale/serve.jac +106 -0
- jac_scale-0.1.2/jac_scale/sso_provider.jac +72 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/targets/kubernetes/kubernetes_target.jac +7 -2
- jac_scale-0.1.2/jac_scale/tests/test_hooks.py +39 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/tests/test_sso.py +273 -284
- jac_scale-0.1.2/jac_scale/user_manager.jac +49 -0
- jac_scale-0.1.2/jac_scale/utilities/loggers/standard_logger.jac +40 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale.egg-info/PKG-INFO +9 -2
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale.egg-info/SOURCES.txt +5 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale.egg-info/requires.txt +1 -1
- {jac_scale-0.1.0 → jac_scale-0.1.2}/pyproject.toml +2 -2
- jac_scale-0.1.0/jac_scale/serve.jac +0 -148
- jac_scale-0.1.0/jac_scale/utilities/loggers/standard_logger.jac +0 -56
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/__init__.py +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/abstractions/config/app_config.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/abstractions/config/base_config.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/abstractions/database_provider.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/abstractions/deployment_target.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/abstractions/image_registry.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/abstractions/logger.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/abstractions/models/deployment_result.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/abstractions/models/resource_status.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/config_loader.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/context.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/factories/database_factory.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/factories/deployment_factory.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/factories/registry_factory.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/factories/utility_factory.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/impl/config_loader.impl.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/impl/context.impl.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/impl/memory_hierarchy.mongo.impl.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/impl/memory_hierarchy.redis.impl.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/jserver/__init__.py +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/jserver/impl/jserver.impl.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/jserver/jserver.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/memory_hierarchy.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/plugin_config.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/providers/database/kubernetes_mongo.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/providers/database/kubernetes_redis.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/providers/registry/dockerhub.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/targets/kubernetes/kubernetes_config.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/targets/kubernetes/utils/kubernetes_utils.impl.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/targets/kubernetes/utils/kubernetes_utils.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/tests/__init__.py +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/tests/conftest.py +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/tests/fixtures/test_api.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/tests/fixtures/todo_app.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/tests/test_abstractions.py +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/tests/test_deploy_k8s.py +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/tests/test_examples.py +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/tests/test_factories.py +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/tests/test_file_upload.py +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/tests/test_k8s_utils.py +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/tests/test_memory_hierarchy.py +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/tests/test_serve.py +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale/utils.jac +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale.egg-info/dependency_links.txt +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale.egg-info/entry_points.txt +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/jac_scale.egg-info/top_level.txt +0 -0
- {jac_scale-0.1.0 → jac_scale-0.1.2}/setup.cfg +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jac-scale
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Author-email: Jason Mars <jason@mars.ninja>
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
7
|
-
Requires-Dist: jaclang>=0.9.
|
|
7
|
+
Requires-Dist: jaclang>=0.9.11
|
|
8
8
|
Requires-Dist: python-dotenv<2.0.0,>=1.2.1
|
|
9
9
|
Requires-Dist: docker<8.0.0,>=7.1.0
|
|
10
10
|
Requires-Dist: kubernetes<35.0.0,>=34.1.0
|
|
@@ -43,6 +43,13 @@ Requires-Dist: python-multipart<1.0.0,>=0.0.21
|
|
|
43
43
|
|
|
44
44
|
Whether you're developing locally with `jac start` or deploying to production with `jac start --scale`, you get the same powerful features with the flexibility to choose your deployment strategy.
|
|
45
45
|
|
|
46
|
+
### 4. Single Sign-On (SSO) Support
|
|
47
|
+
|
|
48
|
+
- **Google SSO**: Built-in support for Google Sign-In out of the box
|
|
49
|
+
- **Extensible Architecture**: Easily add other providers (GitHub, Microsoft, etc.)
|
|
50
|
+
- **Secure Authentication**: Integrated with JWT for secure session management
|
|
51
|
+
- **User Management**: Automatic account creation and linking
|
|
52
|
+
|
|
46
53
|
## Prerequisites
|
|
47
54
|
|
|
48
55
|
- kubenetes(K8s) installed
|
|
@@ -25,6 +25,13 @@
|
|
|
25
25
|
|
|
26
26
|
Whether you're developing locally with `jac start` or deploying to production with `jac start --scale`, you get the same powerful features with the flexibility to choose your deployment strategy.
|
|
27
27
|
|
|
28
|
+
### 4. Single Sign-On (SSO) Support
|
|
29
|
+
|
|
30
|
+
- **Google SSO**: Built-in support for Google Sign-In out of the box
|
|
31
|
+
- **Extensible Architecture**: Easily add other providers (GitHub, Microsoft, etc.)
|
|
32
|
+
- **Secure Authentication**: Integrated with JWT for secure session management
|
|
33
|
+
- **User Management**: Automatic account creation and linking
|
|
34
|
+
|
|
28
35
|
## Prerequisites
|
|
29
36
|
|
|
30
37
|
- kubenetes(K8s) installed
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""Google SSO Provider implementation for jac-scale.
|
|
2
|
+
|
|
3
|
+
This module implements the SSOProvider interface for Google OAuth authentication.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import from fastapi { Request, Response }
|
|
7
|
+
import from fastapi_sso.sso.google { GoogleSSO }
|
|
8
|
+
import from jac_scale.sso_provider { SSOProvider, SSOUserInfo }
|
|
9
|
+
|
|
10
|
+
"""Google OAuth SSO Provider.
|
|
11
|
+
|
|
12
|
+
This class wraps the fastapi_sso GoogleSSO implementation to conform to
|
|
13
|
+
our SSOProvider interface, enabling consistent handling across all SSO vendors.
|
|
14
|
+
"""
|
|
15
|
+
obj GoogleSSOProvider(SSOProvider) {
|
|
16
|
+
has client_id: str,
|
|
17
|
+
client_secret: str,
|
|
18
|
+
redirect_uri: str,
|
|
19
|
+
allow_insecure_http: bool = True,
|
|
20
|
+
_google_sso: (GoogleSSO | None) = None;
|
|
21
|
+
|
|
22
|
+
"""Initialize the Google SSO provider."""
|
|
23
|
+
def postinit -> None {
|
|
24
|
+
self._google_sso = GoogleSSO(
|
|
25
|
+
client_id=self.client_id,
|
|
26
|
+
client_secret=self.client_secret,
|
|
27
|
+
redirect_uri=self.redirect_uri,
|
|
28
|
+
allow_insecure_http=self.allow_insecure_http
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
"""Initiate Google OAuth authentication flow.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
operation: The operation type ('login' or 'register')
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
RedirectResponse to Google's OAuth authorization page
|
|
39
|
+
"""
|
|
40
|
+
async def initiate_auth(operation: str) -> Response {
|
|
41
|
+
if not self._google_sso {
|
|
42
|
+
raise RuntimeError("GoogleSSO not initialized") ;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
with self._google_sso {
|
|
46
|
+
return await self._google_sso.get_login_redirect();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
"""Handle the OAuth callback from Google.
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
request: The FastAPI request object containing OAuth callback data
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
SSOUserInfo: Standardized user information from Google
|
|
57
|
+
|
|
58
|
+
Raises:
|
|
59
|
+
Exception: If authentication fails or user info cannot be retrieved
|
|
60
|
+
"""
|
|
61
|
+
async def handle_callback(request: Request) -> SSOUserInfo {
|
|
62
|
+
if not self._google_sso {
|
|
63
|
+
raise RuntimeError("GoogleSSO not initialized") ;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
with self._google_sso {
|
|
67
|
+
user_info = await self._google_sso.verify_and_process(request);
|
|
68
|
+
return SSOUserInfo(
|
|
69
|
+
email=user_info.email,
|
|
70
|
+
external_id=user_info.id,
|
|
71
|
+
platform=self.get_platform_name(),
|
|
72
|
+
display_name=user_info?.display_name
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
"""Get the platform identifier.
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
str: 'google'
|
|
81
|
+
"""
|
|
82
|
+
def get_platform_name -> str {
|
|
83
|
+
return "google";
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -31,7 +31,7 @@ impl ScaleTieredMemory.init(use_cache: bool = True) -> None {
|
|
|
31
31
|
# Show subtle message (optional - uncomment to enable)
|
|
32
32
|
try {
|
|
33
33
|
import from jaclang.cli.console { console }
|
|
34
|
-
|
|
34
|
+
logger.debug(" ✔ Using MongoDB for persistence", style="muted");
|
|
35
35
|
} except Exception { }
|
|
36
36
|
} else {
|
|
37
37
|
# Fall back to jaclang's SqliteMemory using configured path
|
|
@@ -41,7 +41,7 @@ impl ScaleTieredMemory.init(use_cache: bool = True) -> None {
|
|
|
41
41
|
# Show subtle message
|
|
42
42
|
try {
|
|
43
43
|
import from jaclang.cli.console { console }
|
|
44
|
-
|
|
44
|
+
logger.debug(" ✔ Using SQLite for persistence", style="muted");
|
|
45
45
|
} except Exception { }
|
|
46
46
|
}
|
|
47
47
|
}
|