swift-server / swift-server/swift-http-server

Consider enforcing transportSecurity and supportedHTTPVersions compatibility at compile-time

Open
#111 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/usability status/needs-design
Dominant language
Swift
Stars
44
Forks
13
Avg merge
4d 3h
Merged PRs (30d)
8

Description

The transportSecurity and supportedHTTPVersions arguments of NIOHTTPServerConfiguration must be compatible with each other to form a valid configuration. For example, if transportSecurity == .plaintext, then supportedHTTPVersions must not contain .http3.

Currently, we validate the compatibility at runtime, but in https://github.com/swift-server/swift-http-server/pull/107#issuecomment-5232323869, it was discussed that enforcing these checks through the type system would form a better API. In particular, the idea of specifying a separate transport security for each HTTP version was brought up. See the thread for more details.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the NIOHTTPServerConfiguration transportSecurity and supportedHTTPVersions arguments, then read the design discussion in pull request #107 and its linked comment. Define a type-system-based API that prevents incompatible combinations such as plaintext with HTTP/3; done means invalid configurations cannot be represented while valid HTTP version and security choices remain usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
api, backend, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.