TAAS-88: added descriptions to fields and classes; added README

This commit is contained in:
Ali Oezyetimoglu 2023-08-28 08:58:42 +02:00
parent fefcca2ddf
commit e6150888ab
13 changed files with 85 additions and 3 deletions

21
README.md Normal file
View File

@ -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.

View File

@ -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;

View File

@ -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<String> roles = new HashSet<>();
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<TenantUser> defaultUsers = new ArrayList<>();
}

View File

@ -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<String> roles = new HashSet<>();
}

View File

@ -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.")

View File

@ -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<String> roles = new HashSet<>();
}

View File

@ -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<String> roles = new TreeSet<>();
}