Add test coverage for the SSH key endpoints

This commit is contained in:
DaneEveritt 2022-05-14 18:08:48 -04:00
parent 97280a62a2
commit 6554164252
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
7 changed files with 201 additions and 7 deletions

View file

@ -43,11 +43,11 @@ class StoreSSHKeyRequest extends ClientApiRequest
}
if ($this->key instanceof DSA) {
$this->validator->errors()->add('public_key', 'DSA public keys are not supported.');
$this->validator->errors()->add('public_key', 'DSA keys are not supported.');
}
if ($this->key instanceof RSA && $this->key->getLength() < 2048) {
$this->validator->errors()->add('public_key', 'RSA keys must be at 2048 bytes.');
$this->validator->errors()->add('public_key', 'RSA keys must be at least 2048 bytes in length.');
}
$fingerprint = $this->key->getFingerprint('sha256');