-
Notifications
You must be signed in to change notification settings - Fork 36
Add confidentiality agreement configuration to admin-api, expose with api/v1/frontend/configuration #1146
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 confidentiality agreement configuration to admin-api, expose with api/v1/frontend/configuration #1146
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,11 @@ | ||||||
type: object | ||||||
description: A list of resources to render | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
properties: | ||||||
enabled: | ||||||
type: boolean | ||||||
description: Whether the CA should be shown prior to login | ||||||
content: | ||||||
type: string | ||||||
description: The text of the CA | ||||||
required: | ||||||
- enabled |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.hivemq.api.model.components; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. Positive FeedbackNegative Feedback |
||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import static java.util.Objects.requireNonNullElse; | ||
|
||
public class ConfidentialityAgreement { | ||
|
||
@JsonProperty("enabled") | ||
@Schema(description = "Whether the confidentiality agreement should be shown prior to login in") | ||
private final @NotNull Boolean enabled; | ||
|
||
@JsonProperty("content") | ||
@Schema(description = "The confidentiality agreement") | ||
private final @Nullable String content; | ||
|
||
public ConfidentialityAgreement() { | ||
this(false, null); | ||
} | ||
|
||
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES) | ||
public ConfidentialityAgreement(final @Nullable Boolean enabled, final @Nullable String content) { | ||
this.enabled = requireNonNullElse(enabled, false); | ||
if (this.enabled && (content == null || content.isEmpty())) { | ||
throw new IllegalArgumentException("Content cannot be null or empty when enabled"); | ||
} | ||
this.content = content; | ||
} | ||
|
||
public boolean getEnabled() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isEnabled()? |
||
return enabled; | ||
} | ||
|
||
public @Nullable String getContent() { | ||
return content; | ||
} | ||
} |
There was a problem hiding this comment.
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.
Copilot uses AI. Check for mistakes.