chore(security): stop tracking two scratch scripts flagged by the secret scan
Files stay on disk. Keys they may hold are still in git history: rotate them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3317bfd063
commit
8f226dce99
4
.gitignore
vendored
4
.gitignore
vendored
@ -60,3 +60,7 @@ Test-Magazin/
|
||||
|
||||
# local todo list
|
||||
TODO.md
|
||||
|
||||
# local experiments; two files here once held key-like literals
|
||||
scratch/test_openai.py
|
||||
scratch/test_google_imagen.py
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
import requests
|
||||
import json
|
||||
import base64
|
||||
|
||||
API_KEY = "AIzaSyD6aidNxIhr2SKgauZ9zea_FynuCo2DyDo"
|
||||
url = f"https://generativelanguage.googleapis.com/v1beta/interactions"
|
||||
|
||||
payload = {
|
||||
"model": "gemini-3.1-flash-image",
|
||||
"input": [{"type": "user_input", "content": [{"type": "text", "text": "A beautiful square headshot portrait of Karyla. Style: painterly game concept art."}]}],
|
||||
"response_modalities": ["image"]
|
||||
}
|
||||
headers = {'x-goog-api-key': API_KEY, 'Content-Type': 'application/json'}
|
||||
|
||||
response = requests.post(url, headers=headers, json=payload)
|
||||
print(response.status_code)
|
||||
if response.ok:
|
||||
print("Success! Got image")
|
||||
else:
|
||||
print(response.text[:500])
|
||||
@ -1,24 +0,0 @@
|
||||
import requests
|
||||
import json
|
||||
|
||||
API_KEY = "sk-proj-jVzNl_bM-oRpR_W1F-W5bLwXQ4e38nS3pQf4eY6k2M6tX-TZA9YmH4lF" # From settings.json wait, I don't know the full key. I'll read it from settings.json
|
||||
with open("config/settings.json") as f:
|
||||
settings = json.load(f)
|
||||
api_key = settings.get("engine_api_keys", {}).get("openai_image")
|
||||
|
||||
url = "https://api.openai.com/v1/images/generations"
|
||||
|
||||
payload = {
|
||||
"model": "dall-e-3",
|
||||
"prompt": "A beautiful square headshot portrait of Karyla. Style: painterly game concept art.",
|
||||
"n": 1,
|
||||
"size": "1024x1024"
|
||||
}
|
||||
headers = {'Authorization': f'Bearer {api_key}', 'Content-Type': 'application/json'}
|
||||
|
||||
response = requests.post(url, headers=headers, json=payload)
|
||||
print(response.status_code)
|
||||
if response.ok:
|
||||
print("Success! OpenAI generated image.")
|
||||
else:
|
||||
print(response.text[:500])
|
||||
Loading…
Reference in New Issue
Block a user