[ISSUE-114] Add comprehensive JavaDoc and documentation to CFTunnels #115
@ -1,4 +1,5 @@
|
|||||||
package com.hithomelabs.CFTunnels.Entity;
|
package com.hithomelabs.CFTunnels.Entity;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@ -8,6 +9,26 @@ import lombok.Setter;
|
|||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JPA Entity representing a user in the system.
|
||||||
|
*
|
||||||
|
* <p>This entity stores user information synced from the OIDC provider
|
||||||
|
* during authentication. Users are assigned roles that determine their
|
||||||
|
* access levels to the API endpoints.</p>
|
||||||
|
*
|
||||||
|
* <p><b>Database Table:</b> {@code users}</p>
|
||||||
|
*
|
||||||
|
* <p><b>Roles:</b></p>
|
||||||
|
* <ul>
|
||||||
|
* <li>USER - Basic access to view tunnels</li>
|
||||||
|
* <li>DEVELOPER - Can create/modify mappings</li>
|
||||||
|
* <li>APPROVER - Can approve/reject requests</li>
|
||||||
|
* <li>ADMIN - Full access including tunnel configuration</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @see Request
|
||||||
|
* @see Mapping
|
||||||
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@ -15,16 +36,33 @@ import java.util.UUID;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Table(name = "users")
|
@Table(name = "users")
|
||||||
public class User {
|
public class User {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unique identifier for the user (UUID).
|
||||||
|
*
|
||||||
|
* <p>This corresponds to the user's ID in the OIDC provider.</p>
|
||||||
|
*/
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@Column(columnDefinition = "uuid", insertable = false, updatable = false, nullable = false)
|
@Column(columnDefinition = "uuid", insertable = false, updatable = false, nullable = false)
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User's display name.
|
||||||
|
*
|
||||||
|
* <p>This is typically the full name from the OIDC provider.</p>
|
||||||
|
*/
|
||||||
@Column(length = 50, nullable = false)
|
@Column(length = 50, nullable = false)
|
||||||
@Size(max = 50)
|
@Size(max = 50)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User's email address.
|
||||||
|
*
|
||||||
|
* <p>Used as the unique identifier for authentication
|
||||||
|
* and for associating users with their roles.</p>
|
||||||
|
*/
|
||||||
@Column(length = 50, nullable = false)
|
@Column(length = 50, nullable = false)
|
||||||
@Size(max = 50)
|
@Size(max = 50)
|
||||||
private String email;
|
private String email;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user