package
1.46.2
Repository: https://github.com/flipt-io/flipt.git
Documentation: pkg.go.dev

# README

Audit Events

Audit Events are pieces of data that describe a particular thing that has happened in a system. At Flipt, we provide the functionality of processing and batching these audit events and an abstraction for sending these audit events to a sink.

If you have an idea of a sink that you would like to receive audit events on, there are certain steps you would need to take to contribute, which are detailed below.

Filterable Audit Events

The ability to filter audit events was added in v1.27.0 of Flipt. The following audit events are currently filterable:

Nouns

  • flag
  • segment
  • variant
  • constraint
  • rule
  • distribution
  • namespace
  • rollout
  • token

Verbs

  • created
  • updated
  • deleted

Any combination of the above nouns and verbs can be used to filter audit events. For example, flag:created would filter audit events for only created events for flags.

You may also use the * wildcard to filter on all nouns or verbs. For example, *:created would filter audit events for only created events for all nouns.

Similarly, flag:* would filter audit events for all verbs for flags.

Finally, *:* would filter audit events for all nouns and verbs which is the default behavior.

Contributing

The abstraction that we provide for implementation of receiving these audit events to a sink is this.

type Sink interface {
	SendAudits([]Event) error
	Close() error
	fmt.Stringer
}

For contributions of new sinks, you can follow this pattern:

  • Create a folder for your new sink under the audit package with a meaningful name of your sink
  • Provide the implementation to how to send audit events to your sink via the SendAudits
  • Provide the implementation of closing resources/connections to your sink via the Close method (this will be called asynchronously to the SendAudits method so account for that in your implementation)
  • Provide the variables for configuration just like here for connection details to your sink
  • Add a conditional to see if your sink is enabled here
  • Write respective tests

:rocket: you should be good to go!

Need help? Reach out to us on GitHub, Discord, Twitter, or Mastodon.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

NewChecker is the constructor for a Checker.
No description provided by the author
No description provided by the author
NewEvent is the constructor for an event.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewSinkSpanExporter is the constructor for a SinkSpanExporter.
No description provided by the author

# Structs

No description provided by the author
Checker holds a map that maps event pairs to a dummy struct.
No description provided by the author
No description provided by the author
Event holds information that represents an action that was attempted in the system.
No description provided by the author
Metadata holds information of what metadata an event will contain.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SinkSpanExporter sends audit logs to configured sinks through intercepting span events.
No description provided by the author

# Interfaces

EventExporter provides an API for exporting spans as Event(s).
EventPairChecker is the contract for checking if an event pair exists and if it should be emitted to configured sinks.
Sink is the abstraction for various audit sink configurations that Flipt will support.