add device enroll and license limit event to prehog (#31450)

* tp.device.enroll event

* add device origin to enroll event

* tp.license.limit event

* LicenseLimitEvent comment

* remove LicenseLimitEvent message from usageevents.proto:
directly use AnonymizeAndSubmit instead of SubmitUsageEvent

* update proto comment
This commit is contained in:
Sakshyam Shah 2023-09-12 18:07:15 -04:00 committed by GitHub
parent 38686213cc
commit daa818fe81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 2629 additions and 1580 deletions

View file

@ -3218,6 +3218,22 @@ enum OSType {
OS_TYPE_WINDOWS = 3;
}
// DeviceOrigin is the same as teleport.devicetrust.v1.DeviceOrigin.
// Duplicated because gogo doesn't play well with protoc-gen-go.
enum DeviceOrigin {
// Unspecified or absent origin.
DEVICE_ORIGIN_UNSPECIFIED = 0;
// Devices originated from direct API usage.
DEVICE_ORIGIN_API = 1;
// Devices originated from Jamf sync.
DEVICE_ORIGIN_JAMF = 2;
// Source originated from Microsoft Intune sync.
DEVICE_ORIGIN_INTUNE = 3;
}
// DeviceMetadata groups device information for events.
message DeviceMetadata {
// ID of the device.
@ -3228,6 +3244,8 @@ message DeviceMetadata {
string asset_tag = 3 [(gogoproto.jsontag) = "asset_tag,omitempty"];
// Device credential identifier.
string credential_id = 4 [(gogoproto.jsontag) = "credential_id,omitempty"];
// Device origin.
DeviceOrigin device_origin = 5 [(gogoproto.jsontag) = "device_origin,omitempty"];
}
// DeviceEvent is a device-related event.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1737,6 +1737,39 @@ export namespace DeviceAuthenticateEvent {
}
}
export class DeviceEnrollEvent extends jspb.Message {
getDeviceId(): string;
setDeviceId(value: string): DeviceEnrollEvent;
getUserName(): string;
setUserName(value: string): DeviceEnrollEvent;
getDeviceOsType(): string;
setDeviceOsType(value: string): DeviceEnrollEvent;
getDeviceOrigin(): string;
setDeviceOrigin(value: string): DeviceEnrollEvent;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DeviceEnrollEvent.AsObject;
static toObject(includeInstance: boolean, msg: DeviceEnrollEvent): DeviceEnrollEvent.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: DeviceEnrollEvent, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): DeviceEnrollEvent;
static deserializeBinaryFromReader(message: DeviceEnrollEvent, reader: jspb.BinaryReader): DeviceEnrollEvent;
}
export namespace DeviceEnrollEvent {
export type AsObject = {
deviceId: string,
userName: string,
deviceOsType: string,
deviceOrigin: string,
}
}
export class FeatureRecommendationEvent extends jspb.Message {
getUserName(): string;
setUserName(value: string): FeatureRecommendationEvent;
@ -1766,6 +1799,27 @@ export namespace FeatureRecommendationEvent {
}
}
export class LicenseLimitEvent extends jspb.Message {
getLicenseLimit(): LicenseLimit;
setLicenseLimit(value: LicenseLimit): LicenseLimitEvent;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): LicenseLimitEvent.AsObject;
static toObject(includeInstance: boolean, msg: LicenseLimitEvent): LicenseLimitEvent.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: LicenseLimitEvent, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): LicenseLimitEvent;
static deserializeBinaryFromReader(message: LicenseLimitEvent, reader: jspb.BinaryReader): LicenseLimitEvent;
}
export namespace LicenseLimitEvent {
export type AsObject = {
licenseLimit: LicenseLimit,
}
}
export class SubmitEventRequest extends jspb.Message {
getClusterName(): string;
setClusterName(value: string): SubmitEventRequest;
@ -2089,6 +2143,18 @@ export class SubmitEventRequest extends jspb.Message {
setAssistAction(value?: AssistActionEvent): SubmitEventRequest;
hasDeviceEnrollEvent(): boolean;
clearDeviceEnrollEvent(): void;
getDeviceEnrollEvent(): DeviceEnrollEvent | undefined;
setDeviceEnrollEvent(value?: DeviceEnrollEvent): SubmitEventRequest;
hasLicenseLimitEvent(): boolean;
clearLicenseLimitEvent(): void;
getLicenseLimitEvent(): LicenseLimitEvent | undefined;
setLicenseLimitEvent(value?: LicenseLimitEvent): SubmitEventRequest;
getEventCase(): SubmitEventRequest.EventCase;
serializeBinary(): Uint8Array;
@ -2157,6 +2223,8 @@ export namespace SubmitEventRequest {
featureRecommendationEvent?: FeatureRecommendationEvent.AsObject,
assistAccessRequest?: AssistAccessRequestEvent.AsObject,
assistAction?: AssistActionEvent.AsObject,
deviceEnrollEvent?: DeviceEnrollEvent.AsObject,
licenseLimitEvent?: LicenseLimitEvent.AsObject,
}
export enum EventCase {
@ -2266,6 +2334,10 @@ export namespace SubmitEventRequest {
ASSIST_ACTION = 55,
DEVICE_ENROLL_EVENT = 56,
LICENSE_LIMIT_EVENT = 57,
}
}
@ -2469,3 +2541,9 @@ export enum FeatureRecommendationStatus {
FEATURE_RECOMMENDATION_STATUS_NOTIFIED = 1,
FEATURE_RECOMMENDATION_STATUS_DONE = 2,
}
export enum LicenseLimit {
LICENSE_LIMIT_UNSPECIFIED = 0,
LICENSE_LIMIT_DEVICE_TRUST_TEAM_JAMF = 1,
LICENSE_LIMIT_DEVICE_TRUST_TEAM_USAGE = 2,
}

View file

@ -29,6 +29,7 @@ goog.exportSymbol('proto.prehog.v1alpha.BotCreateEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.BotJoinEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.CTA', null, global);
goog.exportSymbol('proto.prehog.v1alpha.DeviceAuthenticateEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.DeviceEnrollEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.DiscoverMetadata', null, global);
goog.exportSymbol('proto.prehog.v1alpha.DiscoverResource', null, global);
goog.exportSymbol('proto.prehog.v1alpha.DiscoverResourceMetadata', null, global);
@ -45,6 +46,8 @@ goog.exportSymbol('proto.prehog.v1alpha.HelloTeleportResponse', null, global);
goog.exportSymbol('proto.prehog.v1alpha.IntegrationEnrollKind', null, global);
goog.exportSymbol('proto.prehog.v1alpha.IntegrationEnrollMetadata', null, global);
goog.exportSymbol('proto.prehog.v1alpha.KubeRequestEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.LicenseLimit', null, global);
goog.exportSymbol('proto.prehog.v1alpha.LicenseLimitEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.ResourceCreateEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.ResourceHeartbeatEvent', null, global);
goog.exportSymbol('proto.prehog.v1alpha.ResourceKind', null, global);
@ -1269,6 +1272,27 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.prehog.v1alpha.DeviceAuthenticateEvent.displayName = 'proto.prehog.v1alpha.DeviceAuthenticateEvent';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.prehog.v1alpha.DeviceEnrollEvent = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.prehog.v1alpha.DeviceEnrollEvent, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.prehog.v1alpha.DeviceEnrollEvent.displayName = 'proto.prehog.v1alpha.DeviceEnrollEvent';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@ -1290,6 +1314,27 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.prehog.v1alpha.FeatureRecommendationEvent.displayName = 'proto.prehog.v1alpha.FeatureRecommendationEvent';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.prehog.v1alpha.LicenseLimitEvent = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.prehog.v1alpha.LicenseLimitEvent, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.prehog.v1alpha.LicenseLimitEvent.displayName = 'proto.prehog.v1alpha.LicenseLimitEvent';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@ -12722,6 +12767,226 @@ proto.prehog.v1alpha.DeviceAuthenticateEvent.prototype.setDeviceOsType = functio
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.prehog.v1alpha.DeviceEnrollEvent.prototype.toObject = function(opt_includeInstance) {
return proto.prehog.v1alpha.DeviceEnrollEvent.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.prehog.v1alpha.DeviceEnrollEvent} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.prehog.v1alpha.DeviceEnrollEvent.toObject = function(includeInstance, msg) {
var f, obj = {
deviceId: jspb.Message.getFieldWithDefault(msg, 1, ""),
userName: jspb.Message.getFieldWithDefault(msg, 2, ""),
deviceOsType: jspb.Message.getFieldWithDefault(msg, 3, ""),
deviceOrigin: jspb.Message.getFieldWithDefault(msg, 4, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.prehog.v1alpha.DeviceEnrollEvent}
*/
proto.prehog.v1alpha.DeviceEnrollEvent.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.prehog.v1alpha.DeviceEnrollEvent;
return proto.prehog.v1alpha.DeviceEnrollEvent.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.prehog.v1alpha.DeviceEnrollEvent} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.prehog.v1alpha.DeviceEnrollEvent}
*/
proto.prehog.v1alpha.DeviceEnrollEvent.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setDeviceId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setUserName(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setDeviceOsType(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setDeviceOrigin(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.prehog.v1alpha.DeviceEnrollEvent.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.prehog.v1alpha.DeviceEnrollEvent.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.prehog.v1alpha.DeviceEnrollEvent} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.prehog.v1alpha.DeviceEnrollEvent.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getDeviceId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getUserName();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getDeviceOsType();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getDeviceOrigin();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
};
/**
* optional string device_id = 1;
* @return {string}
*/
proto.prehog.v1alpha.DeviceEnrollEvent.prototype.getDeviceId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.prehog.v1alpha.DeviceEnrollEvent} returns this
*/
proto.prehog.v1alpha.DeviceEnrollEvent.prototype.setDeviceId = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string user_name = 2;
* @return {string}
*/
proto.prehog.v1alpha.DeviceEnrollEvent.prototype.getUserName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.prehog.v1alpha.DeviceEnrollEvent} returns this
*/
proto.prehog.v1alpha.DeviceEnrollEvent.prototype.setUserName = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string device_os_type = 3;
* @return {string}
*/
proto.prehog.v1alpha.DeviceEnrollEvent.prototype.getDeviceOsType = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.prehog.v1alpha.DeviceEnrollEvent} returns this
*/
proto.prehog.v1alpha.DeviceEnrollEvent.prototype.setDeviceOsType = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string device_origin = 4;
* @return {string}
*/
proto.prehog.v1alpha.DeviceEnrollEvent.prototype.getDeviceOrigin = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* @param {string} value
* @return {!proto.prehog.v1alpha.DeviceEnrollEvent} returns this
*/
proto.prehog.v1alpha.DeviceEnrollEvent.prototype.setDeviceOrigin = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
@ -12910,6 +13175,136 @@ proto.prehog.v1alpha.FeatureRecommendationEvent.prototype.setFeatureRecommendati
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.prehog.v1alpha.LicenseLimitEvent.prototype.toObject = function(opt_includeInstance) {
return proto.prehog.v1alpha.LicenseLimitEvent.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.prehog.v1alpha.LicenseLimitEvent} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.prehog.v1alpha.LicenseLimitEvent.toObject = function(includeInstance, msg) {
var f, obj = {
licenseLimit: jspb.Message.getFieldWithDefault(msg, 1, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.prehog.v1alpha.LicenseLimitEvent}
*/
proto.prehog.v1alpha.LicenseLimitEvent.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.prehog.v1alpha.LicenseLimitEvent;
return proto.prehog.v1alpha.LicenseLimitEvent.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.prehog.v1alpha.LicenseLimitEvent} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.prehog.v1alpha.LicenseLimitEvent}
*/
proto.prehog.v1alpha.LicenseLimitEvent.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!proto.prehog.v1alpha.LicenseLimit} */ (reader.readEnum());
msg.setLicenseLimit(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.prehog.v1alpha.LicenseLimitEvent.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.prehog.v1alpha.LicenseLimitEvent.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.prehog.v1alpha.LicenseLimitEvent} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.prehog.v1alpha.LicenseLimitEvent.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getLicenseLimit();
if (f !== 0.0) {
writer.writeEnum(
1,
f
);
}
};
/**
* optional LicenseLimit license_limit = 1;
* @return {!proto.prehog.v1alpha.LicenseLimit}
*/
proto.prehog.v1alpha.LicenseLimitEvent.prototype.getLicenseLimit = function() {
return /** @type {!proto.prehog.v1alpha.LicenseLimit} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {!proto.prehog.v1alpha.LicenseLimit} value
* @return {!proto.prehog.v1alpha.LicenseLimitEvent} returns this
*/
proto.prehog.v1alpha.LicenseLimitEvent.prototype.setLicenseLimit = function(value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* Oneof group definitions for this message. Each group defines the field
* numbers belonging to that group. When of these fields' value is set, all
@ -12918,7 +13313,7 @@ proto.prehog.v1alpha.FeatureRecommendationEvent.prototype.setFeatureRecommendati
* @private {!Array<!Array<number>>}
* @const
*/
proto.prehog.v1alpha.SubmitEventRequest.oneofGroups_ = [[3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55]];
proto.prehog.v1alpha.SubmitEventRequest.oneofGroups_ = [[3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57]];
/**
* @enum {number}
@ -12976,7 +13371,9 @@ proto.prehog.v1alpha.SubmitEventRequest.EventCase = {
DEVICE_AUTHENTICATE_EVENT: 52,
FEATURE_RECOMMENDATION_EVENT: 53,
ASSIST_ACCESS_REQUEST: 54,
ASSIST_ACTION: 55
ASSIST_ACTION: 55,
DEVICE_ENROLL_EVENT: 56,
LICENSE_LIMIT_EVENT: 57
};
/**
@ -13070,7 +13467,9 @@ proto.prehog.v1alpha.SubmitEventRequest.toObject = function(includeInstance, msg
deviceAuthenticateEvent: (f = msg.getDeviceAuthenticateEvent()) && proto.prehog.v1alpha.DeviceAuthenticateEvent.toObject(includeInstance, f),
featureRecommendationEvent: (f = msg.getFeatureRecommendationEvent()) && proto.prehog.v1alpha.FeatureRecommendationEvent.toObject(includeInstance, f),
assistAccessRequest: (f = msg.getAssistAccessRequest()) && proto.prehog.v1alpha.AssistAccessRequestEvent.toObject(includeInstance, f),
assistAction: (f = msg.getAssistAction()) && proto.prehog.v1alpha.AssistActionEvent.toObject(includeInstance, f)
assistAction: (f = msg.getAssistAction()) && proto.prehog.v1alpha.AssistActionEvent.toObject(includeInstance, f),
deviceEnrollEvent: (f = msg.getDeviceEnrollEvent()) && proto.prehog.v1alpha.DeviceEnrollEvent.toObject(includeInstance, f),
licenseLimitEvent: (f = msg.getLicenseLimitEvent()) && proto.prehog.v1alpha.LicenseLimitEvent.toObject(includeInstance, f)
};
if (includeInstance) {
@ -13376,6 +13775,16 @@ proto.prehog.v1alpha.SubmitEventRequest.deserializeBinaryFromReader = function(m
reader.readMessage(value,proto.prehog.v1alpha.AssistActionEvent.deserializeBinaryFromReader);
msg.setAssistAction(value);
break;
case 56:
var value = new proto.prehog.v1alpha.DeviceEnrollEvent;
reader.readMessage(value,proto.prehog.v1alpha.DeviceEnrollEvent.deserializeBinaryFromReader);
msg.setDeviceEnrollEvent(value);
break;
case 57:
var value = new proto.prehog.v1alpha.LicenseLimitEvent;
reader.readMessage(value,proto.prehog.v1alpha.LicenseLimitEvent.deserializeBinaryFromReader);
msg.setLicenseLimitEvent(value);
break;
default:
reader.skipField();
break;
@ -13836,6 +14245,22 @@ proto.prehog.v1alpha.SubmitEventRequest.serializeBinaryToWriter = function(messa
proto.prehog.v1alpha.AssistActionEvent.serializeBinaryToWriter
);
}
f = message.getDeviceEnrollEvent();
if (f != null) {
writer.writeMessage(
56,
f,
proto.prehog.v1alpha.DeviceEnrollEvent.serializeBinaryToWriter
);
}
f = message.getLicenseLimitEvent();
if (f != null) {
writer.writeMessage(
57,
f,
proto.prehog.v1alpha.LicenseLimitEvent.serializeBinaryToWriter
);
}
};
@ -15818,6 +16243,80 @@ proto.prehog.v1alpha.SubmitEventRequest.prototype.hasAssistAction = function() {
};
/**
* optional DeviceEnrollEvent device_enroll_event = 56;
* @return {?proto.prehog.v1alpha.DeviceEnrollEvent}
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.getDeviceEnrollEvent = function() {
return /** @type{?proto.prehog.v1alpha.DeviceEnrollEvent} */ (
jspb.Message.getWrapperField(this, proto.prehog.v1alpha.DeviceEnrollEvent, 56));
};
/**
* @param {?proto.prehog.v1alpha.DeviceEnrollEvent|undefined} value
* @return {!proto.prehog.v1alpha.SubmitEventRequest} returns this
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.setDeviceEnrollEvent = function(value) {
return jspb.Message.setOneofWrapperField(this, 56, proto.prehog.v1alpha.SubmitEventRequest.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.prehog.v1alpha.SubmitEventRequest} returns this
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.clearDeviceEnrollEvent = function() {
return this.setDeviceEnrollEvent(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.hasDeviceEnrollEvent = function() {
return jspb.Message.getField(this, 56) != null;
};
/**
* optional LicenseLimitEvent license_limit_event = 57;
* @return {?proto.prehog.v1alpha.LicenseLimitEvent}
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.getLicenseLimitEvent = function() {
return /** @type{?proto.prehog.v1alpha.LicenseLimitEvent} */ (
jspb.Message.getWrapperField(this, proto.prehog.v1alpha.LicenseLimitEvent, 57));
};
/**
* @param {?proto.prehog.v1alpha.LicenseLimitEvent|undefined} value
* @return {!proto.prehog.v1alpha.SubmitEventRequest} returns this
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.setLicenseLimitEvent = function(value) {
return jspb.Message.setOneofWrapperField(this, 57, proto.prehog.v1alpha.SubmitEventRequest.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.prehog.v1alpha.SubmitEventRequest} returns this
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.clearLicenseLimitEvent = function() {
return this.setLicenseLimitEvent(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.prehog.v1alpha.SubmitEventRequest.prototype.hasLicenseLimitEvent = function() {
return jspb.Message.getField(this, 57) != null;
};
@ -16515,4 +17014,13 @@ proto.prehog.v1alpha.FeatureRecommendationStatus = {
FEATURE_RECOMMENDATION_STATUS_DONE: 2
};
/**
* @enum {number}
*/
proto.prehog.v1alpha.LicenseLimit = {
LICENSE_LIMIT_UNSPECIFIED: 0,
LICENSE_LIMIT_DEVICE_TRUST_TEAM_JAMF: 1,
LICENSE_LIMIT_DEVICE_TRUST_TEAM_USAGE: 2
};
goog.object.extend(exports, proto.prehog.v1alpha);

