fix self provisioning feature (#272)
Some checks failed
Docker / Build and Push (push) Has been cancelled
github-pages / deploy (push) Has been cancelled
Docker / release (push) Has been cancelled

This commit is contained in:
Christoph Haas
2025-01-26 11:35:24 +01:00
parent 1b8cdc3417
commit d01d865b4d
11 changed files with 482 additions and 18 deletions

View File

@@ -72,6 +72,17 @@ type Interface struct {
PeerDefPostDown string // default action that is executed after the device is down
}
// PublicInfo returns a copy of the interface with only the public information.
// Sensible information like keys are not included.
func (i *Interface) PublicInfo() Interface {
return Interface{
Identifier: i.Identifier,
DisplayName: i.DisplayName,
Type: i.Type,
Disabled: i.Disabled,
}
}
// Validate performs checks to ensure that the interface is valid.
func (i *Interface) Validate() error {
// validate peer default endpoint, add port if needed