remote

package
v0.2024.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotEnrolled       = errors.New("not enrolled")
	ErrNotEnrolledWithUs = errors.New("not enrolled with us")
	ErrNotTrusted        = errors.New("not trusted")
)

Functions

func Enroll

func Enroll(ctx context.Context, enrollment *gen.Enrollment, authority pki.Source, remoteRoots ...string) (*gen.Enrollment, error)

Enroll sets up the PKI for a remote Smart Core node. This connects to the remote node specified by enrollment.TargetAddress, constructs a new client certificate signed using the certificate and key from authority, and invokes CreateEnrollment on the target with this information. The Certificate and RootCAs will be computed from the authority and will be ignored if provided in enrollment. If any remoteRoots are provided, the remote server will be checked using these as trust roots, otherwise any remote certificate will be allowed.

func Forget

func Forget(ctx context.Context, enrollment *gen.Enrollment, tlsConfig *tls.Config) error

Forget asks a remote node to forget that they are enrolled using the given enrollment. Forget assumes that if the remote node trusts us then they also trust us to delete the enrollment. If certificate validation fails, we try again but this time check the remote enrollment against the passed one so we aren't deleting random enrollments.

func Inspect

func Inspect(ctx context.Context, address string) (*gen.HubNodeInspection, error)

Inspect connects to a remote node returning its public certs and metadata.

func Renew

func Renew(ctx context.Context, enrollment *gen.Enrollment, authority pki.Source, tlsConfig *tls.Config) (*gen.Enrollment, error)

Renew updates the PKI for a remote Smart Core node. This connects to the remote node specified by enrollment.TargetAddress using tlsConfig, signs the servers public certificate using authority, and calls EnrollmentApi.UpdateEnrollment on the remote node.

Types

This section is empty.

Jump to

Keyboard shortcuts

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