ajayspot commited on
Commit
04fbc84
·
verified ·
1 Parent(s): b45dd8f

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. evaluate_atomic_matching.py +3 -4
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
- # Check if it's complete
224
- if not key_content.strip().endswith('-----END'):
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