Skip to content

Conversation

@waldekmastykarz
Copy link
Member

No description provided.

Copy link
Contributor

@MartinM85 MartinM85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick review. Nothing major, but maybe I overlooked something.

.strict();
export const options = z.strictObject({
...globalOptionsZod.shape,
userId: z.string().refine(id => validation.isValidGuid(id), {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
userId: z.string().refine(id => validation.isValidGuid(id), {
userId: z.uuid().refine(id => validation.isValidGuid(id), {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're using uuid(), then we don't need to add manual refinement on top. z.uuid() would suffice.

@waldekmastykarz
Copy link
Member Author

Thanks for the feedback @MartinM85! Very keen eye!

@waldekmastykarz waldekmastykarz marked this pull request as ready for review November 15, 2025 09:47
@MartinM85 MartinM85 self-assigned this Nov 26, 2025
Copy link
Contributor

@MartinM85 MartinM85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor suggestions from my side...using z.uuid() instead of z.string() in several commands.

}),
certificateBase64Encoded: z.string().optional(),
thumbprint: z.string().optional(),
appId: z.string().optional(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
appId: z.string().optional(),
appId: z.uuid().optional(),

Comment on lines +15 to +30
export const options = z.strictObject({
...globalOptionsZod.shape,
roleDefinitionId: z.string().optional(),
roleDefinitionName: z.string().optional(),
principalId: z.string().optional(),
principalName: z.string().optional(),
scope: z.enum(['tenant', 'user', 'group', 'administrativeUnit', 'custom']).alias('s'),
userId: z.string().optional(),
userName: z.string().optional(),
groupId: z.string().optional(),
groupName: z.string().optional(),
administrativeUnitId: z.string().optional(),
administrativeUnitName: z.string().optional(),
customAppScopeId: z.string().optional(),
customAppScopeName: z.string().optional()
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export const options = z.strictObject({
...globalOptionsZod.shape,
roleDefinitionId: z.string().optional(),
roleDefinitionName: z.string().optional(),
principalId: z.string().optional(),
principalName: z.string().optional(),
scope: z.enum(['tenant', 'user', 'group', 'administrativeUnit', 'custom']).alias('s'),
userId: z.string().optional(),
userName: z.string().optional(),
groupId: z.string().optional(),
groupName: z.string().optional(),
administrativeUnitId: z.string().optional(),
administrativeUnitName: z.string().optional(),
customAppScopeId: z.string().optional(),
customAppScopeName: z.string().optional()
});
export const options = z.strictObject({
...globalOptionsZod.shape,
roleDefinitionId: z.uuid().optional(),
roleDefinitionName: z.string().optional(),
principalId: z.uuid().optional(),
principalName: z.string().optional(),
scope: z.enum(['tenant', 'user', 'group', 'administrativeUnit', 'custom']).alias('s'),
userId: z.uuid().optional(),
userName: z.string().optional(),
groupId: z.uuid().optional(),
groupName: z.string().optional(),
administrativeUnitId: z.uuid().optional(),
administrativeUnitName: z.string().optional(),
customAppScopeId: z.uuid().optional(),
customAppScopeName: z.string().optional()
});

Comment on lines +14 to +15
appId: z.string().optional(),
appObjectId: z.string().optional(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
appId: z.string().optional(),
appObjectId: z.string().optional(),
appId: z.uuid().optional(),
appObjectId: z.uuid().optional(),

const options = z.looseObject({
...globalOptionsZod.shape,
name: z.string().alias('n'),
resourceId: z.string().alias('i'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resourceId: z.string().alias('i'),
resourceId: z.uuid().alias('i'),

.strict();
export const options = z.strictObject({
...globalOptionsZod.shape,
resourceId: z.string().alias('i'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resourceId: z.string().alias('i'),
resourceId: z.uuid().alias('i'),

.strict();
export const options = z.strictObject({
...globalOptionsZod.shape,
resourceId: z.string().alias('i'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resourceId: z.string().alias('i'),
resourceId: z.uuid().alias('i'),

const options = z.looseObject({
...globalOptionsZod.shape,
name: z.string().alias('n'),
resourceId: z.string().alias('i'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resourceId: z.string().alias('i'),
resourceId: z.uuid().alias('i'),

Comment on lines +14 to +16
userId: z.string().refine(id => validation.isValidGuid(id), {
error: e => `'${e.input}' is not a valid GUID.`
}).optional().alias('i'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
userId: z.string().refine(id => validation.isValidGuid(id), {
error: e => `'${e.input}' is not a valid GUID.`
}).optional().alias('i'),
userId: z.uuid().optional().alias('i'),

@MartinM85 MartinM85 marked this pull request as draft November 26, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants