File tree Expand file tree Collapse file tree 3 files changed +18
-14
lines changed
Expand file tree Collapse file tree 3 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 1- import { flattenJsonb } from '@/helpers/knex-jsonb-flatten'
1+ import { DataPropertyNames } from 'objection'
2+
23import { GSIS } from '@/models/dynamodb/table-row'
34import TableColumnMetadata from '@/models/table-column-metadata'
45
@@ -37,17 +38,14 @@ const createTable: AdminMutationResolvers['addGsi'] = async (
3738 }
3839
3940 await TableColumnMetadata . query ( )
40- . patch (
41- flattenJsonb ( {
42- config : {
43- gsi : {
44- indexName : correspondingGsi . gsi ,
45- type : correspondingGsi . type ,
46- status : 'pending' ,
47- } ,
48- } ,
49- } ) ,
50- )
41+ . patch ( {
42+ [ 'config:gsi' as DataPropertyNames < TableColumnMetadata > ] : {
43+ indexName : correspondingGsi . gsi ,
44+ type : correspondingGsi . type ,
45+ status : 'pending' ,
46+ patchFrom : new Date ( ) . toISOString ( ) ,
47+ } ,
48+ } )
5149 . where ( { id : columnId } )
5250
5351 return true
Original file line number Diff line number Diff line change 1- import type { MutationResolvers } from './__generated__/types.generated'
1+ import type {
2+ AdminMutation ,
3+ MutationResolvers ,
4+ } from './__generated__/types.generated'
25import bulkRetryExecutions from './mutations/bulk-retry-executions'
36import createConnection from './mutations/create-connection'
47import createFlow from './mutations/create-flow'
@@ -86,5 +89,5 @@ export default {
8689 // This is a special stub that enables us to group all our admin-related
8790 // mutations into a special AdminMutation object; each "mutations" is handled by field
8891 // resolvers defined in @/graphql/admin/mutations.
89- admin : ( ) => ( { } ) ,
92+ admin : ( ) => ( { } as AdminMutation ) ,
9093} satisfies MutationResolvers
Original file line number Diff line number Diff line change @@ -103,8 +103,11 @@ const authentication = shield(
103103 // Not OTP, but no real reason to be looser than OTP.
104104 loginWithSgid : rateLimitRule ( { window : '1s' , max : 5 } ) ,
105105 loginWithSelectedSgid : rateLimitRule ( { window : '1s' , max : 5 } ) ,
106+ // Only admins can access admin mutations, we dont want to default it in '*'
106107 admin : isAdminOperation ,
107108 } ,
109+ // This is not needed since it's already added above
110+ // but adding it here in case we want to make more granular in the future
108111 AdminMutation : isAdminOperation ,
109112 } ,
110113 {
You can’t perform that action at this time.
0 commit comments