Documentation ¶
Index ¶
- type ServerStreamBuilder
- func (b *ServerStreamBuilder) Build() nodeattestor.ServerStream
- func (b *ServerStreamBuilder) ExpectAndBuild(payloadOrChallengeResponse []byte) nodeattestor.ServerStream
- func (b *ServerStreamBuilder) ExpectThenChallenge(payloadOrChallengeResponse, challenge []byte) *ServerStreamBuilder
- func (b *ServerStreamBuilder) FailAndBuild(err error) nodeattestor.ServerStream
- func (b *ServerStreamBuilder) Handle(handler ServerStreamHandler) *ServerStreamBuilder
- func (b *ServerStreamBuilder) IgnoreThenChallenge(challenge []byte) *ServerStreamBuilder
- type ServerStreamHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServerStreamBuilder ¶
type ServerStreamBuilder struct {
// contains filtered or unexported fields
}
ServerStreamBuilder is used to build server streams for testing.
func ServerStream ¶
func ServerStream(pluginName string) *ServerStreamBuilder
ServerStream initializes a new server stream builder for the given plugin name. Attestation data received by the stream will have its type validated against the plugin name.
func (*ServerStreamBuilder) Build ¶
func (b *ServerStreamBuilder) Build() nodeattestor.ServerStream
Build builds a stream with the configured handlers
func (*ServerStreamBuilder) ExpectAndBuild ¶
func (b *ServerStreamBuilder) ExpectAndBuild(payloadOrChallengeResponse []byte) nodeattestor.ServerStream
ExpectAndBuild adds a final handler wherein the server stream expects to receive the given payload or challenge response. It returns a built server stream, since the stream does not issue another challenge at this point and will fail if invoked again.
func (*ServerStreamBuilder) ExpectThenChallenge ¶
func (b *ServerStreamBuilder) ExpectThenChallenge(payloadOrChallengeResponse, challenge []byte) *ServerStreamBuilder
ExpectThenChallenge adds an intermediate handler that asserts that the given payload or challenge response is received and then issues the given challenge. It returns a new builder with that handler added.
func (*ServerStreamBuilder) FailAndBuild ¶
func (b *ServerStreamBuilder) FailAndBuild(err error) nodeattestor.ServerStream
FailAndBuild adds a final handler wherein the server stream fails with the given error. It returns a built server stream, since the stream does not issue another challenge at this point and will fail if invoked again.
func (*ServerStreamBuilder) Handle ¶
func (b *ServerStreamBuilder) Handle(handler ServerStreamHandler) *ServerStreamBuilder
Handle adds an arbitrary handler. If the handler returns a challenge then it is expected that the stream will be called again.
func (*ServerStreamBuilder) IgnoreThenChallenge ¶
func (b *ServerStreamBuilder) IgnoreThenChallenge(challenge []byte) *ServerStreamBuilder
IgnoreThenChallenge adds an intermediate handler that ignores the payload or challenge response and then issues the given challenge. It returns a new builder with that handler added.
type ServerStreamHandler ¶
ServerStreamHandler is a function used to handle payloads or challenge responses sent to the stream.