Skip to content
This repository has been archived by the owner on Aug 25, 2019. It is now read-only.

Commit

Permalink
Minor service updates (#132)
Browse files Browse the repository at this point in the history
* Minor updates to the connection service processing request logic. Marked several methods that weren't previously marked as virtual so they can be overriden.

* Bump version of the other related packages.
  • Loading branch information
tplooker authored and tmarkovski committed Apr 2, 2019
1 parent bb802e1 commit 09e7979
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>3.0.0</Version>
<AssemblyVersion>3.0.0</AssemblyVersion>
<FileVersion>3.0.0</FileVersion>
<Version>3.0.1</Version>
<AssemblyVersion>3.0.1</AssemblyVersion>
<FileVersion>3.0.1</FileVersion>
<Description>ASP.NET Core support for Agent Framework</Description>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\AgentFramework.AspNetCore.xml</DocumentationFile>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
</PropertyGroup>
<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>3.0.0</Version>
<AssemblyVersion>3.0.0</AssemblyVersion>
<FileVersion>3.0.0</FileVersion>
<Version>3.0.1</Version>
<AssemblyVersion>3.0.1</AssemblyVersion>
<FileVersion>3.0.1</FileVersion>
<Description>Support for extending AgentFramework using message handlers</Description>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\AgentFramework.Core.Handlers.xml</DocumentationFile>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
Expand Down
6 changes: 3 additions & 3 deletions src/AgentFramework.Core/AgentFramework.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>.NET Core tools for building agent services</Description>
<Version>3.0.0</Version>
<AssemblyVersion>3.0.0</AssemblyVersion>
<FileVersion>3.0.0</FileVersion>
<Version>3.0.1</Version>
<AssemblyVersion>3.0.1</AssemblyVersion>
<FileVersion>3.0.1</FileVersion>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\AgentFramework.Core.xml</DocumentationFile>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
Expand Down
17 changes: 10 additions & 7 deletions src/AgentFramework.Core/Runtime/DefaultConnectionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public async Task RevokeInvitationAsync(IAgentContext agentContext, string invit
}

/// <inheritdoc />
public async Task<string> ProcessRequestAsync(IAgentContext agentContext, ConnectionRequestMessage request)
public virtual async Task<string> ProcessRequestAsync(IAgentContext agentContext, ConnectionRequestMessage request)
{
Logger.LogInformation(LoggingEvents.ProcessConnectionRequest, "Did {0}", request.Connection.Did);

Expand All @@ -197,12 +197,15 @@ public async Task<string> ProcessRequestAsync(IAgentContext agentContext, Connec

agentContext.Connection.SetTag(TagConstants.LastThreadId, request.Id);

agentContext.Connection.Alias = new ConnectionAlias
{
Name = request.Label,
ImageUrl = request.ImageUrl
};
if (agentContext.Connection.Alias == null)
agentContext.Connection.Alias = new ConnectionAlias();

if (!string.IsNullOrEmpty(request.Label) && string.IsNullOrEmpty(agentContext.Connection.Alias.Name))
agentContext.Connection.Alias.Name = request.Label;

if (!string.IsNullOrEmpty(request.ImageUrl) && string.IsNullOrEmpty(agentContext.Connection.Alias.ImageUrl))
agentContext.Connection.Alias.ImageUrl = request.ImageUrl;

if (!agentContext.Connection.MultiPartyInvitation)
{
await agentContext.Connection.TriggerAsync(ConnectionTrigger.InvitationAccept);
Expand Down Expand Up @@ -237,7 +240,7 @@ public async Task<string> ProcessRequestAsync(IAgentContext agentContext, Connec
}

/// <inheritdoc />
public async Task<string> ProcessResponseAsync(IAgentContext agentContext, ConnectionResponseMessage response)
public virtual async Task<string> ProcessResponseAsync(IAgentContext agentContext, ConnectionResponseMessage response)
{
Logger.LogInformation(LoggingEvents.AcceptConnectionResponse, "To {1}", agentContext.Connection.MyDid);

Expand Down
2 changes: 1 addition & 1 deletion src/AgentFramework.Core/Runtime/DefaultMessageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public DefaultMessageService(
}

/// <inheritdoc />
public async Task<byte[]> PrepareAsync(Wallet wallet, AgentMessage message, string recipientKey, string[] routingKeys = null, string senderKey = null)
public virtual async Task<byte[]> PrepareAsync(Wallet wallet, AgentMessage message, string recipientKey, string[] routingKeys = null, string senderKey = null)
{
if (message == null) throw new ArgumentNullException(nameof(message));
if (senderKey == null) throw new ArgumentNullException(nameof(senderKey));
Expand Down
2 changes: 1 addition & 1 deletion src/AgentFramework.Core/Runtime/DefaultPoolService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public virtual async Task<Pool> GetPoolAsync(string poolName, int protocolVersio
}

/// <inheritdoc />
public async Task<Pool> GetPoolAsync(string poolName)
public virtual async Task<Pool> GetPoolAsync(string poolName)
{
if (Pools.TryGetValue(poolName, out var pool))
{
Expand Down
4 changes: 2 additions & 2 deletions src/AgentFramework.Core/Runtime/DefaultProvisioningService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ record = await GetProvisioningAsync(wallet);
}

/// <inheritdoc />
public async Task ProvisionAgentAsync(ProvisioningConfiguration configuration)
public virtual async Task ProvisionAgentAsync(ProvisioningConfiguration configuration)
{
if (configuration == null)
throw new ArgumentNullException(nameof(configuration));
Expand Down Expand Up @@ -175,7 +175,7 @@ public async Task ProvisionAgentAsync(ProvisioningConfiguration configuration)
}

/// <inheritdoc />
public async Task UpdateEndpointAsync(Wallet wallet, AgentEndpoint endpoint)
public virtual async Task UpdateEndpointAsync(Wallet wallet, AgentEndpoint endpoint)
{
var record = await GetProvisioningAsync(wallet);
record.Endpoint = endpoint;
Expand Down
6 changes: 3 additions & 3 deletions src/AgentFramework.Core/Runtime/DefaultTailsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public DefaultTailsService(
}

/// <inheritdoc />
public async Task<BlobStorageReader> OpenTailsAsync(string filename)
public virtual async Task<BlobStorageReader> OpenTailsAsync(string filename)
{
var baseDir = EnvironmentUtils.GetTailsPath();

Expand All @@ -62,7 +62,7 @@ public async Task<BlobStorageReader> OpenTailsAsync(string filename)
}

/// <inheritdoc />
public async Task<BlobStorageWriter> CreateTailsAsync()
public virtual async Task<BlobStorageWriter> CreateTailsAsync()
{
var tailsWriterConfig = new
{
Expand All @@ -75,7 +75,7 @@ public async Task<BlobStorageWriter> CreateTailsAsync()
}

/// <inheritdoc />
public async Task<string> EnsureTailsExistsAsync(Pool pool, string revocationRegistryId)
public virtual async Task<string> EnsureTailsExistsAsync(Pool pool, string revocationRegistryId)
{
var revocationRegistry =
await LedgerService.LookupRevocationRegistryDefinitionAsync(pool, revocationRegistryId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>A Test Harness for testing AgentFramework</Description>
<Version>3.0.0</Version>
<AssemblyVersion>3.0.0</AssemblyVersion>
<FileVersion>3.0.0</FileVersion>
<Version>3.0.1</Version>
<AssemblyVersion>3.0.1</AssemblyVersion>
<FileVersion>3.0.1</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 09e7979

Please sign in to comment.