Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce exposure of end methods for spans #350

Closed
wants to merge 1 commit into from

Conversation

NthPortal
Copy link
Contributor

Reduce the exposure of end methods for spans by creating a separate Span.Manual type returned only by
SpanOps#startUnmanaged that contains the end methods and removing the end methods from Span. Neither type inherits from the other, so Span.Manual instances must be explicitly converted to Span instances for use in general operations.

Resolves #347

Reduce the exposure of `end` methods for spans by creating a
separate `Span.Manual` type returned only by
`SpanOps#startUnmanaged` that contains the `end` methods and
removing the `end` methods from `Span`. Neither type inherits from
the other, so `Span.Manual` instances must be explicitly converted
to `Span` instances for use in general operations.
@NthPortal
Copy link
Contributor Author

I decided to push up a PR for this both because I'd already written it and to show how little it changes user code (as evidenced by the lack of test changes). folks can chime in whether they think the API changes are invasive and/or worth it

extends SpanAPI[F] {

/** This span, without the ability to end it. */
lazy val unmanageable: Span[F] = Span.fromBackend(backend)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this name feels kind of silly, but I can't think of anything better

@NthPortal NthPortal closed this Oct 30, 2023
@NthPortal NthPortal deleted the span-security/PR branch October 30, 2023 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Security of ending spans
1 participant