= {
+ provider_verified: "Verified with the provider.",
+ backend_verified: "Verified by the connection service.",
+ credentials_rejected:
+ "The provider rejected these credentials. Reconnect to restore access.",
+ connection_missing: "This connection is missing at the connection service.",
+ insufficient_permissions:
+ "The provider refused the verification check. Check permissions, then Refresh.",
+ rate_limited:
+ "The provider limited this check. Wait a moment, then Refresh.",
+ check_timed_out: "The provider check timed out. Use Refresh to retry.",
+ authorization_inactive: "The backend reports authorization is inactive. Reconnect to restore access.",
+ provider_unavailable: "The provider is unavailable. Use Refresh to retry.",
+ backend_unavailable: "The connection backend is unavailable. Use Refresh to retry.",
+ backend_status_unknown: "The backend could not confirm authorization. Use Refresh to retry.",
+ not_checked: "This saved connection is missing information required for a check.",
+ checks_busy: "Connection checks are busy. Use Refresh to retry.",
+ unsupported_provider:
+ "Automatic verification is not available for this provider yet.",
+ unexpected_response:
+ "The provider response could not confirm authorization. Use Refresh to retry.",
+ credentials_unavailable:
+ "Credentials could not be checked. Use Refresh to retry.",
+ };
+ return (
+ explanations[reason ?? ""] ??
+ "Authorization could not be checked. Use Refresh to retry."
+ );
+}
+
function label(entry: IntegrationListEntry) {
return entry.displayName;
}
@@ -82,10 +119,13 @@ function state(entry: IntegrationListEntry): {
} {
if (entry.upstreamConnected === false)
return { label: "Disconnected upstream", variant: "warning" };
- if (entry.status === "ready")
- return { label: "Connected", variant: "success" };
+ if (entry.authorizationStatus === "inactive")
+ return { label: "Authorization inactive", variant: "warning" };
if (["error", "degraded"].includes(entry.status))
return { label: "Needs attention", variant: "warning" };
+ if (entry.authorizationStatus !== "active")
+ return { label: "Authorization unverified", variant: "default" };
+ if (entry.status === "ready") return { label: "Ready", variant: "success" };
if (entry.status === "syncing")
return { label: "Syncing", variant: "default" };
return { label: "Status unverified", variant: "default" };
@@ -127,8 +167,8 @@ function ConnectionsView({
const busy = useRef(false);
const generation = useRef(0);
- async function load(signal?: AbortSignal) {
- const result = await adminApi.integrationProviders(workspaceId, signal);
+ async function load(signal?: AbortSignal, refreshAuthorization = false) {
+ const result = await adminApi.integrationProviders(workspaceId, signal, refreshAuthorization);
return result.providers.flatMap((provider) => {
const c = provider.connection;
return c
@@ -138,6 +178,10 @@ function ConnectionsView({
displayName: provider.displayName,
connectionLabel: c.metadata?.displayName,
status: c.status,
+ upstreamConnected: c.upstreamConnected,
+ authorizationStatus: c.authorizationStatus,
+ authorizationReason: c.authorizationReason,
+ authorizationCheckedAt: c.authorizationCheckedAt,
connectionId: c.connectionId,
version: c.version,
providerConfigKey: c.providerConfigKey ?? null,
@@ -180,7 +224,7 @@ function ConnectionsView({
setError(null);
setConfirm(null);
try {
- const result = await load();
+ const result = await load(undefined, true);
if (mine === generation.current) setEntries(result);
} catch (failure) {
if (mine === generation.current) setError(message(failure));
@@ -342,6 +386,32 @@ function ConnectionsView({
Permissions
{entry.scopes?.join(", ") || "Not recorded"}
+
+
Authorization
+
+ {entry.authorizationStatus === "active"
+ ? "Active"
+ : entry.authorizationStatus === "inactive"
+ ? "Inactive"
+ : "Unverified"}
+
+
+
+
Authorization check
+
+ {authorizationExplanation(entry.authorizationReason)}
+
+
+
+
Checked
+
+ {entry.authorizationCheckedAt
+ ? new Date(
+ entry.authorizationCheckedAt,
+ ).toLocaleString()
+ : "Not checked"}
+
+
{entry.inherited ? (