Pulse/internal/api
rcourtman 5ff69a7e35 test: Add adminBypassEnabled tests
Add 5 tests to cover all branches:
- Not requested (ALLOW_ADMIN_BYPASS != "1")
- Enabled with PULSE_DEV=true
- Enabled with NODE_ENV=development
- Case-insensitive NODE_ENV check
- Declined when outside dev mode

Coverage: 40% → 100%
2025-12-02 01:53:55 +00:00
..
alerts.go
alerts_test.go
auth.go
auth_helpers_test.go Add unit tests for auth helper functions (internal/api) 2025-11-30 23:04:44 +00:00
auth_scope_test.go test: Add edge case for RequireScope empty scope 2025-12-01 23:33:11 +00:00
bootstrap_token.go
bootstrap_token_test.go test: Add edge case for initializeBootstrapToken error path 2025-12-02 00:51:44 +00:00
config_handlers.go refactor: Remove dead HandleTestExistingNode function 2025-12-01 10:21:50 +00:00
config_handlers_auto_reg_test.go test: Add edge cases for markAutoRegistered empty inputs 2025-12-01 23:50:10 +00:00
config_handlers_auto_register_test.go
config_handlers_cluster_test.go test: Improve coverage for cluster config handler functions 2025-12-01 14:46:00 +00:00
config_handlers_host_test.go test: Add edge case for normalizeNodeHost URL parse error 2025-12-01 23:28:32 +00:00
config_handlers_pve_user_test.go test: Add tests for instance lookup and setup token validation 2025-12-01 22:19:30 +00:00
config_handlers_sanitize_test.go test: Add tests for config handler utility functions 2025-12-01 14:09:35 +00:00
config_handlers_setup_script_test.go test: Add edge case tests for HandleSetupScript 2025-12-02 01:11:57 +00:00
config_handlers_temperature_test.go
config_handlers_transport_guard_test.go
csrf_store.go
csrf_store_test.go test: Add filesystem error tests for CSRFTokenStore 2025-12-02 01:38:49 +00:00
demo_middleware.go
demo_middleware_test.go test: Add edge case for DemoModeMiddleware WebSocket POST upgrade 2025-12-01 23:24:06 +00:00
diagnostics.go
diagnostics_test.go test: Add tests for config handler utility functions 2025-12-01 14:09:35 +00:00
DO_NOT_EDIT_FRONTEND_HERE.md
docker_agents.go
docker_agents_test.go
docker_metadata.go
frontend_embed.go
guest_metadata.go
host_agents.go
host_agents_test.go test: Add edge cases for HandleLookup error paths 2025-12-02 00:49:16 +00:00
http_metrics.go
http_metrics_test.go
middleware.go
middleware_test.go test: Add edge case for writeErrorResponse encode failure 2025-12-01 23:52:21 +00:00
notification_queue.go
notifications.go
notifications_test.go
oidc_handlers.go
oidc_handlers_test.go test: Add edge case test for addQueryParam URL parse error 2025-12-01 23:08:36 +00:00
oidc_service.go
oidc_service_test.go test: Add invalid PEM data test for newOIDCHTTPClient 2025-12-02 01:00:06 +00:00
rate_limit_config.go
rate_limit_config_test.go test: Add edge cases for UniversalRateLimitMiddleware 2025-12-02 00:54:37 +00:00
ratelimit.go
ratelimit_test.go
README.md
recovery_tokens.go
recovery_tokens_test.go test: Add filesystem error tests for RecoveryTokenStore.saveUnsafe 2025-12-02 01:36:21 +00:00
router.go
router_arch_test.go test: Add tests for API helper functions 2025-12-01 21:33:45 +00:00
router_download_test.go
router_integration_test.go test: Add edge case for handleServerInfo method not allowed 2025-12-02 00:01:17 +00:00
router_test.go test: Add tests for hostAgentSearchCandidates parameter variants 2025-12-02 00:03:19 +00:00
security.go
security_oidc.go
security_setup_fix.go
security_setup_fix_test.go test: Add edge case for ensureSettingsWriteScope valid scope 2025-12-02 00:13:32 +00:00
security_test.go test: Add adminBypassEnabled tests 2025-12-02 01:53:55 +00:00
security_tokens.go
security_tokens_test.go test: Add edge cases for normalizeRequestedScopes 2025-12-02 00:19:20 +00:00
session_store.go
session_store_test.go test: Add filesystem error tests for SessionStore 2025-12-02 01:40:54 +00:00
system_settings.go
system_settings_temperature_test.go
system_settings_utils_test.go Add unit tests for system_settings.go map utility functions 2025-12-01 01:05:07 +00:00
system_settings_validate_test.go
temperature_proxy.go Fix cluster proxy token collision - store per-node control tokens 2025-11-30 20:37:58 +00:00
temperature_proxy_command_test.go
temperature_proxy_test.go Add unit tests for temperature proxy utility functions (api) 2025-11-30 14:07:04 +00:00
types.go
unified_agent.go
unified_agent_test.go Add unit tests for normalizeUnifiedAgentArch and getClientIP (api) 2025-11-30 15:05:37 +00:00
updates.go
updates_test.go Add unit tests for normalizeUnifiedAgentArch and getClientIP (api) 2025-11-30 15:05:37 +00:00

Internal API Package

This directory contains the API server implementation for Pulse.

Important Note About frontend-modern/

The frontend-modern/ subdirectory that appears here is:

  • AUTO-GENERATED during builds
  • NOT the source code - just a build artifact
  • IN .gitignore - never committed
  • REQUIRED BY GO - The embed directive needs it here

Frontend Development Location

👉 Edit frontend files at: /opt/pulse/frontend-modern/src/

Why This Structure?

Go's //go:embed directive has limitations:

  1. Cannot use ../ paths to access parent directories
  2. Cannot follow symbolic links
  3. Must embed files within the Go module

This is a known Go limitation and our structure works around it.