2023-03-15 16:00:52 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2020-09-08 19:22:09 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
option go_package = "github.com/hashicorp/vault/vault/activity";
|
|
|
|
|
|
|
|
package activity;
|
|
|
|
|
2022-02-18 18:01:28 +00:00
|
|
|
// EntityRecord is generated the first time a client is active each month. This
|
|
|
|
// can store clients associated with entities or nonEntity clients, and really
|
|
|
|
// is a ClientRecord, not specifically an EntityRecord.
|
2020-09-08 19:22:09 +00:00
|
|
|
message EntityRecord {
|
2021-10-14 16:10:59 +00:00
|
|
|
string client_id = 1;
|
2020-09-08 19:22:09 +00:00
|
|
|
string namespace_id = 2;
|
|
|
|
// using the Timestamp type would cost us an extra
|
|
|
|
// 4 bytes per record to store nanoseconds.
|
|
|
|
int64 timestamp = 3;
|
2021-10-14 16:10:59 +00:00
|
|
|
// non_entity records whether the given EntityRecord is
|
2022-02-18 18:01:28 +00:00
|
|
|
// for a TWE or an entity-bound token.
|
|
|
|
bool non_entity = 4;
|
|
|
|
// MountAccessor is the auth mount accessor of the token used to perform the
|
|
|
|
// activity.
|
|
|
|
string mount_accessor = 5;
|
2023-05-19 20:30:12 +00:00
|
|
|
// client_type identifies the source of the entity record (entity,
|
|
|
|
// non-entity, acme, etc.)
|
|
|
|
string client_type = 6;
|
2020-09-08 19:22:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message LogFragment {
|
|
|
|
// hostname (or node ID?) where the fragment originated,
|
|
|
|
// used for debugging.
|
|
|
|
string originating_node = 1;
|
|
|
|
|
2021-10-14 16:10:59 +00:00
|
|
|
// active clients not yet in a log segment
|
|
|
|
repeated EntityRecord clients = 2;
|
2020-09-08 19:22:09 +00:00
|
|
|
|
|
|
|
// token counts not yet in a log segment,
|
|
|
|
// indexed by namespace ID
|
|
|
|
map<string,uint64> non_entity_tokens = 3;
|
|
|
|
}
|
2020-10-29 23:47:34 +00:00
|
|
|
|
2021-10-14 16:10:59 +00:00
|
|
|
// This activity log stores records for both clients with entities
|
|
|
|
// and clients without entities
|
2020-10-29 23:47:34 +00:00
|
|
|
message EntityActivityLog {
|
2021-10-14 16:10:59 +00:00
|
|
|
repeated EntityRecord clients = 1;
|
2020-10-29 23:47:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message TokenCount {
|
|
|
|
map<string,uint64> count_by_namespace_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message LogFragmentResponse {
|
|
|
|
}
|