View file

@ -150,7 +150,7 @@ func ConvertAuditEvent(event apievents.AuditEvent) Anonymizable {
}
case *apievents.DeviceEvent2:
// Only count successful device authentication.
// Only count successful events.
if !e.Success {
return nil
}
@ -162,6 +162,13 @@ func ConvertAuditEvent(event apievents.AuditEvent) Anonymizable {
UserName: e.User,
DeviceOsType: e.Device.OsType.String(),
}
case events.DeviceEnrollEvent:
return &DeviceEnrollEvent{
DeviceId: e.Device.DeviceId,
UserName: e.User,
DeviceOsType: e.Device.OsType.String(),
DeviceOrigin: e.Device.DeviceOrigin.String(),
}
}
}

View file

@ -676,6 +676,22 @@ func (d *DeviceAuthenticateEvent) Anonymize(a utils.Anonymizer) prehogv1a.Submit
}
}
// DeviceEnrollEvent event is emitted after a successful device enrollment.
type DeviceEnrollEvent prehogv1a.DeviceEnrollEvent
func (d *DeviceEnrollEvent) Anonymize(a utils.Anonymizer) prehogv1a.SubmitEventRequest {
return prehogv1a.SubmitEventRequest{
Event: &prehogv1a.SubmitEventRequest_DeviceEnrollEvent{
DeviceEnrollEvent: &prehogv1a.DeviceEnrollEvent{
DeviceId: a.AnonymizeString(d.DeviceId),
UserName: a.AnonymizeString(d.UserName),
DeviceOsType: d.DeviceOsType,
DeviceOrigin: d.DeviceOrigin,
},
},
}
}
// FeatureRecommendationEvent emitted when a feature is recommended to user or
// when user completes the desired CTA for the feature.
type FeatureRecommendationEvent prehogv1a.FeatureRecommendationEvent
@ -692,6 +708,20 @@ func (e *FeatureRecommendationEvent) Anonymize(a utils.Anonymizer) prehogv1a.Sub
}
}
// LicenseLimitEvent emitted when a feature is gated behind
// enterprise license.
type LicenseLimitEvent prehogv1a.LicenseLimitEvent
func (e *LicenseLimitEvent) Anonymize(a utils.Anonymizer) prehogv1a.SubmitEventRequest {
return prehogv1a.SubmitEventRequest{
Event: &prehogv1a.SubmitEventRequest_LicenseLimitEvent{
LicenseLimitEvent: &prehogv1a.LicenseLimitEvent{
LicenseLimit: e.LicenseLimit,
},
},
}
}
// ConvertUsageEvent converts a usage event from an API object into an
// anonymizable event. All events that can be submitted externally via the Auth
// API need to be defined here.

