@@ -62,14 +62,12 @@ Below is the first version of the models we will be using internally that allows
6262 * denied. Some catalogs may only accept ALLOW rules and treat all other operations as denied by
6363 * default.
6464 */
65- @Value
66- @Builder
6765public class InternalPrivilege {
6866 /**
6967 * The type of privilege, such as SELECT, CREATE, or MODIFY. Each implementation can define its
7068 * own set of enums.
7169 */
72- String privilegeType;
70+ InternalPrivilegeType privilegeType;
7371
7472 /**
7573 * The decision, typically ALLOW or DENY. Some catalogs may not support DENY explicitly,
@@ -88,14 +86,14 @@ public class InternalPrivilege {
8886 * objects that require fine-grained privilege management. Each securable object can have one or
8987 * more privileges assigned to it.
9088 */
91- @Value
92- @Builder
9389public class InternalSecurableObject {
90+ /** The identifier of the securable object. */
91+ InternalSecurableObjectIdentifier securableObjectIdentifier;
9492 /**
9593 * The type of securable object, such as TABLE, VIEW, FUNCTION, etc. Each implementation can
9694 * define its own set of enums.
9795 */
98- String securableObjectType;
96+ InternalSecurableObjectType securableObjectType;
9997 /** The set of privileges assigned to this object. */
10098 List<InternalPrivilege> privileges;
10199}
@@ -111,8 +109,6 @@ public class InternalSecurableObject {
111109 * necessary. It can be extended to include additional fields such as reasonForChange or
112110 * changeDescription.
113111 */
114- @Value
115- @Builder
116112public class InternalChangeLogInfo {
117113 /** The username or identifier of the entity that created this record. */
118114 String createdBy;
@@ -138,8 +134,6 @@ public class InternalChangeLogInfo {
138134 * privileges. Audit info is stored to track the role's creation and modifications, and a properties
139135 * map can hold additional metadata.
140136 */
141- @Value
142- @Builder
143137public class InternalRole {
144138 /** The unique name or identifier for the role. */
145139 String name;
@@ -156,6 +150,7 @@ public class InternalRole {
156150 */
157151 Map<String, String> properties;
158152}
153+
159154```
160155
161156** InternalUser**
@@ -166,16 +161,14 @@ public class InternalRole {
166161 * <p>A user may be assigned multiple roles, and can also belong to a specific user group. Audit
167162 * information is stored to allow tracking of who created or last modified the user.
168163 */
169- @Value
170- @Builder
171164public class InternalUser {
172165 /** The unique name or identifier for the user. */
173166 String name;
174167
175168 /** The list of roles assigned to this user. */
176169 List<InternalRole> roles;
177-
178- /** Contains information about how and when this user was created and last modified. */
170+
171+ /** Contains information about how and when this user was created and last modified. */
179172 InternalChangeLogInfo changeLogInfo;
180173}
181174```
@@ -188,8 +181,6 @@ public class InternalUser {
188181 * <p>Groups can have multiple roles assigned, and also include audit information to track creation
189182 * and modifications.
190183 */
191- @Value
192- @Builder
193184public class InternalUserGroup {
194185 /** The unique name or identifier for the user group. */
195186 String name;
@@ -205,8 +196,6 @@ public class InternalUserGroup {
205196** InternalAccessControlPolicySnapshot**
206197```
207198/** A snapshot of all access control data at a given point in time. */
208- @Value
209- @Builder
210199public class InternalAccessControlPolicySnapshot {
211200 /**
212201 * A unique identifier representing this snapshot's version.
@@ -227,25 +216,25 @@ public class InternalAccessControlPolicySnapshot {
227216 * A map of user names to {@link InternalUser} objects, capturing individual users' details such
228217 * as assigned roles, auditing metadata, etc.
229218 */
230- Map<String, InternalUser> usersByName;
219+ @Builder.Default Map<String, InternalUser> usersByName = Collections.emptyMap() ;
231220
232221 /**
233222 * A map of group names to {@link InternalUserGroup} objects, representing logical groupings of
234223 * users for easier role management.
235224 */
236- Map<String, InternalUserGroup> groupsByName;
225+ @Builder.Default Map<String, InternalUserGroup> groupsByName = Collections.emptyMap() ;
237226
238227 /**
239228 * A map of role names to {@link InternalRole} objects, defining the privileges and security rules
240229 * each role entails.
241230 */
242- Map<String, InternalRole> rolesByName;
231+ @Builder.Default Map<String, InternalRole> rolesByName = Collections.emptyMap() ;
243232
244233 /**
245234 * A map of additional properties or metadata related to this snapshot. This map provides
246235 * flexibility for storing information without modifying the main schema of the snapshot.
247236 */
248- Map<String, String> properties;
237+ @Builder.Default Map<String, String> properties = Collections.emptyMap() ;
249238}
250239```
251240
0 commit comments