af95c3795c
Phase 1 — Structural overhaul: - Move all source from headlamp-sealed-secrets/ subdirectory to repo root - Delete 23 AI-generated docs, 8 pre-built tarballs, release snapshots dir - Remove all working-directory refs from CI/release workflows - Update install-plugin.sh and typedoc.json paths Phase 2 — Config standardization: - Create .eslintrc.js and .prettierrc.js (standard Headlamp configs) - Remove inline eslintConfig/prettier from package.json (drop jsx-a11y, prettier extends) - Rewrite tsconfig.json (package name extend, add compilerOptions.types) - Create vitest.config.mts and vitest.setup.ts (standard from polaris) - Replace headlamp-plugin CLI scripts with direct tool invocation - Rewrite .gitignore with standard baseline Phase 3 — MCP & Claude settings: - Create .mcp.json with github/kubernetes/flux/playwright servers - Create .claude/settings.local.json - Remove 7 specialized agents, keep 3 meta-orchestration agents Phase 4 — Documentation: - Rewrite CLAUDE.md (remove subdirectory refs, standard format) - Add ArtifactHub badge, Architecture section, standardized install methods to README.md - Create CONTRIBUTING.md and SECURITY.md - Fix pre-existing test bugs in validators.test.ts (isValidNamespace returns boolean, not ValidationResult; error message string mismatches) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
110 lines
2.6 KiB
TypeScript
110 lines
2.6 KiB
TypeScript
/**
|
|
* Headlamp Sealed Secrets Plugin
|
|
*
|
|
* A comprehensive plugin for managing Bitnami Sealed Secrets in Kubernetes.
|
|
* Provides UI for viewing, creating, and managing encrypted secrets.
|
|
*
|
|
* Features:
|
|
* - List and detail views for SealedSecrets
|
|
* - Client-side encryption using controller's public key
|
|
* - Sealing keys management
|
|
* - Secret decryption (via K8s Secret access)
|
|
* - Integration with Headlamp's Secret detail view
|
|
*
|
|
* @see https://github.com/bitnami-labs/sealed-secrets
|
|
*/
|
|
|
|
import {
|
|
registerDetailsViewSection,
|
|
registerPluginSettings,
|
|
registerRoute,
|
|
registerSidebarEntry,
|
|
} from '@kinvolk/headlamp-plugin/lib';
|
|
import React from 'react';
|
|
import { ApiErrorBoundary, GenericErrorBoundary } from './components/ErrorBoundary';
|
|
import { SealedSecretList } from './components/SealedSecretList';
|
|
import { SealingKeysView } from './components/SealingKeysView';
|
|
import { SecretDetailsSection } from './components/SecretDetailsSection';
|
|
import { SettingsPage } from './components/SettingsPage';
|
|
|
|
/**
|
|
* Register sidebar navigation
|
|
*/
|
|
|
|
// Main "Sealed Secrets" entry
|
|
registerSidebarEntry({
|
|
parent: null,
|
|
name: 'sealed-secrets',
|
|
label: 'Sealed Secrets',
|
|
icon: 'mdi:lock',
|
|
url: '/sealedsecrets',
|
|
});
|
|
|
|
// "All Sealed Secrets" child entry
|
|
registerSidebarEntry({
|
|
parent: 'sealed-secrets',
|
|
name: 'sealed-secrets-list',
|
|
label: 'All Sealed Secrets',
|
|
url: '/sealedsecrets',
|
|
});
|
|
|
|
// "Sealing Keys" child entry
|
|
registerSidebarEntry({
|
|
parent: 'sealed-secrets',
|
|
name: 'sealing-keys',
|
|
label: 'Sealing Keys',
|
|
url: '/sealedsecrets/keys',
|
|
});
|
|
|
|
/**
|
|
* Register routes
|
|
*/
|
|
|
|
// List view with optional detail drawer
|
|
registerRoute({
|
|
path: '/sealedsecrets/:namespace?/:name?',
|
|
sidebar: 'sealed-secrets-list',
|
|
component: () => (
|
|
<ApiErrorBoundary>
|
|
<SealedSecretList />
|
|
</ApiErrorBoundary>
|
|
),
|
|
exact: true,
|
|
name: 'sealedsecret',
|
|
});
|
|
|
|
// Sealing keys view
|
|
registerRoute({
|
|
path: '/sealedsecrets/keys',
|
|
sidebar: 'sealing-keys',
|
|
component: () => (
|
|
<ApiErrorBoundary>
|
|
<SealingKeysView />
|
|
</ApiErrorBoundary>
|
|
),
|
|
exact: true,
|
|
});
|
|
|
|
/**
|
|
* Register integration with Secret detail view
|
|
*
|
|
* Adds a "Sealed Secret" section to Secrets that are owned by SealedSecrets
|
|
*/
|
|
registerDetailsViewSection(({ resource }) => {
|
|
if (resource?.kind === 'Secret') {
|
|
return (
|
|
<GenericErrorBoundary>
|
|
<SecretDetailsSection resource={resource} />
|
|
</GenericErrorBoundary>
|
|
);
|
|
}
|
|
return null;
|
|
});
|
|
|
|
/**
|
|
* Register plugin settings
|
|
*
|
|
* Settings will appear in Settings → Plugins → sealed-secrets
|
|
*/
|
|
registerPluginSettings('sealed-secrets', SettingsPage, true);
|