apache / apache/brpc

Support to customize the response of the very first request.

Open
#1,210 5 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

**Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)**

No.

**Describe the solution you'd like (描述你期望的解决方法)**

When a client connects to the server, the server can verify the request with an ``Authenticator``, but with ``Authenticator`` we can only reply an unauthorized if something is wrong, this is not enough, we may need to send more info to the client.

This is a one time check with the same purpose as ``Authenticator``, to make the following requests passed.

**Describe alternatives you've considered (描述你想到的折衷方案)**

The client calls a special method first, the server verifies it,
1. if success, mark the connection as established, set some custom data to the connection, like the ``AuthContext``;
1. else, close the connection, see #800, which has no reply.

**Additional context/screenshots (更多上下文/截图)**

Contributor guide

Open the contributing guide

Research direction

Start by reading the existing Authenticator handling and compare it with the no-reply connection behavior described in #800. Clarify how a custom first-request response and connection-scoped data should work, then verify that successful connections allow later requests and failed checks return the intended client-visible response.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.