1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// SPDX-License-Identifier: AGPL-3.0-only
//! Endpoint authentication — the interactive and workload credential providers
//! and the token cache they share.
//!
//! Static headers (`mcp::auth`) and the AAuth request-signer (`aauth`) supply
//! the `static` and `aauth` providers. This module owns the rest: the
//! [`Kind::Cred`](crate::state::Kind::Cred)-backed [`cache`], the OAuth 2.1 /
//! OIDC [`oauth2`] flows (device grant, browser + PKCE, refresh, discovery)
//! behind `agentd login`, and the AWS SigV4 / IAM Identity Center providers.
//! Everything but the cache is gated on the `oauth` cargo feature, so a build
//! without it carries no interactive-login code at all.
/// Canonicalize a login/logout target: `mcp:<name>` on a server that references
/// a service-catalog entry becomes `service:<entry>`, the key the daemon's
/// connect path actually reads. Every server pointing at that entry shares one
/// credential, so a login must land where all of them look and a logout must
/// revoke it for all of them at once. Deliberately outside the `oauth` feature
/// gate, so logout still resolves in a build without interactive login.