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

Add json example for nested object in the doc #1070

Closed
zodd3131 opened this issue Dec 13, 2024 · 3 comments
Closed

Add json example for nested object in the doc #1070

zodd3131 opened this issue Dec 13, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@zodd3131
Copy link

Describe the feature
A new feature has been added that provides the ability to pass broker.properties through a json secret.
ActiveMQArtemisSecurity is now a deprecated resource and it's now recommanded to provide configuration with spec.brokerProperties. I would like to implement what it is described here : providing-additional-brokerproperties-configuration-from-a-secret).
How to write nested object and what to escape as characters?
How to translate the yaml below into a json secret?

securitySettings:
    broker:
      - match: "app.europe.#"
        permissions:
          - operationType: createNonDurableQueue
            roles: ["admin"]
          - operationType: deleteNonDurableQueue
            roles: ["admin"]
          - operationType: createDurableQueue
            roles: ["admin"]
          - operationType: deleteDurableQueue
            roles: ["admin"]
          - operationType: createAddress
            roles: ["admin"]
          - operationType: deleteAddress
            roles: ["admin"]
          - operationType: createAddress
            roles: ["admin"]
          - operationType: consume
            roles: ["admin", "guest"]
          - operationType: send
            roles: ["admin"]

I would like to complete the documentation with more complex examples.

Tip

Vote this issue reacting with 👍 or 👎

@zodd3131 zodd3131 added the enhancement New feature or request label Dec 13, 2024
@brusdev
Copy link
Contributor

brusdev commented Dec 19, 2024

@zodd3131 you can convert security settings of ActiveMQArtemisSecurity CR to broker properties ActiveMQArtemis CR, .i.e.

apiVersion: broker.amq.io/v1beta1
kind: ActiveMQArtemis
metadata:
  name: artemis-broker
spec:
  brokerProperties:
    - 'securityRoles."app.europe.#".admin.createNonDurableQueue=true'
    - 'securityRoles."app.europe.#".admin.deleteNonDurableQueue=true'
    - 'securityRoles."app.europe.#".admin.createDurableQueue=true'
    - 'securityRoles."app.europe.#".admin.deleteDurableQueue=false'
    - 'securityRoles."app.europe.#".admin.createAddress=false'
    - 'securityRoles."app.europe.#".admin.deleteAddress=false'
    - 'securityRoles."app.europe.#".admin.consume=false'
    - 'securityRoles."app.europe.#".admin.send=false'

@zodd3131
Copy link
Author

Thank you for the reply @brusdev

May I ask you where did you find the documentation about securityRoles instead of security-settings. I was looking here

Maybe can I add more explanation in the documentation below ?
https://artemiscloud.io/docs/help/operator/#providing-additional-brokerproperties-configuration-from-a-secret

@brusdev
Copy link
Contributor

brusdev commented Dec 20, 2024

@zodd3131 in the Apache ActiveMQ Artemis project there is a doc section and a test class for broker properties:
https://activemq.apache.org/components/artemis/documentation/latest/configuration-index.html#broker-properties

The configuration properties are low level, lower level than xml, however it is very powerful; any accessible attribute of the internal org.apache.activemq.artemis.core.config.impl.ConfigurationImpl objects can be modified.

https://github.com/apache/activemq-artemis/blob/main/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java#L1688

Maybe can I add more explanation in the documentation below ?

Any contributes is always welcome but I think that should be a contribute for the Apache ActiveMQ Artemis project doc.

@brusdev brusdev closed this as completed Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants