Research-Stack/5-Applications/scripts/store_wolfram_credential.py
Brandon Schneider ba1e4cf191 feat: add RDS probe tool, credential server, and Notion/Linear ingestion pipeline
New infrastructure components:
- rds_probe: Rust database inspection tool with IAM auth
- credential_server.py: REST credential provider server
- credential_provider.py: credential resolution chain
- ene_rds_fractal_fold.py / ene_rds_wiki_layer.py: RDS-backed ENE layers
- import_dumps_to_rds.py / export_linear_from_rds.py: ingestion pipeline
- recover_credential_server.sh: deployment script (sanitized)

Sanitize hardcoded secrets across codebase:
- Strip API keys from recover_credential_server.sh → env var lookups
- Replace hardcoded Wolfram appid (HYJE3R3R63) → env var in 5 scripts
- Strip fallback key values from config/index.js
- Add .claude/ and optimized_basis_v3.bin to .gitignore

Ingested 2,685 records into RDS: 2,421 Linear issues + 264 wiki pages
2026-05-18 00:31:44 -05:00

73 lines
2.3 KiB
Python

#!/usr/bin/env python3
"""
Store Wolfram Alpha credential in ENE
"""
import os
import sys
from pathlib import Path
# Add parent directory to path
sys.path.insert(0, str(Path(__file__).parent.parent.parent))
sys.path.insert(0, str(Path(__file__).parent.parent.parent / "4-Infrastructure"))
sys.path.insert(0, str(Path(__file__).parent.parent.parent / "0-Core-Formalism"))
sys.path.insert(0, str(Path(__file__).parent.parent.parent / "4-Infrastructure" / "infra"))
try:
from infra.ene_cloud_credential_manager import ENECloudCredentialManager
from ene_api import AccessLevel
except ImportError as e:
print(f"Import failed: {e}")
sys.exit(1)
def main():
print("=" * 70)
print("STORING WOLFRAM ALPHA CREDENTIAL IN ENE")
print("=" * 70)
# Initialize ENE credential manager
try:
ene = ENECloudCredentialManager()
print("ENE credential manager initialized")
except Exception as e:
print(f"ENE initialization failed: {e}")
sys.exit(1)
# Store Wolfram Alpha credential
wolfram_app_id = os.environ.get("WOLFRAM_ALPHA_APPID", "")
print(f"\nStoring Wolfram Alpha App ID: {wolfram_app_id}")
try:
cred_id = ene.store_credential(
provider="wolfram_alpha",
api_key=wolfram_app_id,
secret="", # No additional secret needed for App ID
node_assignments=["node_1", "node_2", "node_3"],
access_level=AccessLevel.RESTRICTED
)
print(f"\n✅ Credential stored successfully!")
print(f" Credential ID: {cred_id}")
print(f" Provider: wolfram_alpha")
print(f" Node assignments: node_1, node_2, node_3")
print(f" Access level: RESTRICTED")
# Verify storage
print(f"\nVerifying storage...")
creds = ene.credentials
if cred_id in creds:
print(f"✅ Credential verified in ENE database")
print(f" Health score: {creds[cred_id].health_score}")
print(f" Usage count: {creds[cred_id].usage_count}")
else:
print(f"❌ Credential not found in database")
except Exception as e:
print(f"\n❌ Failed to store credential: {e}")
sys.exit(1)
print("\n" + "=" * 70)
if __name__ == "__main__":
main()