Files
worker/internal/webapp/constants.go
Gleb Tv e987f24903
Все проверки выполнены успешно
CI / test (push) Successful in 2m32s
Docker / Build and publish worker image (push) Successful in 18m17s
fix(worker): harden control-plane lifecycle
- reconnect safely after token rotation and retry leased results
- reject malformed tasks and remove production cluster debug mutation
- validate environment files and require immutable container images

BREAKING CHANGE: Docker install, deploy, and Compose now require an
immutable repository@sha256 image reference.
2026-07-19 23:11:43 +03:00

47 строки
1.5 KiB
Go

package webapp
// Audit constants used across the webapp audit-log writes. They
// live in their own file so goconst sees them as named values
// rather than scattered string literals.
const (
auditActorLocal = "operator"
auditRoleAdmin = "admin"
auditAuthModeLocal = "local"
auditAuthModeBasic = "basic_auth"
auditTargetSelf = "self"
auditActionLogin = "login"
auditActionLoginFail = "login_failed"
auditActionLogout = "logout"
auditActionPassChange = "password_change"
)
// Inventory source labels. Phase 1 only emits "process"; Phase 3
// adds "compose" and "docker".
const (
inventorySourceProcess = "process"
)
// Environment variable names referenced by ConfigFromEnv. Lifted out
// so the validator and the cmd binary share the same constants.
const (
envWorkerHost = "WORKER_HOST"
envWorkerPort = "WORKER_PORT"
envWorkerURL = "WORKER_URL"
envWorkerLogin = "WORKER_LOGIN"
envWorkerPassword = "WORKER_PASSWORD"
envClusterEnabled = "WORKER_CLUSTER_ENABLED"
envReleaseURL = "WORKER_RELEASE_URL"
)
// Route paths used as redirect targets. Lifted out so goconst stops
// flagging the duplicates across handlers.
const (
pathOverview = "/overview"
pathChangePassword = "/web/change-password"
pathLogin = "/web/login"
)
// basicAuthRealm is the value returned in the WWW-Authenticate
// header. Fixed string so scripted callers can match on it.
const basicAuthRealm = `Basic realm="rsmon-worker"`