2019-03-08 00:05:13 +00:00
|
|
|
package provisioner
|
|
|
|
|
2019-07-29 22:54:07 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"crypto/x509"
|
2019-10-28 18:50:43 +00:00
|
|
|
|
|
|
|
"golang.org/x/crypto/ssh"
|
2019-07-29 22:54:07 +00:00
|
|
|
)
|
2019-03-08 00:05:13 +00:00
|
|
|
|
|
|
|
// noop provisioners is a provisioner that accepts anything.
|
|
|
|
type noop struct{}
|
|
|
|
|
|
|
|
func (p *noop) GetID() string {
|
|
|
|
return "noop"
|
|
|
|
}
|
|
|
|
|
2021-05-20 01:23:20 +00:00
|
|
|
func (p *noop) GetIDForToken() string {
|
|
|
|
return "noop"
|
|
|
|
}
|
|
|
|
|
2023-05-10 06:47:28 +00:00
|
|
|
func (p *noop) GetTokenID(string) (string, error) {
|
2019-03-05 08:07:13 +00:00
|
|
|
return "", nil
|
|
|
|
}
|
|
|
|
|
2019-03-08 00:05:13 +00:00
|
|
|
func (p *noop) GetName() string {
|
|
|
|
return "noop"
|
|
|
|
}
|
|
|
|
func (p *noop) GetType() Type {
|
|
|
|
return noopType
|
|
|
|
}
|
|
|
|
|
2021-10-08 18:59:57 +00:00
|
|
|
func (p *noop) GetEncryptedKey() (kid, key string, ok bool) {
|
2019-03-08 00:05:13 +00:00
|
|
|
return "", "", false
|
|
|
|
}
|
|
|
|
|
2023-05-10 06:47:28 +00:00
|
|
|
func (p *noop) Init(Config) error {
|
2019-03-08 00:05:13 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-05-10 06:47:28 +00:00
|
|
|
func (p *noop) AuthorizeSign(context.Context, string) ([]SignOption, error) {
|
2022-03-22 02:21:40 +00:00
|
|
|
return []SignOption{p}, nil
|
2019-03-08 00:05:13 +00:00
|
|
|
}
|
|
|
|
|
2023-05-10 06:47:28 +00:00
|
|
|
func (p *noop) AuthorizeRenew(context.Context, *x509.Certificate) error {
|
2019-03-08 00:05:13 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-05-10 06:47:28 +00:00
|
|
|
func (p *noop) AuthorizeRevoke(context.Context, string) error {
|
2019-03-08 00:05:13 +00:00
|
|
|
return nil
|
|
|
|
}
|
2019-10-28 18:50:43 +00:00
|
|
|
|
2023-05-10 06:47:28 +00:00
|
|
|
func (p *noop) AuthorizeSSHSign(context.Context, string) ([]SignOption, error) {
|
2022-05-19 01:42:42 +00:00
|
|
|
return []SignOption{p}, nil
|
2019-10-28 18:50:43 +00:00
|
|
|
}
|
|
|
|
|
2023-05-10 06:47:28 +00:00
|
|
|
func (p *noop) AuthorizeSSHRenew(context.Context, string) (*ssh.Certificate, error) {
|
2022-08-23 19:43:48 +00:00
|
|
|
//nolint:nilnil // fine for noop
|
2019-10-28 18:50:43 +00:00
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2023-05-10 06:47:28 +00:00
|
|
|
func (p *noop) AuthorizeSSHRevoke(context.Context, string) error {
|
2019-10-28 18:50:43 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-05-10 06:47:28 +00:00
|
|
|
func (p *noop) AuthorizeSSHRekey(context.Context, string) (*ssh.Certificate, []SignOption, error) {
|
2019-10-28 18:50:43 +00:00
|
|
|
return nil, []SignOption{}, nil
|
|
|
|
}
|