public async Task UpdateExtensionChangeDestinationWithAzureFunction() { await WithUpdateableExtension(client, async extension => { var newDestination = new HttpDestination { Url = "http://www.new-destination.com/", Authentication = new AzureFunctionsAuthentication { Key = "default-Key" } }; var updateActions = new List <UpdateAction <Extension> >(); var changeDestinationAction = new ChangeDestinationUpdateAction { Destination = newDestination }; updateActions.Add(changeDestinationAction); var updatedExtension = await client .ExecuteAsync(new UpdateByIdCommand <Extension>(extension, updateActions)); var updatedDestination = updatedExtension.Destination as HttpDestination; Assert.NotNull(updatedDestination); Assert.Equal(newDestination.Url, updatedDestination.Url); var updatedAuthentication = updatedDestination.Authentication as AzureFunctionsAuthentication; Assert.NotNull(updatedAuthentication); return(updatedExtension); }); }
public async Task UpdateExtensionChangeDestination() { await WithUpdateableExtension(client, async extension => { var headerValue = "newhZGRpbjpvcGVuIHNlc2FtZQ=="; var newDestination = new HttpDestination { Url = "http://www.new-destination.com/", Authentication = new AuthorizationHeader { HeaderValue = headerValue } }; var updateActions = new List <UpdateAction <Extension> >(); var changeDestinationAction = new ChangeDestinationUpdateAction { Destination = newDestination }; updateActions.Add(changeDestinationAction); var updatedExtension = await client .ExecuteAsync(new UpdateByIdCommand <Extension>(extension, updateActions)); var updatedDestination = updatedExtension.Destination as HttpDestination; Assert.NotNull(updatedDestination); Assert.Equal(newDestination.Url, updatedDestination.Url); var updatedAuthentication = updatedDestination.Authentication as AuthorizationHeader; Assert.NotNull(updatedAuthentication); return(updatedExtension); }); }
public static Destination GetHttpDestinationUsingAuthorizationHeader() { var destination = new HttpDestination { Url = "https://1i4axkp5vh.execute-api.eu-west-1.amazonaws.com/dev" }; return(destination); }
public static Destination GetHttpDestinationUsingAuthorizationHeader() { var destination = new HttpDestination { Url = "http://www.commercetools.com/", Authentication = new AuthorizationHeader { HeaderValue = "QWxhZGRpbjpvcGVuIHNlc2FtZQ==" } }; return(destination); }
/// <summary> /// Adds a destination that puts the requests on an HTTP server /// </summary> /// <param name="url">Url of the server</param> /// <param name="token">Authentication token</param> /// <returns></returns> public static LogAdministrator AddHttpDestination(this LogAdministrator logAdministrator, string url, string token = null) { var destination = new HttpDestination(url, token); return(logAdministrator.AddCustomDestination(destination)); }