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"
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|
2022-03-22 02:21:40 +00:00
|
|
|
return []SignOption{p}, nil
|
2019-03-08 00:05:13 +00:00
|
|
|
}
|
|
|
|
|
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) {
|
2022-05-19 01:42:42 +00:00
|
|
|
return []SignOption{p}, nil
|
2019-10-28 18:50:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|