Skip to content

Make types in Microsoft.AspNetCore.DataProtection.KeyManagement.Internal internal #54712

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

Closed
amcasey opened this issue Mar 23, 2024 · 7 comments
Closed
Assignees
Labels
area-dataprotection Includes: DataProtection

Comments

@amcasey
Copy link
Member

amcasey commented Mar 23, 2024

Background and Motivation

IInternalXmlKeyManager and ICacheableKeyRingProvider are explicitly test hooks and the other types are implementation details. They aren't included in our public API documentation since they aren't intended for external consumption.

PR: #54707

Proposed API

-namespace Microsoft.AspNetCore.DataProtection.KeyManagement.Internal;

-public sealed class CacheableKeyRing {}
-public struct DefaultKeyResolution {}
-public interface ICacheableKeyRingProvider {}
-public interface IDefaultKeyResolver {}
-public interface IInternalXmlKeyManager {}
-public interface IKeyRing {}
-public interface IKeyRingProvider {}

Usage Examples

Alternative Designs

Risks

There's very little reason to implement any of these interfaces, since the test hooks that accept them are internal. There's very little reason to invoke them, since the members of the returned objects are internal. It is, however, not impossible that people are using them. Furthermore, I don't actually know why they were public in the first place.

@amcasey amcasey added area-dataprotection Includes: DataProtection api-ready-for-review API is ready for formal API review - https://github.com/dotnet/apireviews labels Mar 23, 2024
@amcasey amcasey self-assigned this Mar 23, 2024
Copy link
Contributor

Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:

  • The PR contains changes to the reference-assembly that describe the API change. Or, you have included a snippet of reference-assembly-style code that illustrates the API change.
  • The PR describes the impact to users, both positive (useful new APIs) and negative (breaking changes).
  • Someone is assigned to "champion" this change in the meeting, and they understand the impact and design of the change.

@Tratcher
Copy link
Member

How does this fit with the API Compat policy of "Never remove/break a public API, and put back anything we removed in the past."?

@amcasey
Copy link
Member Author

amcasey commented Mar 25, 2024

How does this fit with the API Compat policy of "Never remove/break a public API, and put back anything we removed in the past."?

I guess I'm struggling to see the harm in removing an undocumented type you can't instantiate, subtype, or access the members of. But, yes, it would technically be a violation of our ironclad guarantee against breaking changes.

@Tratcher
Copy link
Member

@joperezr

@amcasey
Copy link
Member Author

amcasey commented Mar 25, 2024

Does our compat guarantee require that they continue to function as they do now or just that they continue to exist? If I made copies in Microsoft.AspNetCore.DataProtection.KeyManagement (no ".Internal") and left these orphaned, would that suffice?

Motivating example: I introduced a new interface to avoid breaking the existing ICacheableKeyRingProvider - was it important to continue to implement the old test hook in case someone was calling it or could I have just dropped that the implemented interfaces list? (Note that that's not the final shape of the PR.)

@amcasey
Copy link
Member Author

amcasey commented Mar 25, 2024

Related: can I mark these types as Obsolete or is that also breaking?

@amcasey
Copy link
Member Author

amcasey commented Mar 28, 2024

API rejected. Bend over backwards to not change things.

@amcasey amcasey closed this as completed Mar 28, 2024
@amcasey amcasey removed the api-ready-for-review API is ready for formal API review - https://github.com/dotnet/apireviews label Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dataprotection Includes: DataProtection
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants