mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-31 03:21:11 +02:00
* Refactor audit code into audit package * remove builtin/audit * removed unrequired files
50 lines
1.0 KiB
Go
50 lines
1.0 KiB
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
//go:build !enterprise
|
|
|
|
package audit
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
// brokerEnt provides extensions to the broker behavior, but not in the community edition.
|
|
type brokerEnt struct{}
|
|
|
|
func newBrokerEnt() (*brokerEnt, error) {
|
|
return &brokerEnt{}, nil
|
|
}
|
|
|
|
func (b *Broker) validateRegistrationRequest(_ Backend) error {
|
|
return nil
|
|
}
|
|
|
|
func (b *Broker) handlePipelineRegistration(backend Backend) error {
|
|
err := b.register(backend)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to register device for %q: %w", backend.Name(), err)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (b *Broker) handlePipelineDeregistration(ctx context.Context, name string) error {
|
|
return b.deregister(ctx, name)
|
|
}
|
|
|
|
// requiredSuccessThresholdSinks is the value that should be used as the success
|
|
// threshold in the eventlogger broker.
|
|
func (b *Broker) requiredSuccessThresholdSinks() int {
|
|
if len(b.backends) > 0 {
|
|
return 1
|
|
}
|
|
|
|
return 0
|
|
}
|
|
|
|
func (b *brokerEnt) handleAdditionalAudit(_ context.Context, _ *AuditEvent) error {
|
|
return nil
|
|
}
|