File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ const iamRoutes: FastifyPluginAsync = async (fastify, _options) => {
4444 Body : undefined ;
4545 Querystring : { groupId : string } ;
4646 } > (
47- "/groupRoles /:groupId" ,
47+ "/groups /:groupId/roles " ,
4848 {
4949 schema : {
5050 querystring : {
@@ -90,7 +90,7 @@ const iamRoutes: FastifyPluginAsync = async (fastify, _options) => {
9090 Body : GroupMappingCreatePostRequest ;
9191 Querystring : { groupId : string } ;
9292 } > (
93- "/groupRoles /:groupId" ,
93+ "/groups /:groupId/roles " ,
9494 {
9595 schema : {
9696 querystring : {
@@ -140,7 +140,7 @@ const iamRoutes: FastifyPluginAsync = async (fastify, _options) => {
140140 reply . send ( { message : "OK" } ) ;
141141 request . log . info (
142142 { type : "audit" , actor : request . username , target : groupId } ,
143- `set group ID roles to ${ request . body . roles . toString ( ) } ` ,
143+ `set target roles to ${ request . body . roles . toString ( ) } ` ,
144144 ) ;
145145 } ,
146146 ) ;
Original file line number Diff line number Diff line change @@ -22,14 +22,17 @@ export const invitePostRequestSchema = z.object({
2222export type InviteUserPostRequest = z . infer < typeof invitePostRequestSchema > ;
2323
2424export const groupMappingCreatePostSchema = z . object ( {
25- roles : z
26- . array ( z . nativeEnum ( AppRoles ) )
27- . min ( 1 )
28- . refine ( ( items ) => new Set ( items ) . size === items . length , {
29- message : "All roles must be unique, no duplicate values allowed" ,
30- } ) ,
25+ roles : z . union ( [
26+ z . array ( z . nativeEnum ( AppRoles ) )
27+ . min ( 1 )
28+ . refine ( ( items ) => new Set ( items ) . size === items . length , {
29+ message : "All roles must be unique, no duplicate values allowed" ,
30+ } ) ,
31+ z . tuple ( [ z . literal ( "all" ) ] ) ,
32+ ] ) ,
3133} ) ;
3234
35+
3336export type GroupMappingCreatePostRequest = z . infer <
3437 typeof groupMappingCreatePostSchema
3538> ;
You can’t perform that action at this time.
0 commit comments