Skip to content

Commit

Permalink
[GH-19] objectified sso policies
Browse files Browse the repository at this point in the history
  • Loading branch information
karmaniverous committed Aug 14, 2024
1 parent 4965ed7 commit a2f3fae
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ export const configSchema = z
)
.nullable()
.optional(),
policies: z.record(z.string()).nullable().optional(),
policies: z
.record(z.object({ name: z.string() }).catchall(z.any()))
.nullable()
.optional(),
reference: z
.object({
account_permission_sets: z.record(z.string().array()),
Expand Down Expand Up @@ -381,17 +384,26 @@ export const configSchema = z
}
}
// validate name uniqueness across sso groups
validateObjectPropertyUnique(data, ctx, 'sso.groups', 'group', 'name');
validateObjectPropertyUnique(data, ctx, ['sso', 'groups'], 'group', 'name');

// validate name uniqueness across sso permission sets
validateObjectPropertyUnique(
data,
ctx,
'sso.permission_sets',
['sso', 'permission_sets'],
'permission_set',
'name',
);

// validate name uniqueness across sso policies
validateObjectPropertyUnique(
data,
ctx,
['sso', 'policies'],
'policy',
'name',
);

// validate email uniqueness across sso users
validateObjectPropertyUnique(data, ctx, 'sso.users', 'user', 'email');

Expand Down

0 comments on commit a2f3fae

Please sign in to comment.