Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #202 from kasperk81/main
Browse files Browse the repository at this point in the history
Remove LINQ usage from product code
  • Loading branch information
baywet authored May 24, 2024
2 parents dad8eaa + af90b67 commit a625df6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.7] - 2024-05-24

### Changed

- Remove all LINQ usage from product code

## [1.1.6] - 2024-05-23

### Changed
Expand Down
10 changes: 5 additions & 5 deletions src/AzureIdentityAccessTokenProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -84,13 +83,14 @@ public async Task<string> GetAuthorizationTokenAsync(Uri uri, Dictionary<string,
span?.SetTag("com.microsoft.kiota.authentication.additional_claims_provided", BoxedFalse);

string[] scopes;
if (_scopes.Any()) {
scopes = _scopes.ToArray();
if (_scopes.Count > 0) {
scopes = new string[_scopes.Count];
_scopes.CopyTo(scopes);
} else
scopes = new string[] { $"{uri.Scheme}://{uri.Host}/.default" };
scopes = [ $"{uri.Scheme}://{uri.Host}/.default" ];
span?.SetTag("com.microsoft.kiota.authentication.scopes", string.Join(",", scopes));

var result = await this._credential.GetTokenAsync(new TokenRequestContext(scopes, claims: decodedClaim), cancellationToken).ConfigureAwait(false);
var result = await _credential.GetTokenAsync(new TokenRequestContext(scopes, claims: decodedClaim), cancellationToken).ConfigureAwait(false);
return result.Token;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Kiota.Authentication.Azure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageProjectUrl>https://aka.ms/kiota/docs</PackageProjectUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<Deterministic>true</Deterministic>
<VersionPrefix>1.1.6</VersionPrefix>
<VersionPrefix>1.1.7</VersionPrefix>
<VersionSuffix></VersionSuffix>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down

0 comments on commit a625df6

Please sign in to comment.