Compare commits
	
		
			1 Commits
		
	
	
		
			dependabot
			...
			update-sam
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 934a525898 | 
| @@ -26,6 +26,7 @@ import updateStep from './mutations/update-step'; | |||||||
| import updateUser from './mutations/update-user.ee'; | import updateUser from './mutations/update-user.ee'; | ||||||
| import verifyConnection from './mutations/verify-connection'; | import verifyConnection from './mutations/verify-connection'; | ||||||
| import createSamlAuthProvider from './mutations/create-saml-auth-provider.ee'; | import createSamlAuthProvider from './mutations/create-saml-auth-provider.ee'; | ||||||
|  | import updateSamlAuthProvider from './mutations/update-saml-auth-provider.ee'; | ||||||
|  |  | ||||||
| const mutationResolvers = { | const mutationResolvers = { | ||||||
|   createConnection, |   createConnection, | ||||||
| @@ -56,6 +57,7 @@ const mutationResolvers = { | |||||||
|   updateStep, |   updateStep, | ||||||
|   verifyConnection, |   verifyConnection, | ||||||
|   createSamlAuthProvider, |   createSamlAuthProvider, | ||||||
|  |   updateSamlAuthProvider, | ||||||
| }; | }; | ||||||
|  |  | ||||||
| export default mutationResolvers; | export default mutationResolvers; | ||||||
|   | |||||||
| @@ -0,0 +1,45 @@ | |||||||
|  | import type { SamlConfig } from '@node-saml/passport-saml'; | ||||||
|  | import SamlAuthProvider from '../../models/saml-auth-provider.ee'; | ||||||
|  | import Context from '../../types/express/context'; | ||||||
|  |  | ||||||
|  | type Params = { | ||||||
|  |   input: { | ||||||
|  |     name: string; | ||||||
|  |     certificate: string; | ||||||
|  |     signatureAlgorithm: SamlConfig['signatureAlgorithm']; | ||||||
|  |     issuer: string; | ||||||
|  |     entryPoint: string; | ||||||
|  |     firstnameAttributeName: string; | ||||||
|  |     surnameAttributeName: string; | ||||||
|  |     emailAttributeName: string; | ||||||
|  |     roleAttributeName: string; | ||||||
|  |     defaultRoleId: string; | ||||||
|  |     active: boolean; | ||||||
|  |   }; | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | const updateSamlAuthProvider = async ( | ||||||
|  |   _parent: unknown, | ||||||
|  |   params: Params, | ||||||
|  |   context: Context | ||||||
|  | ) => { | ||||||
|  |   context.currentUser.can('update', 'SamlAuthProvider'); | ||||||
|  |  | ||||||
|  |   const samlAuthProviderPayload: Partial<SamlAuthProvider> = { | ||||||
|  |     ...params.input, | ||||||
|  |   }; | ||||||
|  |  | ||||||
|  |   const existingSamlAuthProvider = await SamlAuthProvider.query() | ||||||
|  |     .limit(1) | ||||||
|  |     .first() | ||||||
|  |     .throwIfNotFound(); | ||||||
|  |  | ||||||
|  |   const samlAuthProvider = await SamlAuthProvider.query().patchAndFetchById( | ||||||
|  |     existingSamlAuthProvider.id, | ||||||
|  |     samlAuthProviderPayload | ||||||
|  |   ); | ||||||
|  |  | ||||||
|  |   return samlAuthProvider; | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | export default updateSamlAuthProvider; | ||||||
| @@ -79,6 +79,7 @@ type Mutation { | |||||||
|   updateUser(input: UpdateUserInput): User |   updateUser(input: UpdateUserInput): User | ||||||
|   verifyConnection(input: VerifyConnectionInput): Connection |   verifyConnection(input: VerifyConnectionInput): Connection | ||||||
|   createSamlAuthProvider(input: CreateSamlAuthProviderInput): SamlAuthProvider |   createSamlAuthProvider(input: CreateSamlAuthProviderInput): SamlAuthProvider | ||||||
|  |   updateSamlAuthProvider(input: UpdateSamlAuthProviderInput): SamlAuthProvider | ||||||
| } | } | ||||||
|  |  | ||||||
| """ | """ | ||||||
| @@ -349,6 +350,20 @@ input CreateSamlAuthProviderInput { | |||||||
|   active: Boolean! |   active: Boolean! | ||||||
| } | } | ||||||
|  |  | ||||||
|  | input UpdateSamlAuthProviderInput { | ||||||
|  |   name: String! | ||||||
|  |   certificate: String! | ||||||
|  |   signatureAlgorithm: String! | ||||||
|  |   issuer: String! | ||||||
|  |   entryPoint: String! | ||||||
|  |   firstnameAttributeName: String! | ||||||
|  |   surnameAttributeName: String! | ||||||
|  |   emailAttributeName: String! | ||||||
|  |   roleAttributeName: String! | ||||||
|  |   defaultRoleId: String! | ||||||
|  |   active: Boolean! | ||||||
|  | } | ||||||
|  |  | ||||||
| input DeleteConnectionInput { | input DeleteConnectionInput { | ||||||
|   id: String! |   id: String! | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user