public async Task <InvokeResult> UpdateCustomPipelineModuleConfigurationAsync(CustomPipelineModuleConfiguration pipelineModuleConfiguration, EntityHeader org, EntityHeader user)
        {
            await AuthorizeAsync(pipelineModuleConfiguration, AuthorizeActions.Update, user, org);

            ValidationCheck(pipelineModuleConfiguration, Actions.Update);
            await _customPipelineConfigurationRepo.UpdateCustomPipelineModuleConfigurationAsync(pipelineModuleConfiguration);

            return(InvokeResult.Success);
        }
Exemplo n.º 2
0
        public async Task <InvokeResult> UpdateCustomPipelineModuleConfigurationAsync(CustomModuleConfiguration pipelineModuleConfiguration, EntityHeader org, EntityHeader user)
        {
            await AuthorizeAsync(pipelineModuleConfiguration, AuthorizeActions.Update, user, org);

            ValidationCheck(pipelineModuleConfiguration, Actions.Update);

            if (!String.IsNullOrEmpty(pipelineModuleConfiguration.AuthenticationHeader))
            {
                await _secureStorage.RemoveSecretAsync(org, pipelineModuleConfiguration.AuthenticationHeaderSecureId);

                var addSecretResult = await _secureStorage.AddSecretAsync(org, pipelineModuleConfiguration.AuthenticationHeader);

                if (!addSecretResult.Successful)
                {
                    return(addSecretResult.ToInvokeResult());
                }
                pipelineModuleConfiguration.AuthenticationHeaderSecureId = addSecretResult.Result;
                pipelineModuleConfiguration.AuthenticationHeader         = null;
            }

            if (!String.IsNullOrEmpty(pipelineModuleConfiguration.AccountPassword))
            {
                await _secureStorage.RemoveSecretAsync(org, pipelineModuleConfiguration.AccountPasswordSecureId);

                var addSecretResult = await _secureStorage.AddSecretAsync(org, pipelineModuleConfiguration.AccountPassword);

                if (!addSecretResult.Successful)
                {
                    return(addSecretResult.ToInvokeResult());
                }
                pipelineModuleConfiguration.AccountPasswordSecureId = addSecretResult.Result;
                pipelineModuleConfiguration.AccountPassword         = null;
            }

            await _customPipelineConfigurationRepo.UpdateCustomPipelineModuleConfigurationAsync(pipelineModuleConfiguration);

            return(InvokeResult.Success);
        }