Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gavel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pre:
- run: make build
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,11 @@ specs/
**/*.pem
**/*.key
auth/oidc/static/tailwind.min.js
**/*.pem
**/*.key
report/*.png
report/*.pdf
*.pdf
*.png
.playwright-mcp/
out.*
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ test:
--succinct --label-filter='!ignore_local'

.PHONY: ci-test
ci-test:
ginkgo -r -p --skip-package=tests/e2e --keep-going --junit-report junit-report.xml --github-output --output-dir test-reports --succinct
ci-test: $(TAILWIND_JS) $(LOCALBIN)
go build -o ./.bin/$(NAME) main.go
ginkgo -r --skip-package=tests/e2e --keep-going --junit-report junit-report.xml --github-output --output-dir test-reports --succinct

.PHONY: e2e
e2e: $(TAILWIND_JS)
Expand Down Expand Up @@ -149,7 +150,7 @@ build: static
go build -o ./.bin/$(NAME) -ldflags "-X \"main.version=$(VERSION_TAG) built at $(DATE)\"" main.go

.PHONY: dev
dev:
dev: static
# Disabling CGO because of slow build times in apple silicon (just experimenting)
CGO_ENABLED=0 go build -v -o ./.bin/$(NAME) -gcflags="all=-N -l" main.go

Expand Down Expand Up @@ -188,22 +189,25 @@ ginkgo:

.PHONY: controller-gen
controller-gen: install-deps $(LOCALBIN)
$(LOCALBIN)/deps install controller-gen@$(CONTROLLER_TOOLS_VERSION) --bin-dir $(LOCALBIN)
deps install controller-gen@$(CONTROLLER_TOOLS_VERSION) --bin-dir $(LOCALBIN)

.PHONY: golangci-lint
golangci-lint: install-deps $(LOCALBIN)
$(LOCALBIN)/deps install golangci/golangci-lint@v$(GOLANGCI_LINT_VERSION) --bin-dir $(LOCALBIN)
deps install golangci/golangci-lint@v$(GOLANGCI_LINT_VERSION) --bin-dir $(LOCALBIN)

.PHONY: kustomize
kustomize: install-deps $(LOCALBIN)
$(LOCALBIN)/deps install kubernetes-sigs/kustomize@$(KUSTOMIZE_VERSION) --bin-dir $(LOCALBIN)
deps install kubernetes-sigs/kustomize@$(KUSTOMIZE_VERSION) --bin-dir $(LOCALBIN)

.PHONY: docs\:mcp
docs\:mcp: ## Generate MCP tools reference documentation
@mkdir -p docs
go run ./hack/gen-mcp-docs > docs/mcp-tools.md
@echo "Generated docs/mcp-tools.md"

report/kitchen-sink.json: report/build-kitchen-sink.ts report/testdata/kitchen-sink.yaml
cd report && ./node_modules/.bin/tsx build-kitchen-sink.ts

.PHONY: lint
lint: golangci-lint
$(GOLANGCI_LINT) run ./...
50 changes: 40 additions & 10 deletions api/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@ import (
)

const (
SectionTypeView = "view"
SectionTypeChanges = "changes"
SectionTypeConfigs = "configs"
SectionTypeView = "view"
SectionTypeChanges = "changes"
SectionTypeConfigs = "configs"
SectionTypeAccess = "access"
SectionTypeAccessLogs = "accessLogs"
)

// ApplicationSection is a typed section in an application response.
// The Type field is one of "view", "changes", or "configs".
// Only the field matching the type is populated.
type ApplicationSection struct {
Type string `json:"type"`
Title string `json:"title"`
Icon string `json:"icon,omitempty"`
View *ApplicationViewData `json:"view,omitempty"`
Changes []ApplicationChange `json:"changes,omitempty"`
Configs []ApplicationConfigItem `json:"configs,omitempty"`
Type string `json:"type"`
Title string `json:"title"`
Icon string `json:"icon,omitempty"`
View *ApplicationViewData `json:"view,omitempty"`
Changes []ApplicationChange `json:"changes,omitempty"`
Configs []ApplicationConfigItem `json:"configs,omitempty"`
Access []AccessItem `json:"access,omitempty"`
AccessLogs []AccessLogItem `json:"accessLogs,omitempty"`
}

// ApplicationViewData holds the data-only fields from a resolved ViewRef section.
Expand All @@ -47,6 +50,33 @@ type ApplicationConfigItem struct {
Labels map[string]string `json:"labels,omitempty"`
}

type AccessItem struct {
ConfigID string `json:"configId"`
ConfigName string `json:"configName"`
ConfigType string `json:"configType"`
UserID string `json:"userId"`
UserName string `json:"userName"`
Email string `json:"email"`
Role string `json:"role"`
UserType string `json:"userType"`
CreatedAt time.Time `json:"createdAt"`
LastSignedInAt *time.Time `json:"lastSignedInAt,omitempty"`
LastReviewedAt *time.Time `json:"lastReviewedAt,omitempty"`
IsStale bool `json:"isStale"`
}

type AccessLogItem struct {
ConfigID string `json:"configId"`
ConfigName string `json:"configName"`
ConfigType string `json:"configType"`
UserID string `json:"userId"`
UserName string `json:"userName"`
CreatedAt time.Time `json:"createdAt"`
MFA bool `json:"mfa"`
Count int `json:"count"`
Properties map[string]string `json:"properties,omitempty"`
}

// Application is the schema that UI uses.
type Application struct {
ApplicationDetail `json:",inline"`
Expand Down
Loading
Loading