forked from TrueCloudLab/frostfs-node
[#414] ir/control: Implement service server
Implement `ControlServiceServer` on `Server` type. The `Server` requires all requests to be signed with keys from the so-called whitelist. To obtain health status, it uses the abstraction in the form of `HealthChecker` interface. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
93803b1a90
commit
dcfe9a6504
6 changed files with 200 additions and 0 deletions
20
pkg/services/control/ir/server/opts.go
Normal file
20
pkg/services/control/ir/server/opts.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package control
|
||||
|
||||
// Option specifies Server's optional parameter.
|
||||
type Option func(*options)
|
||||
|
||||
type options struct {
|
||||
allowedKeys [][]byte
|
||||
}
|
||||
|
||||
func defaultOptions() *options {
|
||||
return new(options)
|
||||
}
|
||||
|
||||
// WithAllowedKeys returns option to add public keys
|
||||
// to white list of the Control service.
|
||||
func WithAllowedKeys(keys [][]byte) Option {
|
||||
return func(o *options) {
|
||||
o.allowedKeys = append(o.allowedKeys, keys...)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue