mock

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CAClient

type CAClient struct {
	GeneratedCerts [][]string // Cache the generated certificates for verification purpose.
	// contains filtered or unexported fields
}

func NewMockCaClient

func NewMockCaClient(opts *security.Options, certLifetime time.Duration) (*CAClient, error)

NewMockCaClient create a CA client for CSR sign. The following function is adapted from istio NewMockCitadelClient (https://github.com/istio/istio/blob/1.20.0/security/pkg/nodeagent/caclient/providers/mock/mockcaclient.go)

func (*CAClient) Close

func (c *CAClient) Close() error

func (*CAClient) CsrSend

func (c *CAClient) CsrSend(csrPEM []byte, certValidsec int64, identity string) ([]string, error)

CsrSend send a grpc request to istio and sign a CSR. The following function is adapted from istio CSRSign (https://github.com/istio/istio/blob/1.20.0/security/pkg/nodeagent/caclient/providers/mock/mockcaclient.go)

func (*CAClient) FetchCert

func (c *CAClient) FetchCert(identity string) (*security.SecretItem, error)

The following function is adapted from istio generateNewSecret (https://github.com/istio/istio/blob/master/security/pkg/nodeagent/cache/secretcache.go)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL