Fix Freebuff: add missing secrets/string imports, base36 client_id
This commit is contained in:
@@ -157,6 +157,7 @@ Architecture:
|
|||||||
|
|
||||||
import json, http.server, socketserver, urllib.request, urllib.parse, urllib.error, re
|
import json, http.server, socketserver, urllib.request, urllib.parse, urllib.error, re
|
||||||
import time, uuid, os, sys, argparse, threading, socket, collections, contextlib, signal
|
import time, uuid, os, sys, argparse, threading, socket, collections, contextlib, signal
|
||||||
|
import secrets, string
|
||||||
import dataclasses
|
import dataclasses
|
||||||
import http.client
|
import http.client
|
||||||
import selectors
|
import selectors
|
||||||
@@ -5428,7 +5429,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
|||||||
metadata = {
|
metadata = {
|
||||||
"run_id": run_id,
|
"run_id": run_id,
|
||||||
"cost_mode": "free",
|
"cost_mode": "free",
|
||||||
"client_id": secrets.token_hex(7)[:13],
|
"client_id": "".join(secrets.choice(string.digits + string.ascii_lowercase) for _ in range(13)),
|
||||||
}
|
}
|
||||||
if instance_id:
|
if instance_id:
|
||||||
metadata["freebuff_instance_id"] = instance_id
|
metadata["freebuff_instance_id"] = instance_id
|
||||||
|
|||||||
Reference in New Issue
Block a user