-
Notifications
You must be signed in to change notification settings - Fork 8
Implement access control for baggage items via key properties #1
Conversation
* Writeup about context passing style guideline Polished version of what we had in slashmo/gsoc-swift-tracing#12 * Update README.md Co-authored-by: Moritz Lang <[email protected]> * Update README.md Co-authored-by: Moritz Lang <[email protected]> * Update README.md Co-authored-by: Moritz Lang <[email protected]> * Update README.md Co-authored-by: Moritz Lang <[email protected]> * Update README.md Co-authored-by: Moritz Lang <[email protected]> * Update README.md Co-authored-by: Moritz Lang <[email protected]> * Update README.md Co-authored-by: Moritz Lang <[email protected]>
slight formatting fix for readme
* Add license header validation script * Add naming validation script
=readme bolden the primary usage style
Add installation instructions 📖
fix repo url
…ts for small contexts
+simple benchmarks to have a gut feeling how mutating and the CoW cos…
WIP #7: on holding baggage in framework protocols
Update instalation instructions for 0.2.0 📖
* adding SSWG meeting notes * Update README.md * Update README.md Co-authored-by: Moritz Lang <[email protected]> Co-authored-by: Moritz Lang <[email protected]>
Small updates in context passing guidelines
Downgrade Swift version to 5.0
Prefix Benchmark targets to avoid name clashes
!logging #30 logger need not be { set }
Semantically helpfully named empty baggage factory functions #26
remove and ignore Package.resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👌
@@ -185,6 +185,7 @@ extension Baggage { | |||
return self._storage.count | |||
} | |||
|
|||
/// Returns true if the baggage has no items stored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
public enum ForEachAccessType: Int, Hashable { | ||
/// Access all accessible values (i.e. `public` and `publicExceptLogging` values; `private` values are skipped) | ||
case allPublic = 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to add a comment on why you chose 8 here? I'm guessing it's to have a bit of headroom when adding more cases in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okey will do -- it's pretty sneaky, it matches up with the values used in the Access enum but "inverse"
Yes 8 because to leave space for other values if ever necessary
} | ||
|
||
extension Baggage { | ||
public typealias AccessPolicy = BaggageAccessPolicy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting pattern to work around not being able to nest types in protocols, also noticed you added this for Baggage.Key
👀👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I do this often actually. Not everyone loves it, but for those two types it's nice since it's all Baggage.[complete]
then :)
|
||
extension AnyBaggageKey: CustomStringConvertible { | ||
public var description: String { | ||
return "AnyBaggageKey(\(self.name), access: \(self.access))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Access control for baggage items.
This is the low level piece to resolve apple/swift-service-context#2