Skip to content

Add authentication options to the DocFX code snippets - #4935

Merged
bernardnormier merged 2 commits into
icerpc:mainfrom
bernardnormier:docfx-server-auth
Sep 12, 2026
Merged

Add authentication options to the DocFX code snippets#4935
bernardnormier merged 2 commits into
icerpc:mainfrom
bernardnormier:docfx-server-auth

Conversation

@bernardnormier

Copy link
Copy Markdown
Member

Fixes #4823.

The DocFX code snippets that create a Server passed no server authentication options, and the default transport
(QUIC) requires a server certificate. The snippets that create a ClientConnection to icerpc://localhost passed no
client authentication options either, so they built but could not connect.

This PR applies the pattern of the src README samples to all 16 regions: the server regions load the test server
certificate and pass serverAuthenticationOptions, and the client regions load the test root CA and pass
clientAuthenticationOptions. Both call the CreateServerAuthenticationOptions /
CreateClientAuthenticationOptions helpers from examples/common/Program.Authentication.cs, which the docfx example
projects now compile in, so the snippets stay in sync with the real helpers. A single two-line comment explains why
the certificate is there and where the helper lives, and the Server / ClientConnection construction itself carries
no comment.

Two pre-existing slips in CompressorMiddlewareExamples.cs are fixed along the way: the middleware region created an
unused client connection, and the file was in the IceRpc.Telemetry.Examples namespace.

What's Changed

None — DocFX code snippets only.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@bernardnormier bernardnormier added this to the 0.6.1 milestone Sep 10, 2026
@bernardnormier bernardnormier added the documentation Improvements or additions to documentation label Sep 10, 2026

@InsertCreativityHere InsertCreativityHere left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems like this name MetricsMiddlewareExamples is a leftover copy-paste.
This isn't introduced by your PR, but thought I'd point it out since we're touching this code anyways.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch, fixed in 1a55a8e.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@bernardnormier
bernardnormier merged commit eac5b4b into icerpc:main Sep 12, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Audit-Medium] Published DocFX server snippets cannot start with their default QUIC configuration

3 participants