RealtimeDatabaseAuditMetadata

FirebaseRealtimeDatabaseAuditMetaData is exposed as part of the new protoPayload.metadata messages.

JSON representation
{
  "requestType": enum (RealtimeDatabaseAuditMetadata.RequestType),
  "protocol": enum (RealtimeDatabaseAuditMetadata.Protocol),
  "restMetadata": {
    object (RealtimeDatabaseAuditMetadata.RestMetadata)
  },
  "precondition": {
    object (RealtimeDatabaseAuditMetadata.Precondition)
  },
  "executeDuration": Duration,
  "pendingDuration": Duration,
  "path": string,

  // Union field operation_metadata can be only one of the following:
  "queryMetadata": {
    object (RealtimeDatabaseAuditMetadata.QueryMetadata)
  },
  "writeMetadata": {
    object (RealtimeDatabaseAuditMetadata.WriteMetadata)
  }
  // End of list of possible types for union field operation_metadata.
  "estimatedPayloadSizeBytes": int64
}
Fields
requestType

enum (RealtimeDatabaseAuditMetadata.RequestType)

Preserve the distinction between realtime and REST operations. Unlike RTDB profiler output, Cloud Audit Data Access Logs for RTDB collapse realtime-* and rest-* operations into Read, Write, and Update methods.

protocol

enum (RealtimeDatabaseAuditMetadata.Protocol)

Store what protocol was used.

restMetadata

object (RealtimeDatabaseAuditMetadata.RestMetadata)

Details relevant only to REST requests.

precondition

object (RealtimeDatabaseAuditMetadata.Precondition)

An optional precondition for an Update. Not present for any other methods.

executeDuration

Duration

RTDB server business execution time. Not present for: Connect, Disconnect, or Unlisten.

pendingDuration

Duration

RTDB server queueing time before execution begins. Not present for: Unlisten initiated by the server or RunOnDisconnect.

path

string

The data path that was accessed. Not present for: Connect, Disconnect, or RunOnDisconnect.

Union field operation_metadata. More details about Listens, Reads, or Updates. operation_metadata can be only one of the following:
queryMetadata

object (RealtimeDatabaseAuditMetadata.QueryMetadata)

Metadata information for a Listen or Read.

writeMetadata

object (RealtimeDatabaseAuditMetadata.WriteMetadata)

Metadata information for an Update.

estimatedPayloadSizeBytes

int64

The estimated response size of the audited operation in bytes. Do not use for billing purposes. Not present for: Connect, Disconnect, Unlisten, or OnDisconnectCancel.

RealtimeDatabaseAuditMetadata.QueryMetadata

QueryMetadata includes additional details about queries sent for Listens or Reads.

JSON representation
{
  "orderBy": string,
  "direction": enum (RealtimeDatabaseAuditMetadata.QueryMetadata.Direction),
  "startAt": {
    object (RealtimeDatabaseAuditMetadata.QueryMetadata.Bound)
  },
  "endAt": {
    object (RealtimeDatabaseAuditMetadata.QueryMetadata.Bound)
  },
  "equalTo": {
    object (RealtimeDatabaseAuditMetadata.QueryMetadata.Bound)
  },
  "unindexed": boolean,
  "limit": integer
}
Fields
orderBy

string

How is the query ordered? Possible values: $key, $priority, $value, <path>.

direction

enum (RealtimeDatabaseAuditMetadata.QueryMetadata.Direction)

If limitToLast is used, ASCENDING. If limitToFirst is used, DESCENDING. If neither is used, but startAt or startAfter is used, DESCENDING. In all other cases, ASCENDING.

startAt

object (RealtimeDatabaseAuditMetadata.QueryMetadata.Bound)

The query start point.

endAt

object (RealtimeDatabaseAuditMetadata.QueryMetadata.Bound)

The query end point.

equalTo

object (RealtimeDatabaseAuditMetadata.QueryMetadata.Bound)

If specified, query results only include children that match the specified value.

unindexed

boolean

If true, RTDB is not using a server-side index to serve data for the query. This means that RTDB may be sending more data than the query selects. Otherwise, not present.

limit

integer

The query was limited to either the first or last limit number of children. Not present when neither limitToLast nor limitToFirst is used.

RealtimeDatabaseAuditMetadata.QueryMetadata.Bound

A Bound is a query endpoint with a fallback key.

JSON representation
{
  "value": value,
  "key": string,
  "exclusive": boolean
}
Fields
value

value (Value format)

A value from the database instance.

key

string

The fallback key. If ordering by $key this field is omitted because its contents are stored in value instead.

exclusive

boolean

True if startAfter or endBefore were used. In this case, the query results will not contain the endpoint values.

RealtimeDatabaseAuditMetadata.WriteMetadata

WriteMetadata includes additional details about Updates.

JSON representation
{
  "paths": {
    string: string,
    ...
  }
}
Fields
paths

map (key: string, value: int64)

The paths modified in a multi-path update along with size of the data written at each path.

RealtimeDatabaseAuditMetadata.RestMetadata

RestMetadata contains details relevant only to REST requests.

JSON representation
{
  "requestUri": string,
  "requestMethod": enum (RealtimeDatabaseAuditMetadata.RestMetadata.Method)
}
Fields
requestUri

string

The full database URL, including the path: https://[NAMESPACE].us-central1.firebasedatabase.app/a/b/c.json.

requestMethod

enum (RealtimeDatabaseAuditMetadata.RestMetadata.Method)

For REST requests, what method was used. Left unspecified for non-REST requests or if a method was not available.

RealtimeDatabaseAuditMetadata.Precondition

Precondition describes the precondition, if any, that was used for an Update. Updates with preconditions known more commonly in RTDB as transactions.

JSON representation
{
  "preconditionType": enum (RealtimeDatabaseAuditMetadata.Precondition.PreconditionType),
  "hash": string
}
Fields
preconditionType

enum (RealtimeDatabaseAuditMetadata.Precondition.PreconditionType)

The type of precondition used.

hash

string

A SHA1 hash of the data the client expects to be at path. For REST requests, this value is sent in an ETAG header.