Skip to content

Fix #6778: Validate service account permission by resource name - #6822

Open
AllanAlmeida wants to merge 1 commit into
apache:mainfrom
AllanAlmeida:feature/6778-resource-name-permission
Open

AllanAlmeida wants to merge 1 commit into
apache:mainfrom
AllanAlmeida:feature/6778-resource-name-permission

Conversation

@AllanAlmeida

@AllanAlmeida AllanAlmeida commented Sep 17, 2026

Copy link
Copy Markdown

Fixes #6778

Validate cross-namespace service account access against each specific resource name for Pipe references and Kamelets.

Tests:

  • go test ./pkg/util/kubernetes ./pkg/util/bindings ./pkg/trait
  • make fmt
  • make goimport
  • GOTOOLCHAIN=go1.27.1 make lint
  • make test
  • make update-docs

make generate could not complete locally: with Go 1.27.1, code-generator cannot parse the generic method in math/rand/v2; Go 1.26.8 cannot load this module because it requires Go 1.27.1. It produced no retained changes.

AI-generated by Codex on behalf of Allan Almeida.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Unit test coverage report - coverage decreased from 63.9% to 63.8% (-0.1%)

@squakez squakez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a little enhancement to add if possible.

Comment thread pkg/trait/kamelets.go
return nil, err
}
if !ok {
return nil, fmt.Errorf("cross-namespace Integration reference authorization denied for the ServiceAccount %s and resources kamelets",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably also need to include the kamelet name failed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance CheckServiceAccountPermission to validate each resource

2 participants