security: remove all hardcoded API keys, require from environment
This commit is contained in:
@@ -70,7 +70,7 @@ Miners earn 150% of the cost (50% markup).
|
||||
```python
|
||||
from client_plugin import OllamaClient
|
||||
|
||||
client = OllamaClient("http://localhost:8001", "REDACTED_CLIENT_KEY")
|
||||
client = OllamaClient("http://localhost:8001", "${CLIENT_API_KEY}")
|
||||
|
||||
job_id = client.submit_generation(
|
||||
model="llama3.2:latest",
|
||||
|
||||
@@ -190,7 +190,7 @@ def main():
|
||||
|
||||
parser = argparse.ArgumentParser(description="AITBC Ollama Client")
|
||||
parser.add_argument("--url", default="http://localhost:8001", help="Coordinator URL")
|
||||
parser.add_argument("--api-key", default="REDACTED_CLIENT_KEY", help="API key")
|
||||
parser.add_argument("--api-key", default="${CLIENT_API_KEY}", help="API key")
|
||||
|
||||
subparsers = parser.add_subparsers(dest="command", help="Commands")
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ def main():
|
||||
print(f"✅ Ollama running with {len(models)} models")
|
||||
|
||||
# Create client
|
||||
client = OllamaClient("http://localhost:8001", "REDACTED_CLIENT_KEY")
|
||||
client = OllamaClient("http://localhost:8001", "${CLIENT_API_KEY}")
|
||||
|
||||
# Submit a few different jobs
|
||||
jobs = []
|
||||
|
||||
@@ -264,7 +264,7 @@ if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
coordinator_url = sys.argv[1] if len(sys.argv) > 1 else "http://localhost:8001"
|
||||
api_key = sys.argv[2] if len(sys.argv) > 2 else "REDACTED_MINER_KEY"
|
||||
api_key = sys.argv[2] if len(sys.argv) > 2 else "${MINER_API_KEY}"
|
||||
miner_id = sys.argv[3] if len(sys.argv) > 3 else "ollama-miner"
|
||||
|
||||
# Create and run miner
|
||||
|
||||
@@ -68,7 +68,7 @@ def test_client_miner_flow():
|
||||
print("\n🔄 Testing Client-Miner Flow...")
|
||||
|
||||
# Create client
|
||||
client = OllamaClient("http://localhost:8001", "REDACTED_CLIENT_KEY")
|
||||
client = OllamaClient("http://localhost:8001", "${CLIENT_API_KEY}")
|
||||
|
||||
# Submit a job
|
||||
print("1. Submitting inference job...")
|
||||
@@ -89,7 +89,7 @@ def test_client_miner_flow():
|
||||
miner_cmd = [
|
||||
"python3", "miner_plugin.py",
|
||||
"http://localhost:8001",
|
||||
"REDACTED_MINER_KEY",
|
||||
"${MINER_API_KEY}",
|
||||
"ollama-miner-test"
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user