From e6150888ab9e3dc851bd4a0763e69123929d181b Mon Sep 17 00:00:00 2001 From: Ali Oezyetimoglu Date: Mon, 28 Aug 2023 08:58:42 +0200 Subject: [PATCH] TAAS-88: added descriptions to fields and classes; added README --- README.md | 21 +++++++++++++++++++ .../api/external/GeneralSettingsResource.java | 1 - .../model/CreateUserRequest.java | 3 ++- .../model/DeploymentKeyResponse.java | 3 +++ .../model/GeneralConfigurationModel.java | 5 +++++ .../model/ResetPasswordRequest.java | 4 ++++ .../model/SMTPConfiguration.java | 15 +++++++++++++ .../model/SimpleTenantResponse.java | 5 +++++ .../model/TenantRequest.java | 10 +++++++++ .../model/TenantUser.java | 8 +++++++ .../model/UpdateMyProfileRequest.java | 1 + .../model/UpdateProfileRequest.java | 3 ++- .../tenantusermanagement/model/User.java | 9 ++++++++ 13 files changed, 85 insertions(+), 3 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..57c4860 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Tenant User Management Micro-Service: tenant-user-management + +## Introduction +The tenant-user-management micro-service profiles with storing and providing everything about the tenant environment. It makes use of tools like Spring Boot 3, Keycloak, Microsoft Azure and AWS S3 to keep your data consistent and secure according to the latest standards. + +### Key features in the Tenant User Management Service + +* **Tenant Management:** +This service gives you the option to do CRUD operations to manage your tenants. +You can also select between different storage platforms to store your tenants. +Some general configurations complements the settings options. + + +* **User Administration:** +Another feature is the handling of your users. You can manage the profiles, activate/deactivate them and give roles as you require. +If you wish you can administrate the users for each tenant separately. +Or just give a user the needed preferences. + + +* **SMTP configuration:** +Further you can adjust your SMTP settings and set properties as you aimed best for your company. \ No newline at end of file diff --git a/src/main/java/com/knecon/fforesight/tenantusermanagement/api/external/GeneralSettingsResource.java b/src/main/java/com/knecon/fforesight/tenantusermanagement/api/external/GeneralSettingsResource.java index a970183..e6f29a2 100644 --- a/src/main/java/com/knecon/fforesight/tenantusermanagement/api/external/GeneralSettingsResource.java +++ b/src/main/java/com/knecon/fforesight/tenantusermanagement/api/external/GeneralSettingsResource.java @@ -5,7 +5,6 @@ import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/CreateUserRequest.java b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/CreateUserRequest.java index b891d8c..3640c71 100644 --- a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/CreateUserRequest.java +++ b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/CreateUserRequest.java @@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data +@Schema(description = "Object containing the request to create a profile.") public class CreateUserRequest { @Schema(description = "Email of user.") @@ -21,7 +22,7 @@ public class CreateUserRequest { @Schema(description = "Last name of user.") private String lastName; - @Schema(description = "The list of RED_* roles.") + @Schema(description = "Roles to assign to user.") private Set roles = new HashSet<>(); } diff --git a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/DeploymentKeyResponse.java b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/DeploymentKeyResponse.java index 64f1c26..8cb2162 100644 --- a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/DeploymentKeyResponse.java +++ b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/DeploymentKeyResponse.java @@ -1,5 +1,6 @@ package com.knecon.fforesight.tenantusermanagement.model; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -7,8 +8,10 @@ import lombok.NoArgsConstructor; @Data @NoArgsConstructor @AllArgsConstructor +@Schema(description = "Object containing data about the deployment key.") public class DeploymentKeyResponse { + @Schema(description = "Parameter containing the deployment key.") private String value; } diff --git a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/GeneralConfigurationModel.java b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/GeneralConfigurationModel.java index 2ebb91f..9dd759d 100644 --- a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/GeneralConfigurationModel.java +++ b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/GeneralConfigurationModel.java @@ -1,5 +1,6 @@ package com.knecon.fforesight.tenantusermanagement.model; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -11,10 +12,14 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @Builder @EqualsAndHashCode +@Schema(description = "Object containing data about general configurations.") public class GeneralConfigurationModel { + @Schema(description = "Parameter indicating if the function 'ForgotPassword' is enabled.") private boolean forgotPasswordFunctionEnabled; + @Schema(description = "Parameter containing the auxiliary name.") private String auxiliaryName; + @Schema(description = "Parameter containing the display name of the application.") private String displayName; } diff --git a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/ResetPasswordRequest.java b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/ResetPasswordRequest.java index d869d62..31dcd31 100644 --- a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/ResetPasswordRequest.java +++ b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/ResetPasswordRequest.java @@ -1,11 +1,15 @@ package com.knecon.fforesight.tenantusermanagement.model; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data +@Schema(description = "Object containing the request to reset a password.") public class ResetPasswordRequest { + @Schema(description = "Parameter containing the new password.") private String password; + @Schema(description = "Parameter indicating if the password id temporary.") private boolean temporary; } diff --git a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/SMTPConfiguration.java b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/SMTPConfiguration.java index 61e3652..1d29896 100644 --- a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/SMTPConfiguration.java +++ b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/SMTPConfiguration.java @@ -1,5 +1,6 @@ package com.knecon.fforesight.tenantusermanagement.model; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -9,20 +10,34 @@ import lombok.NoArgsConstructor; @Builder @AllArgsConstructor @NoArgsConstructor +@Schema(description = "Object containing the SMTP configuration.") public class SMTPConfiguration { + @Schema(description = "Parameter containing the ID of the SMTP configuration.") private String id; + @Schema(description = "Parameter containing the email of the sender.") private String from; + @Schema(description = "Parameter containing the display name of the sender.") private String fromDisplayName; + @Schema(description = "Parameter containing the email of the sender on the envelope.") private String envelopeFrom; + @Schema(description = "Parameter containing the host.") private String host; + @Schema(description = "Parameter containing the port.") private Integer port; + @Schema(description = "Parameter containing the email to reply.") private String replyTo; + @Schema(description = "Parameter containing the display name of the email to reply.") private String replyToDisplayName; + @Schema(description = "Parameter indicating the usage of the SSL protocol.") private boolean ssl; + @Schema(description = "Parameter indicating the usage of the STARTTLS protocol.") private boolean starttls; + @Schema(description = "Parameter indicating the authentication of the client.") private boolean auth; + @Schema(description = "Parameter containing the user.") private String user; + @Schema(description = "Parameter containing the password.") private String password; } diff --git a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/SimpleTenantResponse.java b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/SimpleTenantResponse.java index 85fee79..aec15a3 100644 --- a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/SimpleTenantResponse.java +++ b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/SimpleTenantResponse.java @@ -1,5 +1,6 @@ package com.knecon.fforesight.tenantusermanagement.model; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -9,10 +10,14 @@ import lombok.NoArgsConstructor; @Builder @AllArgsConstructor @NoArgsConstructor +@Schema(description = "Object containing a simplified version of the tenant data.") public class SimpleTenantResponse { + @Schema(description = "Parameter containing the ID of the tenant.") private String tenantId; + @Schema(description = "Parameter containing the display name of the tenant.") private String displayName; + @Schema(description = "Parameter containing the global unique ID of the tenant.") private String guid; } diff --git a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/TenantRequest.java b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/TenantRequest.java index 5f26a04..dd5ced6 100644 --- a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/TenantRequest.java +++ b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/TenantRequest.java @@ -8,6 +8,7 @@ import com.knecon.fforesight.tenantcommons.model.DatabaseConnection; import com.knecon.fforesight.tenantcommons.model.S3StorageConnection; import com.knecon.fforesight.tenantcommons.model.SearchConnection; +import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.Pattern; @@ -20,21 +21,30 @@ import lombok.NoArgsConstructor; @Builder @AllArgsConstructor @NoArgsConstructor +@Schema(description = "Object containing the request to create or update a tenant.") public class TenantRequest { @NotBlank @Pattern(regexp = "[A-Za-z0-9_-]*", message = "Tenant Id must match [A-Za-z0-9_-]") + @Schema(description = "Parameter containing the ID of the tenant.") private String tenantId; @NotBlank + @Schema(description = "Parameter containing the display name of the tenant.") private String displayName; + @Schema(description = "Parameter containing the global unique ID of the tenant.") private String guid; + @Schema(description = "Parameter containing data of the database connection.") private DatabaseConnection databaseConnection; + @Schema(description = "Parameter containing data of the search connection.") private SearchConnection searchConnection; + @Schema(description = "Parameter containing data of the Azure storage connection.") private AzureStorageConnection azureStorageConnection; + @Schema(description = "Parameter containing data of the S3 storage connection.") private S3StorageConnection s3StorageConnection; @Builder.Default + @Schema(description = "Parameter containing a list of users of the tenant.") private List defaultUsers = new ArrayList<>(); } diff --git a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/TenantUser.java b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/TenantUser.java index 33b1e1e..4bfda6a 100644 --- a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/TenantUser.java +++ b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/TenantUser.java @@ -3,6 +3,7 @@ package com.knecon.fforesight.tenantusermanagement.model; import java.util.HashSet; import java.util.Set; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,15 +13,22 @@ import lombok.NoArgsConstructor; @Builder @NoArgsConstructor @AllArgsConstructor +@Schema(description = "Object containing the data about a tenant user.") public class TenantUser { + @Schema(description = "Parameter containing the username of the tenant user.") private String username; + @Schema(description = "Parameter containing the password of the tenant user.") private String password; + @Schema(description = "Parameter containing the email of the tenant user.") private String email; + @Schema(description = "Parameter containing the first name of the tenant user.") private String firstName; + @Schema(description = "Parameter containing the last name of the tenant user.") private String lastName; @Builder.Default + @Schema(description = "Parameter containing the roles assigned to the tenant user.") private Set roles = new HashSet<>(); } diff --git a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/UpdateMyProfileRequest.java b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/UpdateMyProfileRequest.java index f059874..db89478 100644 --- a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/UpdateMyProfileRequest.java +++ b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/UpdateMyProfileRequest.java @@ -12,6 +12,7 @@ import lombok.NoArgsConstructor; @Builder @NoArgsConstructor @AllArgsConstructor +@Schema(description = "Object containing the request to update a profile.") public class UpdateMyProfileRequest { @Schema(description = "Email of user.") diff --git a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/UpdateProfileRequest.java b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/UpdateProfileRequest.java index da80652..745bca7 100644 --- a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/UpdateProfileRequest.java +++ b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/UpdateProfileRequest.java @@ -13,6 +13,7 @@ import lombok.NoArgsConstructor; @NoArgsConstructor @AllArgsConstructor @Builder +@Schema(description = "Object containing the request to update a profile.") public class UpdateProfileRequest { @Schema(description = "Email of user.") @@ -25,7 +26,7 @@ public class UpdateProfileRequest { private String lastName; @Builder.Default - @Schema(description = "Roles.") + @Schema(description = "Roles to assign to the user.") private Set roles = new HashSet<>(); } diff --git a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/User.java b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/User.java index 1d68f29..8f40012 100644 --- a/src/main/java/com/knecon/fforesight/tenantusermanagement/model/User.java +++ b/src/main/java/com/knecon/fforesight/tenantusermanagement/model/User.java @@ -4,6 +4,7 @@ import java.io.Serializable; import java.util.Set; import java.util.TreeSet; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -15,21 +16,29 @@ import lombok.NoArgsConstructor; @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(of = "userId") +@Schema(description = "Object containing the user data.") public class User implements Serializable { + @Schema(description = "Parameter containing the ID of the user.") private String userId; + @Schema(description = "Parameter containing the username of the user.") private String username; + @Schema(description = "Parameter containing the email of the user.") private String email; + @Schema(description = "Parameter containing the first name of the user.") private String firstName; + @Schema(description = "Parameter containing the last name of the user.") private String lastName; + @Schema(description = "Parameter indicating if the user is activated.") private boolean isActive; @Builder.Default + @Schema(description = "Parameter containing the roles of the user.") private Set roles = new TreeSet<>(); }