소스 검색

Add comment about public key validator.

Mariano Cano 5 년 전
부모
커밋
e0fee84694
1개의 변경된 파일과 4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      authority/provisioner/sign_ssh_options.go

+ 4 - 0
authority/provisioner/sign_ssh_options.go

@@ -414,6 +414,10 @@ func (v *sshCertDefaultValidator) Valid(cert *ssh.Certificate, o SignSSHOptions)
 type sshDefaultPublicKeyValidator struct{}
 type sshDefaultPublicKeyValidator struct{}
 
 
 // Valid checks that certificate request common name matches the one configured.
 // Valid checks that certificate request common name matches the one configured.
+//
+// TODO: this is the only validator that checks the key type. We should execute
+// this before the signing. We should add a new validations interface or extend
+// SSHCertOptionsValidator with the key.
 func (v sshDefaultPublicKeyValidator) Valid(cert *ssh.Certificate, o SignSSHOptions) error {
 func (v sshDefaultPublicKeyValidator) Valid(cert *ssh.Certificate, o SignSSHOptions) error {
 	if cert.Key == nil {
 	if cert.Key == nil {
 		return errs.BadRequest("ssh certificate key cannot be nil")
 		return errs.BadRequest("ssh certificate key cannot be nil")