security: remove all hardcoded API keys, require from environment
This commit is contained in:
@@ -357,7 +357,7 @@
|
||||
<li>Sets environment variables:
|
||||
<ul>
|
||||
<li><span class="inline-code">AITBC_URL=http://127.0.0.1:18000</span></li>
|
||||
<li><span class="inline-code">CLIENT_KEY=REDACTED_CLIENT_KEY</span></li>
|
||||
<li><span class="inline-code">CLIENT_KEY=${CLIENT_API_KEY}</span></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Calls Python client: <span class="inline-code">python3 cli/client.py --url $AITBC_URL --api-key $CLIENT_KEY submit inference --prompt "..."</span></li>
|
||||
@@ -374,7 +374,7 @@
|
||||
"type": "inference",
|
||||
"prompt": "What is machine learning?",
|
||||
"model": "llama3.2:latest",
|
||||
"client_key": "REDACTED_CLIENT_KEY",
|
||||
"client_key": "${CLIENT_API_KEY}",
|
||||
"timestamp": "2025-01-29T14:50:00Z"
|
||||
}</code></pre>
|
||||
</li>
|
||||
@@ -386,7 +386,7 @@
|
||||
<pre><code>POST /v1/jobs
|
||||
Host: 127.0.0.1:18000
|
||||
Content-Type: application/json
|
||||
X-Api-Key: REDACTED_CLIENT_KEY
|
||||
X-Api-Key: ${CLIENT_API_KEY}
|
||||
|
||||
{
|
||||
"type": "inference",
|
||||
@@ -418,7 +418,7 @@ X-Api-Key: REDACTED_CLIENT_KEY
|
||||
<pre><code>{
|
||||
"type": "submit_job",
|
||||
"job_id": "job_123456",
|
||||
"client": "REDACTED_CLIENT_KEY",
|
||||
"client": "${CLIENT_API_KEY}",
|
||||
"payload_hash": "abc123...",
|
||||
"reward": "100aitbc"
|
||||
}</code></pre>
|
||||
@@ -445,7 +445,7 @@ X-Api-Key: REDACTED_CLIENT_KEY
|
||||
<li>Select based on stake, reputation, capacity</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Selected miner: <span class="inline-code">REDACTED_MINER_KEY</span></li>
|
||||
<li>Selected miner: <span class="inline-code">${MINER_API_KEY}</span></li>
|
||||
</ol>
|
||||
|
||||
<div class="http-request">
|
||||
@@ -453,7 +453,7 @@ X-Api-Key: REDACTED_CLIENT_KEY
|
||||
<pre><code>POST /v1/jobs/assign
|
||||
Host: 127.0.0.1:18001
|
||||
Content-Type: application/json
|
||||
X-Api-Key: REDACTED_ADMIN_KEY
|
||||
X-Api-Key: ${ADMIN_API_KEY}
|
||||
|
||||
{
|
||||
"job_id": "job_123456",
|
||||
@@ -518,7 +518,7 @@ Content-Type: application/json
|
||||
<pre><code>POST /v1/jobs/job_123456/complete
|
||||
Host: 127.0.0.1:18000
|
||||
Content-Type: application/json
|
||||
X-Miner-Key: REDACTED_MINER_KEY
|
||||
X-Miner-Key: ${MINER_API_KEY}
|
||||
|
||||
{
|
||||
"job_id": "job_123456",
|
||||
@@ -544,8 +544,8 @@ X-Miner-Key: REDACTED_MINER_KEY
|
||||
<pre><code>{
|
||||
"receipt_id": "receipt_789",
|
||||
"job_id": "job_123456",
|
||||
"client": "REDACTED_CLIENT_KEY",
|
||||
"miner": "REDACTED_MINER_KEY",
|
||||
"client": "${CLIENT_API_KEY}",
|
||||
"miner": "${MINER_API_KEY}",
|
||||
"amount_paid": "0.25aitbc",
|
||||
"result_hash": "hash_of_result",
|
||||
"block_height": 12345,
|
||||
@@ -573,7 +573,7 @@ X-Miner-Key: REDACTED_MINER_KEY
|
||||
<h4>HTTP Request:</h4>
|
||||
<pre><code>GET /v1/jobs/job_123456
|
||||
Host: 127.0.0.1:18000
|
||||
X-Api-Key: REDACTED_CLIENT_KEY</code></pre>
|
||||
X-Api-Key: ${CLIENT_API_KEY}</code></pre>
|
||||
|
||||
<h4>Response:</h4>
|
||||
<pre><code>{
|
||||
|
||||
Reference in New Issue
Block a user