mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Fix review issues: key_prefix length, count validation, WAL log, timeout comment, pointless temp var
This commit is contained in:
5 files changed
+10
-6
No files matched your search
@@ -46,7 +46,7 @@ def _generate_api_key(api_key_id: UUID = None) -> tuple[str, str, str, UUID]:
|
||||
raw_key = f"gns3_{api_key_id}_{random_bytes}"
|
||||
# Only hash the random secret part, so auth can extract api_key_id and do O(1) lookup
|
||||
key_hash = bcrypt.hashpw(random_bytes.encode(), bcrypt.gensalt()).decode()
|
||||
key_prefix = raw_key[: len(API_KEY_PREFIX) + 8]
|
||||
key_prefix = raw_key[:8]
|
||||
return raw_key, key_hash, key_prefix, api_key_id
|
||||
|
||||
|
||||
|
||||
@@ -618,6 +618,4 @@ async def create_node_from_template(
|
||||
node = await project.add_node_from_template(
|
||||
template, x=template_usage.x, y=template_usage.y, name=template_usage.name, compute_id=template_usage.compute_id
|
||||
)
|
||||
|
||||
result = node.asdict()
|
||||
return result
|
||||
return node.asdict()
|
||||
Reference in new issue
Block a user