Skip to content

[Bug] Extension method IsNullOrEmpty is public #2651

Closed

Description

Which version of Microsoft.IdentityModel are you using?
I use Microsoft.IdentityModel.Tokens v7.6.1 (latest)

Where is the issue?

  • M.IM.JsonWebTokens
  • M.IM.KeyVaultExtensions
  • M.IM.Logging
  • M.IM.ManagedKeyVaultSecurityKey
  • M.IM.Protocols
  • M.IM.Protocols.OpenIdConnect
  • M.IM.Protocols.SignedHttpRequest
  • M.IM.Protocols.WsFederation
  • M.IM.TestExtensions
  • M.IM.Tokens
  • M.IM.Tokens.Saml
  • M.IM.Validators
  • M.IM.Xml
  • S.IM.Tokens.Jwt

Expected behavior
either method IsNullOrEmpty should be internal or whole CollectionUtilities class should be marked as internal.

Actual behavior
Both class and method in it are public

Possible solution
This would be a breaking change. So please add this to a planning of next major version. Required code change is just changing of a keyword from public to internal

Additional context / logs / screenshots / links to code
Extension method IsNullOrEmpty that is a helper method in your repo in CollectionUtilities.cs is public. It should be internal.

  1. This conflicts with other libraries that contain similar extensions and we have to manually choose which namespace to use. Thanks to this all major refactorings are PITA.
  2. This goes against single-responsibility principle. Because purpose of this library is to provide auth/identity-related methods and not string extensions

Activity

  1. Kebechet commented on Jul 10, 2024

    @Kebechet
    Author

    8.0.0-preview1 is up, PLEASE remove this extension method from there

  2. Kebechet commented on Jul 11, 2024

    @Kebechet
    Author

    Peter (@pmaytak) and jennyf19 Thank you very much! ❤️

    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions