Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
evaluate_atomic_matching.py
CHANGED
|
@@ -218,11 +218,10 @@ def handle_ssh_key(ssh_key):
|
|
| 218 |
def validate_ssh_key(key_content):
|
| 219 |
# Check if it looks like a private key
|
| 220 |
if not key_content.startswith('-----BEGIN'):
|
| 221 |
-
raise ValueError("Invalid key format")
|
| 222 |
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
raise ValueError("Incomplete key")
|
| 226 |
|
| 227 |
return True
|
| 228 |
|
|
|
|
| 218 |
def validate_ssh_key(key_content):
|
| 219 |
# Check if it looks like a private key
|
| 220 |
if not key_content.startswith('-----BEGIN'):
|
| 221 |
+
raise ValueError("Invalid key format: Key must start with '-----BEGIN'")
|
| 222 |
|
| 223 |
+
if not key_content.strip().endswith('-----END') or not key_content.strip().endswith('-----END OPENSSH PRIVATE KEY-----'):
|
| 224 |
+
raise ValueError("Incomplete key: Key must end with '-----END' or '-----END OPENSSH PRIVATE KEY-----'")
|
|
|
|
| 225 |
|
| 226 |
return True
|
| 227 |
|