@spechtlabs/backstage-plugin-tailscale 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +18 -2
- package/dist/api.esm.js +38 -0
- package/dist/api.esm.js.map +1 -0
- package/dist/components/AccessMap.esm.js +317 -0
- package/dist/components/AccessMap.esm.js.map +1 -0
- package/dist/components/CodeView.esm.js +111 -0
- package/dist/components/CodeView.esm.js.map +1 -0
- package/dist/components/EntityCards.esm.js +313 -0
- package/dist/components/EntityCards.esm.js.map +1 -0
- package/dist/components/PolicyConsole.esm.js +831 -0
- package/dist/components/PolicyConsole.esm.js.map +1 -0
- package/dist/components/Preview.esm.js +196 -0
- package/dist/components/Preview.esm.js.map +1 -0
- package/dist/components/primitives.esm.js +249 -0
- package/dist/components/primitives.esm.js.map +1 -0
- package/dist/components/rules.esm.js +404 -0
- package/dist/components/rules.esm.js.map +1 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.esm.js +61 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js +29 -0
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -0
- package/dist/routes.esm.js +6 -0
- package/dist/routes.esm.js.map +1 -0
- package/dist/tailscale.css.esm.js +5 -0
- package/dist/tailscale.css.esm.js.map +1 -0
- package/package.json +95 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 SpechtLabs
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
package/README.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @spechtlabs/backstage-plugin-tailscale
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The frontend of [Tailscale for Backstage](https://github.com/SpechtLabs/backstage-plugin-tailscale)
|
|
4
|
+
(new frontend system): a tailnet policy console at `/tailscale` (access map,
|
|
5
|
+
grants, SSH, access preview, groups, tags, tests and the rendered policy
|
|
6
|
+
file), a _Policy_ tab on policy entities, and cards on Component, API,
|
|
7
|
+
Resource, Group, User and Tailscale entity pages.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
yarn --cwd packages/app add @spechtlabs/backstage-plugin-tailscale
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
With feature discovery there is nothing else to do; otherwise add the default
|
|
14
|
+
export to `createApp({ features })`. It needs the backend plugin,
|
|
15
|
+
`@spechtlabs/backstage-plugin-tailscale-backend`. See the
|
|
16
|
+
[repository's README](https://github.com/SpechtLabs/backstage-plugin-tailscale#readme)
|
|
17
|
+
for modelling a tailnet in the catalog.
|
|
18
|
+
|
|
19
|
+
Not made or endorsed by Tailscale Inc.
|
package/dist/api.esm.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createApiRef } from '@backstage/frontend-plugin-api';
|
|
2
|
+
|
|
3
|
+
const tailscaleApiRef = createApiRef().with({
|
|
4
|
+
id: "plugin.tailscale",
|
|
5
|
+
pluginId: "tailscale"
|
|
6
|
+
});
|
|
7
|
+
class TailscaleClient {
|
|
8
|
+
constructor(deps) {
|
|
9
|
+
this.deps = deps;
|
|
10
|
+
}
|
|
11
|
+
deps;
|
|
12
|
+
cached;
|
|
13
|
+
getOverview() {
|
|
14
|
+
if (this.cached && Date.now() - this.cached.at < 6e4) {
|
|
15
|
+
return this.cached.overview;
|
|
16
|
+
}
|
|
17
|
+
const overview = this.get("/overview");
|
|
18
|
+
this.cached = { at: Date.now(), overview };
|
|
19
|
+
overview.catch(() => {
|
|
20
|
+
if (this.cached?.overview === overview) this.cached = void 0;
|
|
21
|
+
});
|
|
22
|
+
return overview;
|
|
23
|
+
}
|
|
24
|
+
getAccess(entityRef) {
|
|
25
|
+
return this.get(`/access?entity=${encodeURIComponent(entityRef)}`);
|
|
26
|
+
}
|
|
27
|
+
async get(path) {
|
|
28
|
+
const base = await this.deps.discoveryApi.getBaseUrl("tailscale");
|
|
29
|
+
const response = await this.deps.fetchApi.fetch(`${base}${path}`);
|
|
30
|
+
if (!response.ok) {
|
|
31
|
+
throw new Error(`Tailscale: ${response.status} ${response.statusText}`);
|
|
32
|
+
}
|
|
33
|
+
return await response.json();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { TailscaleClient, tailscaleApiRef };
|
|
38
|
+
//# sourceMappingURL=api.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.esm.js","sources":["../src/api.ts"],"sourcesContent":["import {\n createApiRef,\n type DiscoveryApi,\n type FetchApi,\n} from '@backstage/frontend-plugin-api';\nimport type {\n EntityAccess,\n Overview,\n} from '@spechtlabs/backstage-plugin-tailscale-common';\n\n/*\n * What the tailscale backend serves: the types live in the common package,\n * shared with the backend.\n */\nexport type {\n ApproverRule,\n CatalogEdge,\n DestinationClass,\n DestinationView,\n Diagnostic,\n EntityAccess,\n Finding,\n GrantRule,\n GroupView,\n HostView,\n Identity,\n Lines,\n Member,\n NodeAttrRule,\n Overview,\n PartSummary,\n PolicyView,\n Principal,\n PrincipalKind,\n PublishSpec,\n PublishStatus,\n Rule,\n SshRule,\n Span,\n TagRule,\n TailscaleType,\n TestRule,\n} from '@spechtlabs/backstage-plugin-tailscale-common';\n\n/** A grant's application capabilities: name to values. */\nexport type App = Record<string, unknown[]>;\n\n/** @public */\nexport interface TailscaleApi {\n getOverview(): Promise<Overview>;\n getAccess(entityRef: string): Promise<EntityAccess[]>;\n}\n\n/** @public */\nexport const tailscaleApiRef = createApiRef<TailscaleApi>().with({\n id: 'plugin.tailscale',\n pluginId: 'tailscale',\n});\n\n/**\n * Keeps the overview for a minute: the page, the policy tab and every entity\n * card read it, and the backend renders it from the whole catalog.\n */\n/** @public */\nexport class TailscaleClient implements TailscaleApi {\n private cached?: { at: number; overview: Promise<Overview> };\n\n constructor(\n private readonly deps: { discoveryApi: DiscoveryApi; fetchApi: FetchApi },\n ) {}\n\n getOverview(): Promise<Overview> {\n if (this.cached && Date.now() - this.cached.at < 60_000) {\n return this.cached.overview;\n }\n const overview = this.get<Overview>('/overview');\n this.cached = { at: Date.now(), overview };\n overview.catch(() => {\n if (this.cached?.overview === overview) this.cached = undefined;\n });\n return overview;\n }\n\n getAccess(entityRef: string): Promise<EntityAccess[]> {\n return this.get(`/access?entity=${encodeURIComponent(entityRef)}`);\n }\n\n private async get<T>(path: string): Promise<T> {\n const base = await this.deps.discoveryApi.getBaseUrl('tailscale');\n const response = await this.deps.fetchApi.fetch(`${base}${path}`);\n if (!response.ok) {\n throw new Error(`Tailscale: ${response.status} ${response.statusText}`);\n }\n return (await response.json()) as T;\n }\n}\n"],"names":[],"mappings":";;AAsDO,MAAM,eAAA,GAAkB,YAAA,EAA2B,CAAE,IAAA,CAAK;AAAA,EAC/D,EAAA,EAAI,kBAAA;AAAA,EACJ,QAAA,EAAU;AACZ,CAAC;AAOM,MAAM,eAAA,CAAwC;AAAA,EAGnD,YACmB,IAAA,EACjB;AADiB,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AAAA,EAChB;AAAA,EADgB,IAAA;AAAA,EAHX,MAAA;AAAA,EAMR,WAAA,GAAiC;AAC/B,IAAA,IAAI,IAAA,CAAK,UAAU,IAAA,CAAK,GAAA,KAAQ,IAAA,CAAK,MAAA,CAAO,KAAK,GAAA,EAAQ;AACvD,MAAA,OAAO,KAAK,MAAA,CAAO,QAAA;AAAA,IACrB;AACA,IAAA,MAAM,QAAA,GAAW,IAAA,CAAK,GAAA,CAAc,WAAW,CAAA;AAC/C,IAAA,IAAA,CAAK,SAAS,EAAE,EAAA,EAAI,IAAA,CAAK,GAAA,IAAO,QAAA,EAAS;AACzC,IAAA,QAAA,CAAS,MAAM,MAAM;AACnB,MAAA,IAAI,IAAA,CAAK,MAAA,EAAQ,QAAA,KAAa,QAAA,OAAe,MAAA,GAAS,MAAA;AAAA,IACxD,CAAC,CAAA;AACD,IAAA,OAAO,QAAA;AAAA,EACT;AAAA,EAEA,UAAU,SAAA,EAA4C;AACpD,IAAA,OAAO,KAAK,GAAA,CAAI,CAAA,eAAA,EAAkB,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAE,CAAA;AAAA,EACnE;AAAA,EAEA,MAAc,IAAO,IAAA,EAA0B;AAC7C,IAAA,MAAM,OAAO,MAAM,IAAA,CAAK,IAAA,CAAK,YAAA,CAAa,WAAW,WAAW,CAAA;AAChE,IAAA,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,IAAA,CAAK,QAAA,CAAS,MAAM,CAAA,EAAG,IAAI,CAAA,EAAG,IAAI,CAAA,CAAE,CAAA;AAChE,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,MAAM,IAAI,MAAM,CAAA,WAAA,EAAc,QAAA,CAAS,MAAM,CAAA,CAAA,EAAI,QAAA,CAAS,UAAU,CAAA,CAAE,CAAA;AAAA,IACxE;AACA,IAAA,OAAQ,MAAM,SAAS,IAAA,EAAK;AAAA,EAC9B;AACF;;"}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useMemo } from 'react';
|
|
3
|
+
import { kindOf } from './primitives.esm.js';
|
|
4
|
+
|
|
5
|
+
const COLOUR = {
|
|
6
|
+
group: "var(--ts-group)",
|
|
7
|
+
user: "var(--ts-user)",
|
|
8
|
+
tag: "var(--ts-tag)",
|
|
9
|
+
service: "var(--ts-service)",
|
|
10
|
+
autogroup: "var(--ts-neutral)",
|
|
11
|
+
host: "var(--ts-neutral)",
|
|
12
|
+
address: "var(--ts-neutral)",
|
|
13
|
+
ipset: "var(--ts-neutral)",
|
|
14
|
+
any: "var(--ts-any)"
|
|
15
|
+
};
|
|
16
|
+
const CLASSES = [
|
|
17
|
+
{
|
|
18
|
+
id: "service",
|
|
19
|
+
label: "Services",
|
|
20
|
+
hint: "Tailscale Services: reached wherever they are served"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "mesh",
|
|
24
|
+
label: "Peer meshes",
|
|
25
|
+
hint: "Tags that reach themselves: every member at its own address"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "capability",
|
|
29
|
+
label: "Capability targets",
|
|
30
|
+
hint: "Apps that read capabilities matched on their own address"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "autogroup",
|
|
34
|
+
label: "Autogroups",
|
|
35
|
+
hint: "Each user's own devices, the internet through exit nodes, \u2026"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: "device",
|
|
39
|
+
label: "Devices",
|
|
40
|
+
hint: "Reached at their own address, for a reason their tag entity gives"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "any",
|
|
44
|
+
label: "Everything",
|
|
45
|
+
hint: "Break-glass: every device on every port"
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
const ROW = 30;
|
|
49
|
+
const HEADING = 26;
|
|
50
|
+
const NODE_HEIGHT = 22;
|
|
51
|
+
const TOP = 34;
|
|
52
|
+
const WIDTH = 980;
|
|
53
|
+
const CHAR_WIDTH = 7.3;
|
|
54
|
+
const restingOpacity = (capability) => capability ? 0.7 : 0.55;
|
|
55
|
+
const width = (name) => Math.max(80, (name === "*" ? 10 : name.length) * CHAR_WIDTH + 34);
|
|
56
|
+
function AccessMap(props) {
|
|
57
|
+
const [hover, setHover] = useState();
|
|
58
|
+
const [layers, setLayers] = useState({
|
|
59
|
+
network: true,
|
|
60
|
+
capability: true
|
|
61
|
+
});
|
|
62
|
+
const all = useMemo(() => {
|
|
63
|
+
const pairs = /* @__PURE__ */ new Map();
|
|
64
|
+
for (const g of props.grants) {
|
|
65
|
+
const layer = g.app ? "capability" : "network";
|
|
66
|
+
for (const s of g.src) {
|
|
67
|
+
for (const d of g.dst) {
|
|
68
|
+
const key = `${layer}\0${s.name}\0${d.name}`;
|
|
69
|
+
const edge = pairs.get(key) ?? {
|
|
70
|
+
src: s.name,
|
|
71
|
+
dst: d.name,
|
|
72
|
+
layer,
|
|
73
|
+
ports: /* @__PURE__ */ new Set(),
|
|
74
|
+
caps: /* @__PURE__ */ new Set(),
|
|
75
|
+
catalog: false
|
|
76
|
+
};
|
|
77
|
+
g.ip.forEach((p) => edge.ports.add(p));
|
|
78
|
+
Object.keys(g.app ?? {}).forEach(
|
|
79
|
+
(c) => edge.caps.add(c.split("/cap/")[1] ?? c)
|
|
80
|
+
);
|
|
81
|
+
edge.catalog ||= g.origin === "catalog";
|
|
82
|
+
pairs.set(key, edge);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return [...pairs.values()];
|
|
87
|
+
}, [props.grants]);
|
|
88
|
+
const { sources, destinations, headings, edges, height } = useMemo(() => {
|
|
89
|
+
const visible = all.filter((e) => layers[e.layer]);
|
|
90
|
+
const rank = {
|
|
91
|
+
group: 0,
|
|
92
|
+
user: 1,
|
|
93
|
+
autogroup: 2,
|
|
94
|
+
tag: 3,
|
|
95
|
+
service: 4,
|
|
96
|
+
host: 5,
|
|
97
|
+
address: 6,
|
|
98
|
+
ipset: 7,
|
|
99
|
+
any: 8
|
|
100
|
+
};
|
|
101
|
+
const left = [...new Set(visible.map((e) => e.src))].sort((a, b) => rank[kindOf(a)] - rank[kindOf(b)] || a.localeCompare(b)).map(
|
|
102
|
+
(name, i) => ({
|
|
103
|
+
name,
|
|
104
|
+
kind: kindOf(name),
|
|
105
|
+
y: TOP + i * ROW,
|
|
106
|
+
width: width(name)
|
|
107
|
+
})
|
|
108
|
+
);
|
|
109
|
+
const info = new Map((props.destinations ?? []).map((d) => [d.name, d]));
|
|
110
|
+
const classOf = (name) => info.get(name)?.class ?? (name.startsWith("svc:") ? "service" : "device");
|
|
111
|
+
const names = [...new Set(visible.map((e) => e.dst))];
|
|
112
|
+
const right = [];
|
|
113
|
+
const heads = [];
|
|
114
|
+
let y = TOP;
|
|
115
|
+
for (const cls of CLASSES) {
|
|
116
|
+
const inClass = names.filter((n) => classOf(n) === cls.id).sort();
|
|
117
|
+
if (!inClass.length) continue;
|
|
118
|
+
heads.push({ y: y + 15, label: cls.label, hint: cls.hint });
|
|
119
|
+
y += HEADING;
|
|
120
|
+
for (const name of inClass) {
|
|
121
|
+
const d = info.get(name);
|
|
122
|
+
right.push({
|
|
123
|
+
name,
|
|
124
|
+
kind: kindOf(name),
|
|
125
|
+
y,
|
|
126
|
+
width: width(name),
|
|
127
|
+
unexplained: cls.id === "device" && name.startsWith("tag:") && !d?.reason
|
|
128
|
+
});
|
|
129
|
+
y += ROW;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
sources: left,
|
|
134
|
+
destinations: right,
|
|
135
|
+
headings: heads,
|
|
136
|
+
edges: visible,
|
|
137
|
+
height: Math.max(TOP + left.length * ROW, y) + 4
|
|
138
|
+
};
|
|
139
|
+
}, [all, layers, props.destinations]);
|
|
140
|
+
const hasCaps = all.some((e) => e.layer === "capability");
|
|
141
|
+
if (!all.length) return null;
|
|
142
|
+
const leftWidth = Math.max(80, ...sources.map((n) => n.width));
|
|
143
|
+
const rightX = WIDTH - Math.max(80, ...destinations.map((n) => n.width));
|
|
144
|
+
const at = (nodes, name) => nodes.find((n) => n.name === name);
|
|
145
|
+
const touches = (e) => !hover || e.src === hover || e.dst === hover;
|
|
146
|
+
const lit = new Set(
|
|
147
|
+
edges.filter((e) => hover && touches(e)).flatMap((e) => [e.src, e.dst])
|
|
148
|
+
);
|
|
149
|
+
const capabilityLabels = destinations.flatMap((n) => {
|
|
150
|
+
const caps = edges.filter(
|
|
151
|
+
(e) => e.layer === "capability" && e.dst === n.name
|
|
152
|
+
);
|
|
153
|
+
if (!caps.length) return [];
|
|
154
|
+
const names = [...new Set(caps.flatMap((e) => [...e.caps]))].join(", ");
|
|
155
|
+
return [
|
|
156
|
+
{
|
|
157
|
+
dst: n.name,
|
|
158
|
+
y: n.y - 3,
|
|
159
|
+
text: caps.length > 1 ? `${names} \xD7${caps.length}` : names
|
|
160
|
+
}
|
|
161
|
+
];
|
|
162
|
+
});
|
|
163
|
+
const nodeView = (n, side) => {
|
|
164
|
+
const x = side === "left" ? leftWidth - n.width : rightX;
|
|
165
|
+
const dim = hover && !lit.has(n.name);
|
|
166
|
+
const colour = COLOUR[n.kind];
|
|
167
|
+
return /* @__PURE__ */ jsxs(
|
|
168
|
+
"g",
|
|
169
|
+
{
|
|
170
|
+
className: `ts-map-node${dim ? " ts-map-dim" : ""}`,
|
|
171
|
+
transform: `translate(${x}, ${n.y})`,
|
|
172
|
+
onMouseEnter: () => setHover(n.name),
|
|
173
|
+
onMouseLeave: () => setHover(void 0),
|
|
174
|
+
onClick: () => props.onSelect?.(n.name),
|
|
175
|
+
role: "button",
|
|
176
|
+
"aria-label": n.name,
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ jsx(
|
|
179
|
+
"rect",
|
|
180
|
+
{
|
|
181
|
+
width: n.width,
|
|
182
|
+
height: NODE_HEIGHT,
|
|
183
|
+
rx: 6,
|
|
184
|
+
style: {
|
|
185
|
+
fill: `color-mix(in srgb, ${colour} 10%, var(--bui-bg-neutral-1))`,
|
|
186
|
+
stroke: n.unexplained ? "var(--ts-check)" : `color-mix(in srgb, ${colour} 40%, transparent)`,
|
|
187
|
+
strokeDasharray: n.unexplained ? "3 2" : void 0
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
),
|
|
191
|
+
/* @__PURE__ */ jsx("circle", { cx: 11, cy: NODE_HEIGHT / 2, r: 3.5, style: { fill: colour } }),
|
|
192
|
+
/* @__PURE__ */ jsx("text", { x: 22, y: 15, style: { fill: colour }, children: n.name === "*" ? "everything" : n.name }),
|
|
193
|
+
n.unexplained ? /* @__PURE__ */ jsx("title", { children: `${n.name} is reached as a device and its tag entity doesn't say why` }) : null
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
`${side}:${n.name}`
|
|
197
|
+
);
|
|
198
|
+
};
|
|
199
|
+
const toggle = (layer, label, sample) => /* @__PURE__ */ jsxs("label", { className: "ts-map-layer", children: [
|
|
200
|
+
/* @__PURE__ */ jsx(
|
|
201
|
+
"input",
|
|
202
|
+
{
|
|
203
|
+
type: "checkbox",
|
|
204
|
+
checked: layers[layer],
|
|
205
|
+
onChange: (e) => setLayers((l) => ({ ...l, [layer]: e.target.checked }))
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
/* @__PURE__ */ jsx("svg", { width: "26", height: "10", "aria-hidden": true, children: sample }),
|
|
209
|
+
label
|
|
210
|
+
] });
|
|
211
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
212
|
+
hasCaps ? /* @__PURE__ */ jsxs("div", { className: "ts-row ts-small ts-map-layers", children: [
|
|
213
|
+
toggle(
|
|
214
|
+
"network",
|
|
215
|
+
"Network access",
|
|
216
|
+
/* @__PURE__ */ jsx(
|
|
217
|
+
"line",
|
|
218
|
+
{
|
|
219
|
+
x1: "0",
|
|
220
|
+
y1: "5",
|
|
221
|
+
x2: "26",
|
|
222
|
+
y2: "5",
|
|
223
|
+
style: { stroke: "var(--ts-neutral)", strokeWidth: 2 }
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
),
|
|
227
|
+
toggle(
|
|
228
|
+
"capability",
|
|
229
|
+
"Capabilities (app grants)",
|
|
230
|
+
/* @__PURE__ */ jsx(
|
|
231
|
+
"line",
|
|
232
|
+
{
|
|
233
|
+
x1: "0",
|
|
234
|
+
y1: "5",
|
|
235
|
+
x2: "26",
|
|
236
|
+
y2: "5",
|
|
237
|
+
style: {
|
|
238
|
+
stroke: "var(--ts-cap)",
|
|
239
|
+
strokeWidth: 2,
|
|
240
|
+
strokeDasharray: "4 3"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
)
|
|
245
|
+
] }) : null,
|
|
246
|
+
/* @__PURE__ */ jsxs(
|
|
247
|
+
"svg",
|
|
248
|
+
{
|
|
249
|
+
className: "ts-map",
|
|
250
|
+
viewBox: `0 0 ${WIDTH} ${height}`,
|
|
251
|
+
role: "img",
|
|
252
|
+
"aria-label": "Access map: sources and the destinations their grants reach",
|
|
253
|
+
children: [
|
|
254
|
+
/* @__PURE__ */ jsx("text", { className: "ts-map-heading", x: 0, y: 14, children: "Sources" }),
|
|
255
|
+
/* @__PURE__ */ jsx("text", { className: "ts-map-heading", x: WIDTH, y: 14, textAnchor: "end", children: "Destinations" }),
|
|
256
|
+
headings.map((h) => /* @__PURE__ */ jsxs(
|
|
257
|
+
"text",
|
|
258
|
+
{
|
|
259
|
+
className: "ts-map-class",
|
|
260
|
+
x: WIDTH,
|
|
261
|
+
y: h.y,
|
|
262
|
+
textAnchor: "end",
|
|
263
|
+
children: [
|
|
264
|
+
h.label,
|
|
265
|
+
/* @__PURE__ */ jsx("title", { children: h.hint })
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
h.label
|
|
269
|
+
)),
|
|
270
|
+
edges.map((e) => {
|
|
271
|
+
const from = at(sources, e.src);
|
|
272
|
+
const to = at(destinations, e.dst);
|
|
273
|
+
const x1 = leftWidth;
|
|
274
|
+
const y1 = from.y + NODE_HEIGHT / 2;
|
|
275
|
+
const x2 = rightX;
|
|
276
|
+
const y2 = to.y + NODE_HEIGHT / 2;
|
|
277
|
+
const mid = (x1 + x2) / 2;
|
|
278
|
+
const on = hover && touches(e);
|
|
279
|
+
const cap = e.layer === "capability";
|
|
280
|
+
const ports = [...e.ports].join(", ") || "no ports";
|
|
281
|
+
return /* @__PURE__ */ jsx("g", { "data-layer": e.layer, children: /* @__PURE__ */ jsx(
|
|
282
|
+
"path",
|
|
283
|
+
{
|
|
284
|
+
d: `M${x1},${y1} C${mid},${y1} ${mid},${y2} ${x2},${y2}`,
|
|
285
|
+
className: `ts-map-edge${hover && !on ? " ts-map-dim" : ""}${on ? " ts-map-on" : ""}`,
|
|
286
|
+
style: {
|
|
287
|
+
stroke: cap ? "var(--ts-cap)" : COLOUR[kindOf(e.src)],
|
|
288
|
+
strokeDasharray: cap ? "5 4" : void 0,
|
|
289
|
+
opacity: hover ? void 0 : restingOpacity(cap)
|
|
290
|
+
},
|
|
291
|
+
children: /* @__PURE__ */ jsx("title", { children: cap ? `${e.src} \u2192 ${e.dst}: capabilities ${[...e.caps].join(
|
|
292
|
+
", "
|
|
293
|
+
)} (on ${ports})` : `${e.src} \u2192 ${e.dst}: ${ports}${e.catalog ? " \xB7 from the catalog" : ""}` })
|
|
294
|
+
}
|
|
295
|
+
) }, `${e.layer}:${e.src}->${e.dst}`);
|
|
296
|
+
}),
|
|
297
|
+
capabilityLabels.map((l) => /* @__PURE__ */ jsx(
|
|
298
|
+
"text",
|
|
299
|
+
{
|
|
300
|
+
className: `ts-map-cap${hover && !lit.has(l.dst) ? " ts-map-dim" : ""}`,
|
|
301
|
+
x: rightX - 6,
|
|
302
|
+
y: l.y,
|
|
303
|
+
textAnchor: "end",
|
|
304
|
+
children: l.text
|
|
305
|
+
},
|
|
306
|
+
l.dst
|
|
307
|
+
)),
|
|
308
|
+
sources.map((n) => nodeView(n, "left")),
|
|
309
|
+
destinations.map((n) => nodeView(n, "right"))
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
)
|
|
313
|
+
] });
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export { AccessMap, CLASSES };
|
|
317
|
+
//# sourceMappingURL=AccessMap.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessMap.esm.js","sources":["../../src/components/AccessMap.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport type {\n DestinationClass,\n DestinationView,\n GrantRule,\n PrincipalKind,\n} from '../api';\nimport { kindOf } from './primitives';\n\nconst COLOUR: Record<PrincipalKind, string> = {\n group: 'var(--ts-group)',\n user: 'var(--ts-user)',\n tag: 'var(--ts-tag)',\n service: 'var(--ts-service)',\n autogroup: 'var(--ts-neutral)',\n host: 'var(--ts-neutral)',\n address: 'var(--ts-neutral)',\n ipset: 'var(--ts-neutral)',\n any: 'var(--ts-any)',\n};\n\n/** Destination classes, in the order the map lists them. */\nexport const CLASSES: Array<{\n id: DestinationClass;\n label: string;\n hint: string;\n}> = [\n {\n id: 'service',\n label: 'Services',\n hint: 'Tailscale Services: reached wherever they are served',\n },\n {\n id: 'mesh',\n label: 'Peer meshes',\n hint: 'Tags that reach themselves: every member at its own address',\n },\n {\n id: 'capability',\n label: 'Capability targets',\n hint: 'Apps that read capabilities matched on their own address',\n },\n {\n id: 'autogroup',\n label: 'Autogroups',\n hint: \"Each user's own devices, the internet through exit nodes, …\",\n },\n {\n id: 'device',\n label: 'Devices',\n hint: 'Reached at their own address, for a reason their tag entity gives',\n },\n {\n id: 'any',\n label: 'Everything',\n hint: 'Break-glass: every device on every port',\n },\n];\n\nconst ROW = 30;\nconst HEADING = 26;\nconst NODE_HEIGHT = 22;\nconst TOP = 34;\nconst WIDTH = 980;\nconst CHAR_WIDTH = 7.3;\n\ntype Layer = 'network' | 'capability';\n\ninterface Node {\n name: string;\n kind: PrincipalKind;\n y: number;\n width: number;\n /** A device destination without a declared reason. */\n unexplained?: boolean;\n}\n\ninterface Edge {\n src: string;\n dst: string;\n layer: Layer;\n ports: Set<string>;\n caps: Set<string>;\n catalog: boolean;\n}\n\n/** Unhovered, capability lines a little stronger: they're dashed. */\nconst restingOpacity = (capability: boolean) => (capability ? 0.7 : 0.55);\n\nconst width = (name: string) =>\n Math.max(80, (name === '*' ? 10 : name.length) * CHAR_WIDTH + 34);\n\n/**\n * Who reaches what: every grant's sources on the left, its destinations on\n * the right, grouped by what they are (Services, peer meshes, capability\n * targets, …). Grants that carry capabilities are a layer of their own:\n * dashed, labelled with the capability, and kept out of the network trace.\n * Hovering a selector traces it; clicking it filters the grants.\n */\nexport function AccessMap(props: {\n grants: GrantRule[];\n destinations?: DestinationView[];\n onSelect?: (name: string) => void;\n}) {\n const [hover, setHover] = useState<string>();\n const [layers, setLayers] = useState<Record<Layer, boolean>>({\n network: true,\n capability: true,\n });\n\n const all = useMemo(() => {\n const pairs = new Map<string, Edge>();\n for (const g of props.grants) {\n const layer: Layer = g.app ? 'capability' : 'network';\n for (const s of g.src) {\n for (const d of g.dst) {\n const key = `${layer}\\u0000${s.name}\\u0000${d.name}`;\n const edge = pairs.get(key) ?? {\n src: s.name,\n dst: d.name,\n layer,\n ports: new Set<string>(),\n caps: new Set<string>(),\n catalog: false,\n };\n g.ip.forEach(p => edge.ports.add(p));\n Object.keys(g.app ?? {}).forEach(c =>\n edge.caps.add(c.split('/cap/')[1] ?? c),\n );\n edge.catalog ||= g.origin === 'catalog';\n pairs.set(key, edge);\n }\n }\n }\n return [...pairs.values()];\n }, [props.grants]);\n\n const { sources, destinations, headings, edges, height } = useMemo(() => {\n const visible = all.filter(e => layers[e.layer]);\n const rank: Record<string, number> = {\n group: 0,\n user: 1,\n autogroup: 2,\n tag: 3,\n service: 4,\n host: 5,\n address: 6,\n ipset: 7,\n any: 8,\n };\n const left = [...new Set(visible.map(e => e.src))]\n .sort((a, b) => rank[kindOf(a)] - rank[kindOf(b)] || a.localeCompare(b))\n .map(\n (name, i): Node => ({\n name,\n kind: kindOf(name),\n y: TOP + i * ROW,\n width: width(name),\n }),\n );\n\n const info = new Map((props.destinations ?? []).map(d => [d.name, d]));\n const classOf = (name: string): DestinationClass =>\n info.get(name)?.class ?? (name.startsWith('svc:') ? 'service' : 'device');\n const names = [...new Set(visible.map(e => e.dst))];\n const right: Node[] = [];\n const heads: Array<{ y: number; label: string; hint: string }> = [];\n let y = TOP;\n for (const cls of CLASSES) {\n const inClass = names.filter(n => classOf(n) === cls.id).sort();\n if (!inClass.length) continue;\n heads.push({ y: y + 15, label: cls.label, hint: cls.hint });\n y += HEADING;\n for (const name of inClass) {\n const d = info.get(name);\n right.push({\n name,\n kind: kindOf(name),\n y,\n width: width(name),\n unexplained:\n cls.id === 'device' && name.startsWith('tag:') && !d?.reason,\n });\n y += ROW;\n }\n }\n return {\n sources: left,\n destinations: right,\n headings: heads,\n edges: visible,\n height: Math.max(TOP + left.length * ROW, y) + 4,\n };\n }, [all, layers, props.destinations]);\n\n const hasCaps = all.some(e => e.layer === 'capability');\n if (!all.length) return null;\n const leftWidth = Math.max(80, ...sources.map(n => n.width));\n const rightX = WIDTH - Math.max(80, ...destinations.map(n => n.width));\n const at = (nodes: Node[], name: string) => nodes.find(n => n.name === name)!;\n const touches = (e: Edge) => !hover || e.src === hover || e.dst === hover;\n const lit = new Set(\n edges.filter(e => hover && touches(e)).flatMap(e => [e.src, e.dst]),\n );\n\n // One label per destination: what the capability grants to it carry.\n const capabilityLabels = destinations.flatMap(n => {\n const caps = edges.filter(\n e => e.layer === 'capability' && e.dst === n.name,\n );\n if (!caps.length) return [];\n const names = [...new Set(caps.flatMap(e => [...e.caps]))].join(', ');\n return [\n {\n dst: n.name,\n y: n.y - 3,\n text: caps.length > 1 ? `${names} ×${caps.length}` : names,\n },\n ];\n });\n\n const nodeView = (n: Node, side: 'left' | 'right') => {\n const x = side === 'left' ? leftWidth - n.width : rightX;\n const dim = hover && !lit.has(n.name);\n const colour = COLOUR[n.kind];\n return (\n <g\n key={`${side}:${n.name}`}\n className={`ts-map-node${dim ? ' ts-map-dim' : ''}`}\n transform={`translate(${x}, ${n.y})`}\n onMouseEnter={() => setHover(n.name)}\n onMouseLeave={() => setHover(undefined)}\n onClick={() => props.onSelect?.(n.name)}\n role=\"button\"\n aria-label={n.name}\n >\n <rect\n width={n.width}\n height={NODE_HEIGHT}\n rx={6}\n style={{\n fill: `color-mix(in srgb, ${colour} 10%, var(--bui-bg-neutral-1))`,\n stroke: n.unexplained\n ? 'var(--ts-check)'\n : `color-mix(in srgb, ${colour} 40%, transparent)`,\n strokeDasharray: n.unexplained ? '3 2' : undefined,\n }}\n />\n <circle cx={11} cy={NODE_HEIGHT / 2} r={3.5} style={{ fill: colour }} />\n <text x={22} y={15} style={{ fill: colour }}>\n {n.name === '*' ? 'everything' : n.name}\n </text>\n {n.unexplained ? (\n <title>{`${n.name} is reached as a device and its tag entity doesn't say why`}</title>\n ) : null}\n </g>\n );\n };\n\n const toggle = (layer: Layer, label: string, sample: JSX.Element) => (\n <label className=\"ts-map-layer\">\n <input\n type=\"checkbox\"\n checked={layers[layer]}\n onChange={e => setLayers(l => ({ ...l, [layer]: e.target.checked }))}\n />\n <svg width=\"26\" height=\"10\" aria-hidden>\n {sample}\n </svg>\n {label}\n </label>\n );\n\n return (\n <div>\n {hasCaps ? (\n <div className=\"ts-row ts-small ts-map-layers\">\n {toggle(\n 'network',\n 'Network access',\n <line\n x1=\"0\"\n y1=\"5\"\n x2=\"26\"\n y2=\"5\"\n style={{ stroke: 'var(--ts-neutral)', strokeWidth: 2 }}\n />,\n )}\n {toggle(\n 'capability',\n 'Capabilities (app grants)',\n <line\n x1=\"0\"\n y1=\"5\"\n x2=\"26\"\n y2=\"5\"\n style={{\n stroke: 'var(--ts-cap)',\n strokeWidth: 2,\n strokeDasharray: '4 3',\n }}\n />,\n )}\n </div>\n ) : null}\n <svg\n className=\"ts-map\"\n viewBox={`0 0 ${WIDTH} ${height}`}\n role=\"img\"\n aria-label=\"Access map: sources and the destinations their grants reach\"\n >\n <text className=\"ts-map-heading\" x={0} y={14}>\n Sources\n </text>\n <text className=\"ts-map-heading\" x={WIDTH} y={14} textAnchor=\"end\">\n Destinations\n </text>\n {headings.map(h => (\n <text\n key={h.label}\n className=\"ts-map-class\"\n x={WIDTH}\n y={h.y}\n textAnchor=\"end\"\n >\n {h.label}\n <title>{h.hint}</title>\n </text>\n ))}\n {edges.map(e => {\n const from = at(sources, e.src);\n const to = at(destinations, e.dst);\n const x1 = leftWidth;\n const y1 = from.y + NODE_HEIGHT / 2;\n const x2 = rightX;\n const y2 = to.y + NODE_HEIGHT / 2;\n const mid = (x1 + x2) / 2;\n const on = hover && touches(e);\n const cap = e.layer === 'capability';\n const ports = [...e.ports].join(', ') || 'no ports';\n return (\n <g key={`${e.layer}:${e.src}->${e.dst}`} data-layer={e.layer}>\n <path\n d={`M${x1},${y1} C${mid},${y1} ${mid},${y2} ${x2},${y2}`}\n className={`ts-map-edge${hover && !on ? ' ts-map-dim' : ''}${\n on ? ' ts-map-on' : ''\n }`}\n style={{\n stroke: cap ? 'var(--ts-cap)' : COLOUR[kindOf(e.src)],\n strokeDasharray: cap ? '5 4' : undefined,\n opacity: hover ? undefined : restingOpacity(cap),\n }}\n >\n <title>\n {cap\n ? `${e.src} → ${e.dst}: capabilities ${[...e.caps].join(\n ', ',\n )} (on ${ports})`\n : `${e.src} → ${e.dst}: ${ports}${\n e.catalog ? ' · from the catalog' : ''\n }`}\n </title>\n </path>\n </g>\n );\n })}\n {capabilityLabels.map(l => (\n <text\n key={l.dst}\n className={`ts-map-cap${\n hover && !lit.has(l.dst) ? ' ts-map-dim' : ''\n }`}\n x={rightX - 6}\n y={l.y}\n textAnchor=\"end\"\n >\n {l.text}\n </text>\n ))}\n {sources.map(n => nodeView(n, 'left'))}\n {destinations.map(n => nodeView(n, 'right'))}\n </svg>\n </div>\n );\n}\n"],"names":[],"mappings":";;;;AASA,MAAM,MAAA,GAAwC;AAAA,EAC5C,KAAA,EAAO,iBAAA;AAAA,EACP,IAAA,EAAM,gBAAA;AAAA,EACN,GAAA,EAAK,eAAA;AAAA,EACL,OAAA,EAAS,mBAAA;AAAA,EACT,SAAA,EAAW,mBAAA;AAAA,EACX,IAAA,EAAM,mBAAA;AAAA,EACN,OAAA,EAAS,mBAAA;AAAA,EACT,KAAA,EAAO,mBAAA;AAAA,EACP,GAAA,EAAK;AACP,CAAA;AAGO,MAAM,OAAA,GAIR;AAAA,EACH;AAAA,IACE,EAA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