Skip to content

metadata: reject AddKey when no delegated role is configured - #788

Open
Rohilalala wants to merge 1 commit into
theupdateframework:masterfrom
Rohilalala:fix/addkey-missing-delegated-role
Open

Rohilalala wants to merge 1 commit into
theupdateframework:masterfrom
Rohilalala:fix/addkey-missing-delegated-role

Conversation

@Rohilalala

Copy link
Copy Markdown

TargetsType.AddKey accepts a key when Delegations has no configured roles. With an initialized key map it returns success and stores an unused key; with a nil map it panics.

Return the existing missing-role error in both cases, matching the behavior of an empty Roles slice. The regression tests also check that the key map stays unchanged.

Tests: repeated/shuffled race suite, make test, CI coverage command, and golangci-lint v2.13.1.

AI assistance was used for implementation and review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant