feat(credentials): link agent roles to credential profiles #352
No reviewers
Labels
No labels
Epic 5
MCP
P1
PR-0
PR-1
api
api-layer
architecture
area:backend
area:frontend
arrow
authentication
backend
bug
chat
client
clipboard
common-module
compose
cross-cutting
cross-cutting-requirement
data-layer
data-models
database
desktop-client
documentation
duplicate
enhancement
epic
epic-1
epic-2
epic-3
epic-4
epic-5
epic-6
epic-7
epic-llm-config
error-handling
feature
frontend
good first issue
help wanted
implementation
infrastructure
installer
invalid
kotlin
ktor
llm
medium-priority
message
multiplatform
needs-review
needs-triage
packaging
performance
phase-1
phase-2
phase-3
phase-4
phase-5
phase3
phase:3
priority: high
question
refactor
refactoring
resource-sharing
security
server
server-module
services
session
session-management
settings
setup
shutdown
state
storage
streaming
sub-issue
tests
tooling
type:task
ui
ui/ux
user-accounts
user-management
ux
viewmodel
websocket
windows
windows-integration
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Torvian.eu/chatbot!352
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/credential-profile-agent-roles"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a per-agent-role authorization dimension to credential profiles on top of the existing per-worker one. A profile's link set is stored in a new join table, travels inside the app-signed profile body, is relayed to the worker, and is enforced when a terminal session attaches the profile, so only a linked role may use it. The app gains a role multi-select in the profile editor and shows each profile's linked roles.
Changes
agentRoleIdsto the credential profile DTO and to both write requests, as part of the signed body.V38migration and the(profile_id, agent_role_id)join table with cascades on both keys, inserting no rows.credential_profilesprompt section to the intersection of worker and role link.attach, refusing a role-less or unlinked caller before any decryption, and filtered the unknown-profile hint accordingly.Implementation notes
nameorname — displayName; profile-card labels keep their— projectsuffix because a card row has no header to carry that context.Deployment
Validation
./gradlew :common:compileKotlinDesktop./gradlew :server:testClassesand./gradlew :server:test— 2433 tests, 1 skipped, 0 failures./gradlew :worker:testClassesand./gradlew :worker:test— 810 tests, 4 skipped, 0 failures./gradlew :app:desktopMainClasses,./gradlew :app:desktopTestClassesand./gradlew :app:desktopTest— 1133 tests across 126 classes, 2 skipped, 0 failuresThe skips are pre-existing and platform-gated, none introduced by this change. The independent code review covered the credential-linking feature; the agent-role picker consistency change was verified by manual testing and did not receive a separate independent review.
Risks and follow-up
Set<Long>where the design document saidList<Long>; and the delete response returns an empty link set without a comment explaining why.