protected async Task EnqueueCommandAsync(ICommand command)
    {
        if (command is null)
        {
            throw new ArgumentNullException(nameof(command));
        }

        try
        {
            var commandQueue = await commandQueueInstance
                               .Value
                               .ConfigureAwait(false);

            var commandMessage = TeamCloudSerialize.SerializeObject(command);

            await commandQueue
            .SendMessageAsync(commandMessage)
            .ConfigureAwait(false);
        }
        catch
        {
            commandQueueInstance.Reset();

            throw;
        }
    }
예제 #2
0
        public async Task SetAllSecretPermissionsAsync(Guid userObjectId)
        {
            try
            {
                var vault = await vaultInstance
                            .ConfigureAwait(false);

                await vault.Update()
                .DefineAccessPolicy()
                .ForObjectId(userObjectId.ToString())
                .AllowSecretAllPermissions()
                .Attach()
                .ApplyAsync()
                .ConfigureAwait(false);
            }
            finally
            {
                vaultInstance.Reset();
            }
        }