corona→corona: academic Corona now only in lp-220-p3q-corona
This commit is contained in:
@@ -50,13 +50,13 @@ Set environment variables for Runtime API:
|
||||
|
||||
```bash
|
||||
# IAM Integration
|
||||
HANZO_IAM_URL=https://iam.hanzo.ai
|
||||
HANZO_IAM_CLIENT_ID=runtime-client
|
||||
HANZO_IAM_CLIENT_SECRET=your-secret-here
|
||||
HANZO_IAM_VALIDATE_TOKENS=true
|
||||
IAM_ENDPOINT=https://iam.hanzo.ai
|
||||
IAM_CLIENT_ID=runtime-client
|
||||
IAM_CLIENT_SECRET=your-secret-here
|
||||
IAM_VALIDATE_TOKENS=true
|
||||
|
||||
# Token validation cache (optional)
|
||||
HANZO_IAM_CACHE_TTL=300 # 5 minutes
|
||||
IAM_CACHE_TTL=300 # 5 minutes
|
||||
```
|
||||
|
||||
### 3. Configure Scopes and Permissions
|
||||
@@ -120,7 +120,7 @@ print(result.output)
|
||||
|
||||
```bash
|
||||
# Get token from IAM
|
||||
TOKEN=$(curl -X POST https://iam.hanzo.ai/api/login/oauth/access_token \
|
||||
TOKEN=$(curl -X POST https://iam.hanzo.ai/oauth/token \
|
||||
-d "grant_type=client_credentials" \
|
||||
-d "client_id=runtime-client" \
|
||||
-d "client_secret=$CLIENT_SECRET" \
|
||||
@@ -233,7 +233,7 @@ Enable debug logging:
|
||||
|
||||
```bash
|
||||
# Runtime API
|
||||
HANZO_IAM_DEBUG=true
|
||||
IAM_DEBUG=true
|
||||
|
||||
# Client SDK
|
||||
export DEBUG=hanzo:*
|
||||
|
||||
@@ -73,7 +73,7 @@ function loginToRuntime() {
|
||||
state: JSON.stringify({ returnTo: '/dashboard' })
|
||||
});
|
||||
|
||||
window.location.href = `/login/oauth/authorize?${params}`;
|
||||
window.location.href = `/oauth/authorize?${params}`;
|
||||
}
|
||||
</script>
|
||||
```
|
||||
@@ -100,8 +100,8 @@ export const iamEnhancedConfig: AuthProviderProps = {
|
||||
// Custom metadata for IAM
|
||||
metadata: {
|
||||
// IAM-specific endpoints
|
||||
end_session_endpoint: `${import.meta.env.VITE_OIDC_DOMAIN}/login/oauth/logout`,
|
||||
revocation_endpoint: `${import.meta.env.VITE_OIDC_DOMAIN}/api/login/oauth/revoke`,
|
||||
end_session_endpoint: `${import.meta.env.VITE_OIDC_DOMAIN}/oauth/logout`,
|
||||
revocation_endpoint: `${import.meta.env.VITE_OIDC_DOMAIN}/oauth/revoke`,
|
||||
},
|
||||
|
||||
// Handle post-login redirect
|
||||
@@ -144,11 +144,11 @@ export class IamJwtStrategy extends PassportStrategy(Strategy, 'iam-jwt') {
|
||||
cache: true,
|
||||
rateLimit: true,
|
||||
jwksRequestsPerMinute: 5,
|
||||
jwksUri: `${process.env.HANZO_IAM_URL}/.well-known/jwks.json`
|
||||
jwksUri: `${process.env.IAM_ENDPOINT}/.well-known/jwks`
|
||||
}),
|
||||
|
||||
// Validate issuer and audience
|
||||
issuer: process.env.HANZO_IAM_URL,
|
||||
issuer: process.env.IAM_ISSUER,
|
||||
audience: process.env.HANZO_RUNTIME_API_URL,
|
||||
algorithms: ['RS256'],
|
||||
})
|
||||
@@ -245,7 +245,7 @@ export function IamIntegration() {
|
||||
3. **Test API Access**:
|
||||
```bash
|
||||
# Get token from IAM
|
||||
TOKEN=$(curl -X POST http://localhost:8000/api/login/oauth/access_token \
|
||||
TOKEN=$(curl -X POST http://localhost:8000/oauth/token \
|
||||
-d "grant_type=password" \
|
||||
-d "username=admin" \
|
||||
-d "password=admin" | jq -r .access_token)
|
||||
|
||||
@@ -14,9 +14,9 @@ from hanzo_runtime import HanzoRuntime
|
||||
from hanzo_runtime._async import HanzoRuntime as AsyncHanzoRuntime
|
||||
|
||||
# Configuration
|
||||
IAM_BASE_URL = os.getenv('HANZO_IAM_URL', 'https://iam.hanzo.ai')
|
||||
IAM_CLIENT_ID = os.getenv('HANZO_IAM_CLIENT_ID', 'your-client-id')
|
||||
IAM_CLIENT_SECRET = os.getenv('HANZO_IAM_CLIENT_SECRET', 'your-client-secret')
|
||||
IAM_BASE_URL = os.getenv('IAM_ENDPOINT', 'https://iam.hanzo.ai')
|
||||
IAM_CLIENT_ID = os.getenv('IAM_CLIENT_ID', 'your-client-id')
|
||||
IAM_CLIENT_SECRET = os.getenv('IAM_CLIENT_SECRET', 'your-client-secret')
|
||||
RUNTIME_API_URL = os.getenv('HANZO_RUNTIME_API_URL', 'https://api.hanzo.ai')
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class HanzoIAMAuth:
|
||||
"""Authenticate with Hanzo IAM using OAuth2 Client Credentials flow"""
|
||||
with httpx.Client() as client:
|
||||
response = client.post(
|
||||
f"{self.base_url}/api/login/oauth/access_token",
|
||||
f"{self.base_url}/oauth/token",
|
||||
data={
|
||||
'grant_type': 'client_credentials',
|
||||
'client_id': self.client_id,
|
||||
@@ -60,7 +60,7 @@ class HanzoIAMAuth:
|
||||
"""Validate token with IAM (optional - for service-to-service validation)"""
|
||||
with httpx.Client() as client:
|
||||
response = client.post(
|
||||
f"{self.base_url}/api/login/oauth/introspect",
|
||||
f"{self.base_url}/oauth/introspect",
|
||||
data={
|
||||
'token': token,
|
||||
'token_type_hint': 'access_token'
|
||||
|
||||
@@ -46,7 +46,7 @@ class IAMTokenValidator {
|
||||
try {
|
||||
// Introspect token with IAM
|
||||
const response = await axios.post(
|
||||
`${this.config.baseUrl}/api/login/oauth/introspect`,
|
||||
`${this.config.baseUrl}/oauth/introspect`,
|
||||
new URLSearchParams({
|
||||
token: token,
|
||||
token_type_hint: 'access_token'
|
||||
@@ -170,9 +170,9 @@ export function requireScope(scope: string) {
|
||||
export function setupRuntimeAPIWithIAM(app: any) {
|
||||
// Configure IAM integration
|
||||
const iamConfig: IAMConfig = {
|
||||
baseUrl: process.env.HANZO_IAM_URL || 'https://iam.hanzo.ai',
|
||||
clientId: process.env.HANZO_IAM_CLIENT_ID!,
|
||||
clientSecret: process.env.HANZO_IAM_CLIENT_SECRET!,
|
||||
baseUrl: process.env.IAM_ENDPOINT || 'https://iam.hanzo.ai',
|
||||
clientId: process.env.IAM_CLIENT_ID!,
|
||||
clientSecret: process.env.IAM_CLIENT_SECRET!,
|
||||
cacheTTL: 300 // Cache validations for 5 minutes
|
||||
};
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ import { HanzoRuntime } from '@hanzo/runtime';
|
||||
import axios from 'axios';
|
||||
|
||||
// Configuration
|
||||
const IAM_BASE_URL = process.env.HANZO_IAM_URL || 'https://iam.hanzo.ai';
|
||||
const IAM_CLIENT_ID = process.env.HANZO_IAM_CLIENT_ID || 'your-client-id';
|
||||
const IAM_CLIENT_SECRET = process.env.HANZO_IAM_CLIENT_SECRET || 'your-client-secret';
|
||||
const IAM_BASE_URL = process.env.IAM_ENDPOINT || 'https://iam.hanzo.ai';
|
||||
const IAM_CLIENT_ID = process.env.IAM_CLIENT_ID || 'your-client-id';
|
||||
const IAM_CLIENT_SECRET = process.env.IAM_CLIENT_SECRET || 'your-client-secret';
|
||||
const RUNTIME_API_URL = process.env.HANZO_RUNTIME_API_URL || 'https://api.hanzo.ai';
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ async function authenticateWithIAM(): Promise<string> {
|
||||
async function validateToken(token: string): Promise<boolean> {
|
||||
try {
|
||||
const introspectResponse = await axios.post(
|
||||
`${IAM_BASE_URL}/api/login/oauth/introspect`,
|
||||
`${IAM_BASE_URL}/oauth/introspect`,
|
||||
new URLSearchParams({
|
||||
token: token,
|
||||
token_type_hint: 'access_token'
|
||||
@@ -147,7 +147,7 @@ class IAMTokenRefresher {
|
||||
|
||||
private async refreshToken(): Promise<void> {
|
||||
const tokenResponse = await axios.post(
|
||||
`${IAM_BASE_URL}/api/login/oauth/access_token`,
|
||||
`${IAM_BASE_URL}/oauth/token`,
|
||||
new URLSearchParams({
|
||||
grant_type: 'client_credentials',
|
||||
client_id: IAM_CLIENT_ID,
|
||||
|
||||
@@ -12,12 +12,15 @@ description = "Python SDK for Hanzo Runtime"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.8,<4.0"
|
||||
dependencies = [
|
||||
# All deps below are FT-compatible under 3.13t.
|
||||
"environs>=10.0.0,<15.0.0",
|
||||
"pydantic>=2.4.2,<3.0.0",
|
||||
# pydantic 2.10 first ships cp313t wheels via pydantic-core 2.27
|
||||
"pydantic>=2.10.0,<3.0.0",
|
||||
"Deprecated>=1.2.18,<2.0.0",
|
||||
"httpx>=0.28.0,<0.29.0",
|
||||
"aiofiles>=24.1.0,<24.2.0",
|
||||
"toml>=0.10.0,<0.11.0",
|
||||
# obstore 0.7+ ships cp313t wheels (pyo3 Rust extension)
|
||||
"obstore>=0.7.0,<0.8.0",
|
||||
]
|
||||
classifiers = [
|
||||
|
||||
Reference in New Issue
Block a user