1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2025-01-18 21:59:30 +00:00
ctrl/central_auth.go

35 lines
660 B
Go
Raw Normal View History

package steward
import "sync"
type signatureBase32 string
type argsString string
type centralAuth struct {
schema map[Node]map[argsString]signatureBase32
nodePublicKeys nodePublicKeys
configuration *Configuration
}
func newCentralAuth(configuration *Configuration) *centralAuth {
a := centralAuth{
schema: make(map[Node]map[argsString]signatureBase32),
nodePublicKeys: *newNodePublicKeys(),
configuration: configuration,
}
return &a
}
type nodePublicKeys struct {
mu sync.Mutex
keyMap map[Node]string
}
func newNodePublicKeys() *nodePublicKeys {
n := nodePublicKeys{
keyMap: make(map[Node]string),
}
return &n
}