disableSSHHostsListAPI -> disableGetSSHHosts

This commit is contained in:
max furman 2022-08-04 18:44:44 -07:00
parent fb7f57a8df
commit 99c9155467
2 changed files with 12 additions and 12 deletions

View file

@ -102,7 +102,7 @@ type AuthConfig struct {
DisableIssuedAtCheck bool `json:"disableIssuedAtCheck,omitempty"`
Backdate *provisioner.Duration `json:"backdate,omitempty"`
EnableAdmin bool `json:"enableAdmin,omitempty"`
DisableSSHHostsListAPI bool `json:"disableSSHHostsListAPI,omitempty"`
DisableGetSSHHosts bool `json:"disableGetSSHHosts,omitempty"`
}
// init initializes the required fields in the AuthConfig if they are not

View file

@ -602,7 +602,7 @@ func (a *Authority) CheckSSHHost(ctx context.Context, principal, token string) (
// GetSSHHosts returns a list of valid host principals.
func (a *Authority) GetSSHHosts(ctx context.Context, cert *x509.Certificate) ([]config.Host, error) {
if a.GetConfig().AuthorityConfig.DisableSSHHostsListAPI {
if a.GetConfig().AuthorityConfig.DisableGetSSHHosts {
return nil, errs.New(http.StatusNotFound, "ssh hosts list api disabled")
}
if a.sshGetHostsFunc != nil {