@@ -16,8 +16,9 @@ import (
16
16
type evalResult struct {
17
17
Value bool `json:"value"`
18
18
JsonValue map [string ]interface {} `json:"json_value"`
19
- Unsupported bool `json:"unsupported"`
19
+ Unsupported bool `json:"unsupported"`
20
20
RuleID string `json:"rule_id"`
21
+ IDType string `json:"id_type"`
21
22
GroupName string `json:"group_name"`
22
23
SecondaryExposures []SecondaryExposure `json:"secondary_exposures"`
23
24
UndelegatedSecondaryExposures []SecondaryExposure `json:"undelegated_secondary_exposures"`
@@ -372,7 +373,6 @@ func (e *evaluator) eval(user User, spec configSpec, depth int, context *evalCon
372
373
var exposures = make ([]SecondaryExposure , 0 )
373
374
defaultRuleID := "default"
374
375
var deviceMetadata * DerivedDeviceMetadata
375
-
376
376
if spec .Enabled {
377
377
for _ , rule := range spec .Rules {
378
378
r := e .evalRule (user , rule , depth + 1 , context )
@@ -397,6 +397,7 @@ func (e *evaluator) eval(user User, spec configSpec, depth int, context *evalCon
397
397
Value : pass ,
398
398
JsonValue : configValue ,
399
399
RuleID : rule .ID ,
400
+ IDType : spec .IDType ,
400
401
GroupName : rule .GroupName ,
401
402
SecondaryExposures : exposures ,
402
403
UndelegatedSecondaryExposures : exposures ,
@@ -413,6 +414,7 @@ func (e *evaluator) eval(user User, spec configSpec, depth int, context *evalCon
413
414
return & evalResult {
414
415
Value : pass ,
415
416
RuleID : rule .ID ,
417
+ IDType : spec .IDType ,
416
418
GroupName : rule .GroupName ,
417
419
SecondaryExposures : exposures ,
418
420
EvaluationDetails : evalDetails ,
@@ -432,14 +434,16 @@ func (e *evaluator) eval(user User, spec configSpec, depth int, context *evalCon
432
434
Value : false ,
433
435
JsonValue : configValue ,
434
436
RuleID : defaultRuleID ,
437
+ IDType : spec .IDType ,
435
438
SecondaryExposures : exposures ,
436
439
UndelegatedSecondaryExposures : exposures ,
437
440
EvaluationDetails : evalDetails ,
438
441
DerivedDeviceMetadata : deviceMetadata ,
439
442
ConfigVersion : spec .ConfigVersion ,
440
443
}
441
444
}
442
- return & evalResult {Value : false , RuleID : defaultRuleID , SecondaryExposures : exposures , DerivedDeviceMetadata : deviceMetadata , ConfigVersion : spec .ConfigVersion }
445
+ return & evalResult {Value : false , RuleID : defaultRuleID , IDType : spec .IDType ,
446
+ SecondaryExposures : exposures , DerivedDeviceMetadata : deviceMetadata , ConfigVersion : spec .ConfigVersion }
443
447
}
444
448
445
449
func (e * evaluator ) evalDelegate (user User , rule configRule , exposures []SecondaryExposure , depth int , context * evalContext ) * evalResult {
@@ -564,7 +568,7 @@ func (e *evaluator) evalCondition(user User, cond configCondition, depth int, co
564
568
case strings .EqualFold (condType , "unit_id" ):
565
569
value = getUnitID (user , cond .IDType )
566
570
case strings .EqualFold (condType , "target_app" ):
567
- if ( context .ClientKey != "" ) {
571
+ if context .ClientKey != "" {
568
572
value = context .TargetAppID
569
573
} else {
570
574
value = e .store .getAppID ()
0 commit comments