Fix interface duplication

This commit is contained in:
Manuel de Brito Fontes 2017-01-10 09:16:18 -03:00
parent 9085e24a29
commit 8191245eee
6 changed files with 37 additions and 35 deletions

View file

@ -19,7 +19,6 @@ package resolver
import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/ingress/core/pkg/ingress/annotations/authtls"
"k8s.io/ingress/core/pkg/ingress/defaults"
)
@ -35,9 +34,26 @@ type Secret interface {
GetSecret(string) (*api.Secret, error)
}
// AuthCertificate has a method that searchs for a secret
// that contains a SSL certificate.
// AuthCertificate resolves a given secret name into an SSL certificate.
// The secret must contain 3 keys named:
// ca.crt: contains the certificate chain used for authentication
// tls.crt: (ignored) contains the tls certificate chain, or any other valid base64 data
// tls.key: (ignored) contains the tls secret key, or any other valid base64 data
type AuthCertificate interface {
GetAuthCertificate(string) (*authtls.SSLCert, error)
GetAuthCertificate(string) (*AuthSSLCert, error)
}
// AuthSSLCert contains the necessary information to do certificate based
// authentication of an ingress location
type AuthSSLCert struct {
// Secret contains the name of the secret this was fetched from
Secret string `json:"secret"`
// CertFileName contains the filename the secret's 'tls.crt' was saved to
CertFileName string `json:"certFilename"`
// KeyFileName contains the path the secret's 'tls.key'
KeyFileName string `json:"keyFilename"`
// CAFileName contains the path to the secrets 'ca.crt'
CAFileName string `json:"caFilename"`
// PemSHA contains the SHA1 hash of the 'tls.crt' value
PemSHA string `json:"pemSha"`
}