* Map a rule's origin to the documented OTel `source` vocabulary, matching * the interactive path's semantics (permissionLogging.ts:81): session-scoped * grants are temporary, on-disk grants are permanent, and user-authored * denies are user_reject regardless of persistence. Everything the user
( ruleSource: string, behavior: 'allow' | 'deny', )
| 179 | * config. |
| 180 | */ |
| 181 | function ruleSourceToOTelSource( |
| 182 | ruleSource: string, |
| 183 | behavior: 'allow' | 'deny', |
| 184 | ): string { |
| 185 | switch (ruleSource) { |
| 186 | case 'session': |
| 187 | return behavior === 'allow' ? 'user_temporary' : 'user_reject' |
| 188 | case 'localSettings': |
| 189 | case 'userSettings': |
| 190 | return behavior === 'allow' ? 'user_permanent' : 'user_reject' |
| 191 | default: |
| 192 | return 'config' |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | /** |
| 197 | * Map a PermissionDecisionReason to the OTel `source` label for the |
no outgoing calls
no test coverage detected