@@ -146,8 +146,12 @@ Clients present their identity strings to the service on each API call. As set o
146
146
protocol specification** ] ( wire_protocol.md ) , they do this using the ** authentication** field of the
147
147
API request.
148
148
149
- There are two ways in which the client can use the authentication field to share its identity with
150
- the service: ** direct authentication** and ** authentication tokens** .
149
+ There are currently three ways in which the client can use the authentication field to share its
150
+ identity with the service:
151
+
152
+ - ** direct authentication** .
153
+ - ** authentication tokens** .
154
+ - ** peer credentials** .
151
155
152
156
With ** direct authentication** , the client authenticates the request by directly copying the
153
157
application identity string into the ** authentication** field of the request.
@@ -159,6 +163,12 @@ extracted by the service after verifying the authenticity of the token. A more d
159
163
of authentication tokens and their lifecycle is present in the [ ** sytem architecture
160
164
specification** ] ( ../parsec_service/system_architecture.md ) .
161
165
166
+ With ** peer credentials** , the client authenticates by self-declaring its UID inside the
167
+ ** authentication** field of the request. The Parsec service verifies that this self-declared UID
168
+ matches the actual UID of the connecting process using some peer credentials mechanism. For example,
169
+ Unix domain sockets support peer credentials, allowing the endpoints to get each other's effective
170
+ UIDs and GIDs via the operating system, which is trusted implicitly.
171
+
162
172
When it makes an API request, the client needs to tell the server which kind of authentication is
163
173
being used. This is so that the server knows how to interepret the bytes in the ** authentication**
164
174
field of the request. As described in the [ ** wire protocol specification** ] ( wire_protocol.md ) , the
@@ -177,6 +187,10 @@ permitted numerical values for this field are given as follows:-
177
187
- A value of 2 (` 0x02 ` ) indicates authentication tokens. The service will expect the
178
188
** authentication** field to contain a JWT token. Tokens must be signed with the private key of
179
189
the identity provider and their validity period must cover the moment when the check is done.
190
+ - A value of 3 (` 0x03 ` ) indicates peer credentials authentication. The service will expect the
191
+ ** authentication** field to contain the stringified UID of the connecting process. The Parsec
192
+ service will verify that this self-declared UID is consistent with the UID from the peer
193
+ credentials.
180
194
181
195
Other values are unsupported and will be rejected by the service.
182
196
0 commit comments