View file

@ -783,6 +783,31 @@ message DeviceAuthenticateEvent {
string device_os_type = 3;
}
// Device Enrollment event
//
// PostHost event: tp.device.enroll
message DeviceEnrollEvent {
// anonymized device ID, 32 bytes (HMAC-SHA-256) encoded in base64
//
// PostHog property: tp.device_id
string device_id = 1;
// anonymized username, 32 bytes (HMAC-SHA-256) encoded in base64
//
// PostHog property: tp.user_name
string user_name = 2;
// device OS type
//
// PostHog property: tp.device_os_type
string device_os_type = 3;
// device origin
//
// PostHog property: tp.device_origin
string device_origin = 4;
}
// FeatureRecommendationEvent captures event emitted when a feature is recommended to user or
// when user completes the desired CTA for the feature.
//
@ -818,6 +843,26 @@ enum FeatureRecommendationStatus {
FEATURE_RECOMMENDATION_STATUS_DONE = 2;
}
// LicenseLimitEvent is emitted when access to Teleport feature
// is denied based on license limits
//
// PostHost event: tp.license.limit
message LicenseLimitEvent {
// PostHost property: tp.license_limit
LicenseLimit license_limit = 1;
}
// LicenseLimit indicates event type that triggered LicenseLimitEvent.
enum LicenseLimit {
LICENSE_LIMIT_UNSPECIFIED = 0;
// LICENSE_LIMIT_DEVICE_TRUST_TEAM_JAMF is emitted if license does not
// allow Jamf integration (e.g. Team Plan)
LICENSE_LIMIT_DEVICE_TRUST_TEAM_JAMF = 1;
// LICENSE_LIMIT_DEVICE_TRUST_TEAM_USAGE is emitted when allowed enrolled device
// limit is reached
LICENSE_LIMIT_DEVICE_TRUST_TEAM_USAGE = 2;
}
message SubmitEventRequest {
// anonymized, 32 bytes (HMAC-SHA-256) encoded in base64
//
@ -909,6 +954,10 @@ message SubmitEventRequest {
AssistAccessRequestEvent assist_access_request = 54;
AssistActionEvent assist_action = 55;
DeviceEnrollEvent device_enroll_event = 56;
LicenseLimitEvent license_limit_event = 57;
}
reserved 8; // UIOnboardGetStartedClickEvent