Skip to content

Conversation

@devhl-labs
Copy link
Contributor

@devhl-labs devhl-labs commented Jan 24, 2026

@EraYaN please let me know if this causes an issue. Your pr created some warnings, and some of the public things I think can be protected internal.

C# GenericHost: Add XML documentation and refine access levels for token infrastructure

This PR adds comprehensive XML documentation to the token provider classes and refines access levels to properly restrict internal implementation details while supporting extensibility.

Changes

Added XML Documentation:

  • TokenBecameAvailableEventHandler delegate - documents the event handler signature for token availability notifications
  • TokenBecameAvailable event - documents when and why the event is raised
  • TokenProvider<T>.GetAsync() - documents the token retrieval contract with parameter and return value descriptions
  • RateLimitProvider<T>.AvailableTokens - documents the internal token buffering dictionary and its purpose

Access Level Changes:

  • TokenProvider<T>.GetAsync(): Changed from public abstract to protected internal abstract - restricts direct external calls while allowing internal library infrastructure and derived implementations
  • RateLimitProvider<T>.AvailableTokens: Changed from public to protected internal - hides implementation detail from external consumers while allowing derived classes to access it
  • RateLimitProvider<T>.GetAsync(): Changed from public override to protected internal override - matches the base class access level and restricts visibility

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR solves a reported issue, reference it using GitHub's linking syntax (e.g., having "fixes #123" present in the PR description)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Added XML documentation to the C# GenericHost templates and tightened access on internal token APIs to improve IntelliSense and reduce accidental misuse.

  • Refactors

    • Added XML docs for TokenBase events/delegates, TokenProvider.GetAsync, and RateLimitProvider.AvailableTokens.
    • Changed TokenProvider.GetAsync from public abstract to protected internal abstract.
    • Changed RateLimitProvider.AvailableTokens from public to protected internal.
    • Updated generated samples to reflect these changes.
  • Migration

    • If you were calling GetAsync directly or accessing AvailableTokens, move to the public authentication APIs or subclass the provider as needed.

Written for commit bf90de6. Summary will update on new commits.

@devhl-labs devhl-labs changed the title [csharp][generichost]added xml comments and restrict some access [csharp][generichost] Added xml comments and restrict some access Jan 24, 2026
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 144 files

Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants