Skip to content

Commit

Permalink
Release Azure.Messaging.WebPubSub (Azure#48461)
Browse files Browse the repository at this point in the history
* release webpubsub and refactor test

* change release date

* resolve package version conflict

* suppress sample build warning

* upgrade samples project dependency
  • Loading branch information
cqnguy23 authored Feb 28, 2025
1 parent 8bfef50 commit 211a881
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
8 changes: 1 addition & 7 deletions sdk/webpubsub/Azure.Messaging.WebPubSub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
# Release History

## 1.5.0-beta.1 (Unreleased)
## 1.5.0 (2025-02-27)

### Features Added
- Added support for SocketIO when generating ClientAccessURI

### Breaking Changes

### Bugs Fixed

### Other Changes

## 1.4.0 (2024-07-31)

### Features Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<Description>Azure SDK client library for the WebPubSub service</Description>
<AssemblyTitle>Azure SDK for WebPubSub</AssemblyTitle>
<Version>1.5.0-beta.1</Version>
<Version>1.5.0</Version>
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
<ApiCompatVersion>1.4.0</ApiCompatVersion>
<PackageTags>Azure, WebPubSub, SignalR</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,22 @@ public async Task GetClientAccessUri_AccessKey_Test(WebPubSubClientProtocol clie
var serviceClient = new WebPubSubServiceClient(string.Format("Endpoint=http://localhost;Port=8080;AccessKey={0};Version=1.0;", FakeAccessKey), "hub");
var expectedUriPrefix = $"ws://localhost:8080{clientUriPrefix}/hubs/hub?access_token=";
// Synchronize
Assert.True(serviceClient.GetClientAccessUri(TimeSpan.FromMinutes(1), default, default, default, clientType, default).ToString().StartsWith(expectedUriPrefix));
Uri sUri = serviceClient.GetClientAccessUri(TimeSpan.FromMinutes(1), default, default, default, clientType, default);
var token = HttpUtility.ParseQueryString(sUri.Query).Get("access_token");
Assert.NotNull(token);
JwtSecurityToken jwt = s_jwtTokenHandler.ReadJwtToken(token);
var aud = jwt.Claims.FirstOrDefault(s => s.Type == "aud")?.Value;
Assert.AreEqual($"http://localhost:8080{clientUriPrefix}/hubs/hub", aud);
Assert.True(sUri.ToString().StartsWith(expectedUriPrefix));
Assert.True(serviceClient.GetClientAccessUri(DateTimeOffset.UtcNow.AddMinutes(1), default, default, default, clientType, default).ToString().StartsWith(expectedUriPrefix));
// Asynchronize
Assert.True((await serviceClient.GetClientAccessUriAsync(TimeSpan.FromMinutes(1), default, default, default, clientType, default)).ToString().StartsWith(expectedUriPrefix));
Uri asyncUri = await serviceClient.GetClientAccessUriAsync(TimeSpan.FromMinutes(1), default, default, default, clientType, default);
var asyncToken = HttpUtility.ParseQueryString(asyncUri.Query).Get("access_token");
Assert.NotNull(asyncToken);
JwtSecurityToken asyncJwt = s_jwtTokenHandler.ReadJwtToken(asyncToken);
var asyncAud = asyncJwt.Claims.FirstOrDefault(s => s.Type == "aud")?.Value;
Assert.AreEqual($"http://localhost:8080{clientUriPrefix}/hubs/hub", asyncAud);
Assert.True(asyncUri.ToString().StartsWith(expectedUriPrefix));
Assert.True((await serviceClient.GetClientAccessUriAsync(DateTimeOffset.Now, default, default, default, clientType, default)).ToString().StartsWith(expectedUriPrefix));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>true</IsPackable>
<WarningsAsErrors></WarningsAsErrors>
<DefaultItemExcludes>**</DefaultItemExcludes>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.1.3" />
<PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="4.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" />
</ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" VersionOverride="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj" />
Expand Down

0 comments on commit 211a881

Please sign in to comment.