Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user roles have to be unique #208

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

4nt01ne
Copy link

@4nt01ne 4nt01ne commented Jan 10, 2025

We have more than 100 roles and about 60 users.
Same roles are allowed on multiple security-setting match.
If one role is configured more than once in the activemq_roles it is duplicated each time in artemis-roles.properties.

This PR is a suggestion to remove duplicate roles.

FYI: this PR is from my private account behind AWD09. We have migrated to GH Enterprise and I am not allowed to open issues or fork repos on my pro account anymore.
We are using the amq_broker playbook.

STEPS TO REPRODUCE
---

- name: reproduce roles generation
  hosts: localhost
  vars:
    amq_broker_users:
      - user: one
        password: abc
        roles: [ role_a ]
      - user: two
        password: abc
        roles: [ role_a, role_b ]
    amq_broker_roles:
      - match: a.queue.*
        name: role_a
        permissions: [ createAddress, createDurableQueue, createNonDurableQueue, deleteAddress, deleteDurableQueue, deleteNonDurableQueue, manage, send ]
      - match: an.other.queue.*
        name: role_b
        permissions: [ createAddress, createDurableQueue, createNonDurableQueue, deleteAddress, deleteDurableQueue, deleteNonDurableQueue, manage, send ]
      - match: a.last.queue.*
        name: role_a
        permissions: [ manage, send ]
  tasks:
    - name: Configure roles
      ansible.builtin.template:
        src: artemis-roles.properties.j2
        dest: artemis-roles.properties

The content of artemis-roles.properties is

role_a=one,two
role_b=two
role_a=one,two

'role_a' is present 2 times

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.

1 participant