apple / swift-service-context

Minimal type-safe context propagation container
https://github.com/apple/swift-distributed-tracing
Apache License 2.0
66 stars 22 forks source link

Access control per baggage item key #2

Open ktoso opened 4 years ago

ktoso commented 4 years ago

This mirrors the https://github.com/slashmo/gsoc-swift-baggage-context/issues/35 ticket

--

Additional capability similar to privacy in os_log to be added to baggage keys.

A key has to define if it wants to be included in forEach and if it wants to be logged.

[...] mark a key as containing sensitive information . for example, you may have a key that carries sensitive user information and that you never want the collectors to log

via @tomerd

ktoso commented 4 years ago

Existing PR on old repo https://github.com/ktoso/gsoc-swift-baggage-context/pull/2

weissi commented 1 year ago

This could be handled with static properties on the keys, right? We can default them to true but if you don't want them to be logged/enumerated/... you set them to false. Something like static var allowsEnumeration: Bool { return false }