Skip to content

Commit

Permalink
Merge pull request #22 from karmaniverous:feature/GH-19-convert-sso-p…
Browse files Browse the repository at this point in the history
…olicy-to-object

[GH-19] objectified sso policies
  • Loading branch information
karmaniverous authored Aug 14, 2024
2 parents 4965ed7 + a2f3fae commit e92b9e1
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 e92b9e1

Please sign in to comment.