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"
|
|
|
|
}
|
|
|
|
|
2019-03-05 08:07:13 +00:00
|
|
|
func (p *noop) GetTokenID(token string) (string, error) {
|
|
|
|
return "", nil
|
|
|
|
}
|
|
|
|
|
2019-03-08 00:05:13 +00:00
|
|
|
func (p *noop) GetName() string {
|
|
|
|
return "noop"
|
|
|
|
}
|
|
|
|
func (p *noop) GetType() Type {
|
|
|
|
return noopType
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *noop) GetEncryptedKey() (kid string, key string, ok bool) {
|
|
|
|
return "", "", false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *noop) Init(config Config) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-07-29 22:54:07 +00:00
|
|
|
func (p *noop) AuthorizeSign(ctx context.Context, token string) ([]SignOption, error) {
|
2019-03-08 00:05:13 +00:00
|
|
|
return []SignOption{}, nil
|
|
|
|
}
|
|
|
|
|
2019-10-28 18:50:43 +00:00
|
|
|
func (p *noop) AuthorizeRenew(ctx context.Context, cert *x509.Certificate) error {
|
2019-03-08 00:05:13 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-10-28 18:50:43 +00:00
|
|
|
func (p *noop) AuthorizeRevoke(ctx context.Context, token string) error {
|
2019-03-08 00:05:13 +00:00
|
|
|
return nil
|
|
|
|
}
|
2019-10-28 18:50:43 +00:00
|
|
|
|
|
|
|
func (p *noop) AuthorizeSSHSign(ctx context.Context, token string) ([]SignOption, error) {
|
|
|
|
return []SignOption{}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *noop) AuthorizeSSHRenew(ctx context.Context, token string) (*ssh.Certificate, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *noop) AuthorizeSSHRevoke(ctx context.Context, token string) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *noop) AuthorizeSSHRekey(ctx context.Context, token string) (*ssh.Certificate, []SignOption, error) {
|
|
|
|
return nil, []SignOption{}, nil
|
|
|
|
}
|