Skip to content

Move connector privilege keys to their packages via a runtime registry#508

Merged
lahirujayathilake merged 3 commits into
masterfrom
privilege-model
Jul 1, 2026
Merged

Move connector privilege keys to their packages via a runtime registry#508
lahirujayathilake merged 3 commits into
masterfrom
privilege-model

Conversation

@lahirujayathilake

@lahirujayathilake lahirujayathilake commented Jun 25, 2026

Copy link
Copy Markdown
Member

Privilege keys now live where they belong. core declares its own, connectors declare theirs. A small runtime registry in pkg/models lets each package register its keys at startup, so core stays unaware of connector-specific privileges.
AMIE specific privileges have been moved to its package.

Updated the privilege names to align with :: format

Main changes

  • pkg/models/privilege.go - the runtime registry: Register, IsKnownPrivilege, KnownPrivileges, core's init() self-register
  • connectors/ACCESS/AMIE-Processor/server/privileges.go - first connector to declare + register its keys from its own package

Other - privilege renaming, tests updates

  • Constant renames - internal/server/, internal/store/, pkg/service/
  • AMIE handler wiring - connectors/ACCESS/AMIE-Processor/server/handlers.go + handlers_test.go
  • Regenerated OpenAPI - api/core.openapi.yaml
  • Wire format updates - dev-ops/compose/seeds/dev_users_and_roles.sql, connectors/ACCESS/AMIE-Processor/testdata/scenarios/baseline.yaml

@yasithdev yasithdev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This simplifies things a lot. LGTM! 👍🏽

@yasithdev

Copy link
Copy Markdown

@lahirujayathilake we should probably show the list of groups and the permissions they map to.

@lahirujayathilake

lahirujayathilake commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

@lahirujayathilake we should probably show the list of groups and the permissions they map to.

Thanks for pointing that out @yasithdev, that's really a good to have list. I'll work on that and update this PR.

@lahirujayathilake

Copy link
Copy Markdown
Member Author

@yasithdev, included the privilege reference document

@lahirujayathilake lahirujayathilake merged commit 59149f9 into master Jul 1, 2026
1 check passed
@lahirujayathilake lahirujayathilake deleted the privilege-model branch July 2, 2026 19:57
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.

2 participants