Skip to content

Conversation

marregui
Copy link
Contributor

card: https://hivemq.kanbanize.com/ctrl_board/57/cards/35773/details/

with

curl -H 'Accept: application/json' -H 'Content-Type: application/json' http://localhost:8080/api/v1/frontend/configuration

the result is:

 "extensions" : {
    "items" : [ {
      "id" : "hivemq-allow-all-extension",
      "version" : "1.0.0",
      "name" : "Allow All Extension",
      "author" : "HiveMQ",
      "priority" : 0,
      "installed" : true
    } ]
  },
  "hivemqId" : "wwtNa",
  "trackingAllowed" : true,
  "confidentialityAgreement" : {
    "enabled" : true,
    "content" : "You are cool"
  }

with config:

  <admin-api>
        <enabled>true</enabled>
        <listeners>
            <http-listener>
                <port>API_PORT</port>
                <bind-address>127.0.0.1</bind-address>
            </http-listener>
        </listeners>
        <users>
            <user>
                <username>admin</username>
                <password>hivemq</password>
                <roles><role>admin</role></roles>
            </user>
        </users>
        <confidentiality-agreement>
            <enabled>true</enabled>
            <content>You are cool</content>
        </confidentiality-agreement>
    </admin-api>

@cla-bot cla-bot bot added the cla-signed label Sep 11, 2025
@marregui marregui self-assigned this Sep 11, 2025
@codepitbull codepitbull requested a review from Copilot September 11, 2025 12:49
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds confidentiality agreement configuration support to the admin-api, allowing users to configure and display a confidentiality agreement in the frontend. The implementation includes XML schema updates, entity classes, configuration service integration, and API endpoint exposure.

Key changes:

  • Added confidentiality agreement XML schema and entity classes for configuration
  • Extended API configuration service to handle confidentiality agreement settings
  • Exposed confidentiality agreement configuration through the frontend API endpoint

Reviewed Changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
config.xsd Added confidentiality-agreement XML schema definition
CAEntity.java New entity class for confidentiality agreement configuration
ApiConfigurationService.java Extended service interface to include confidentiality agreement methods
ApiConfigurationServiceImpl.java Added implementation for confidentiality agreement handling
ApiConfigurator.java Updated to configure confidentiality agreement from XML entity
ConfidentialityAgreement.java New API model class for confidentiality agreement
GatewayConfiguration.java Added confidentiality agreement field to gateway configuration
FrontendResourceImpl.java Updated to include confidentiality agreement in API response
AdminApiEntity.java Added confidentiality agreement field to admin API entity
test-config.xml Added test configuration for confidentiality agreement
Various test files Updated method calls to match refactored API
OpenAPI schema files Added confidentiality agreement schema definitions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -0,0 +1,41 @@
package com.hivemq.api.model.components;
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

Missing file header comment with copyright notice. All other files in the project include the Apache 2.0 license header.

Copilot uses AI. Check for mistakes.

@@ -0,0 +1,11 @@
type: object
description: A list of resources to render
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

The description 'A list of resources to render' is incorrect for a confidentiality agreement. This should describe what a confidentiality agreement is, not reference resources.

Suggested change
description: A list of resources to render
description: A confidentiality agreement is a legal document or statement that restricts the sharing of certain information.

Copilot uses AI. Check for mistakes.

- items
ConfidentialityAgreement:
type: object
description: A list of resources to render
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

The description 'A list of resources to render' is incorrect for a confidentiality agreement. This should describe what a confidentiality agreement is, not reference resources.

Suggested change
description: A list of resources to render
description: Represents a confidentiality agreement, including its text and whether it should be shown to users prior to login.

Copilot uses AI. Check for mistakes.

Copy link
Member

@caoccao caoccao left a comment

Choose a reason for hiding this comment

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

I left some comments. Overall, it looks good to me.

this.content = content;
}

public boolean getEnabled() {
Copy link
Member

Choose a reason for hiding this comment

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

isEnabled()?

@XmlElementWrapper(name = "users")
@XmlElementRef(required = false)
private @NotNull ApiJwsEntity jws = new ApiJwsEntity();
private @NotNull List<UserEntity> users;
Copy link
Member

Choose a reason for hiding this comment

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

Can be final?

@XmlElementRef(required = false, type = HttpListenerEntity.class),
@XmlElementRef(required = false, type = HttpsListenerEntity.class)})
private @NotNull List<ApiListenerEntity> listeners = new ArrayList<>();
private @NotNull List<ApiListenerEntity> listeners;
Copy link
Member

Choose a reason for hiding this comment

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

Can be final?

private @JsonProperty("cloudLink") final @NotNull Link cloudLink;
private @JsonProperty("gitHubLink") final @NotNull Link gitHubLink;
private @JsonProperty("documentationLink") final @NotNull Link documentationLink;
private @JsonProperty("ctas")
Copy link
Member

Choose a reason for hiding this comment

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

All private can be after @JsonProperty.

@marregui
Copy link
Contributor Author

replaced by #1148

@marregui marregui closed this Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants