dotnet-azure-identity

LOW
maintainer ChrisTX 0 votes scanned 2026-10-31 05:57:59.662655
View on AUR
Why flagged

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

Triggered rules

Low Few votes, recently uploaded zero_votes_recent

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

PKGBUILD

1# Maintainer: Christian Pfeiffer <cpfeiffer at rev-crew dot info>
2# shellcheck disable=SC2034,SC2154
3# shellcheck shell=bash
4
5pkgname=dotnet-azure-identity
6_nugetid=Azure.Identity
7pkgver=1.21.0
8pkgrel=1
9pkgdesc="Microsoft Entra ID token authentication for the Azure SDK for .NET, Azure.Identity (NuGet package)"
10arch=('any')
11url='https://github.com/Azure/azure-sdk-for-net'
12license=('MIT')
13_dotnetsdkver="10.0"
14makedepends=(
15 dotnet-azure-core
16 dotnet-microsoft-identity-client
17 dotnet-sdk-"$_dotnetsdkver"
18 dotnet-system-clientmodel
19 git
20 jq
21)
22# The commit the package was published from (tag Azure.Identity_1.21.0), and the official build of
23# it, see the file version 1.2100.26.21009 of its assemblies (encoding the date and build number)
24_commit="f7400e4471111bf7f2154834022786119acbdd77"
25_officialbuildid="20260410.9"
26# The recordings the tests play back, which upstream keeps in a separate repository, see
27# sdk/identity/Azure.Identity/assets.json
28_assetscommit="4e73ccefdeecad24e95641f3592a7da92c153bd3"
29source=("azure-sdk-for-net-$_commit.tar.gz::$url/archive/$_commit.tar.gz"
30 "azure-sdk-assets-$_assetscommit.tar.gz::https://github.com/Azure/azure-sdk-assets/archive/$_assetscommit.tar.gz")
31sha512sums=('b2f3bca7ea300de872f922146f4e81b3fe2f48a96fa8ed3d9bf5fcba23f5ff5cc1ea41456e44561d46837e06b4ae8de69fa13a5534b7b9e4f08b0a29cc07ebf9'
32 '938722d2598e60f5631a883ec194c2e1c0bab08846f932ad109a27f5e6b4d41e9df677d69872af0481dc3727eca9c80aef2ad7d74ea3e6e10b7390f803c259b3')
33b2sums=('78bd307dd5de35a5ab58b3246a3daab826331afab04a37e95209a5f5ae49a9412d06a7e05dd99a4d5f55fb7f020813d5b8a6dd7ea95de48eed18c9a90e6eb313'
34 'c28c5251411ede98364add0955e5826a06c2d3bc84e461ec898852c45a004ab8d61a0fb8188d3b9680fd59db795db376b6e8825d42712c27a9431478cbf8fb68')
35
36_dotnet_env() {
37 export NUGET_PACKAGES="$srcdir/nuget"
38 export DOTNET_CLI_HOME="$srcdir/dotnet-home"
39 export DOTNET_CLI_TELEMETRY_OPTOUT=1
40 export DOTNET_NOLOGO=1
41
42 # The checks of the API listing, the analyzers and API compatibility with the previous release
43 # (from nuget.org) don't change the build. Source Link needs git, so the repository information is
44 # passed in. The packages from the source-built artifacts and the system feed are newer than the
45 # versions referenced (NU1603).
46 _build_arguments=(
47 --configuration Release
48 -p:GenerateAPIListing=false
49 -p:EnableClientSdkAnalyzers=false
50 -p:EnableMicrosoftCodeAnalysisNetAnalyzers=false
51 -p:EnableBannedApiAnalyzers=false
52 -p:EnableStyleCopAnalyzers=false
53 -p:RunApiCompat=false
54 -p:ValidateRunApiCompat=false
55 -p:ApiCompatVersion=
56 -p:EnableSourceLink=false
57 -p:SourceRevisionId="$_commit"
58 -p:RepositoryCommit="$_commit"
59 -p:RepositoryUrl="$url"
60 -p:SkipDevBuildNumber=true
61 -p:WarningsNotAsErrors=NU1603
62 )
63}
64
65# .NET runtime packages Azure.Core is built against
66_runtimepackages=(
67 Microsoft.Bcl.AsyncInterfaces
68 Microsoft.Extensions.Configuration.Abstractions
69 Microsoft.Extensions.DependencyInjection.Abstractions
70 Microsoft.Extensions.Diagnostics.Abstractions
71 Microsoft.Extensions.FileProviders.Abstractions
72 Microsoft.Extensions.Hosting.Abstractions
73 Microsoft.Extensions.Logging.Abstractions
74 Microsoft.Extensions.Options
75 Microsoft.Extensions.Primitives
76 Microsoft.IdentityModel.Abstractions
77 System.Diagnostics.DiagnosticSource
78 System.IO.Pipelines
79 System.Memory.Data
80 System.Net.ServerSentEvents
81 System.Text.Encodings.Web
82 System.Text.Json
83)
84
85# Packages built from source by other packages (makedepends), in the system feed
86_systempackages=(
87 Azure.Core
88 Microsoft.Identity.Client
89 Microsoft.Identity.Client.Extensions.Msal
90 System.ClientModel
91)
92
93# Writes NuGet.config with the feed $1 (as key=url) for everything but the packages of the system
94# feed and the runtime packages, which are taken from the source-built artifacts if prepare() found
95# them there
96_nuget_config() {
97 local _package
98 {
99 cat <<EOF
100<?xml version="1.0" encoding="utf-8"?>
101<configuration>
102 <packageSources>
103 <clear />
104 <add key="dotnet-system" value="/usr/share/dotnet/nuget-packages" />
105 <add key="dotnet-source-built" value="$srcdir/nuget-local" />
106 <add key="${1%%=*}" value="${1#*=}" />
107 </packageSources>
108 <packageSourceMapping>
109 <clear />
110 <packageSource key="dotnet-system">
111EOF
112 for _package in "${_systempackages[@]}"; do
113 echo " <package pattern=\"$_package\" />"
114 done
115 echo ' </packageSource>'
116 if [[ -f "$srcdir/runtime-packages" ]]; then
117 echo ' <packageSource key="dotnet-source-built">'
118 for _package in "${_runtimepackages[@]}"; do
119 echo " <package pattern=\"$_package\" />"
120 done
121 echo ' </packageSource>'
122 fi
123 cat <<EOF
124 <packageSource key="${1%%=*}">
125 <package pattern="*" />
126 </packageSource>
127 </packageSourceMapping>
128</configuration>
129EOF
130 } >NuGet.Config
131}
132
133prepare() {
134 # The runtime packages are part of the source-built .NET of Arch Linux
135 # (dotnet-source-built-artifacts), which Arch Linux ARM doesn't have. It can't be a makedepends of
136 # an arch=any package, so it's used when it's installed, and they come from nuget.org otherwise.
137 mkdir -p nuget-local
138 local _artifacts
139 for _artifacts in /usr/share/dotnet/source-built-artifacts/Private.SourceBuilt.Artifacts.*.tar.gz; do
140 [[ -f "$_artifacts" ]] || continue
141 bsdtar -xf "$_artifacts" -C nuget-local "${_runtimepackages[@]/%/.*.nupkg}"
142 touch runtime-packages
143 done
144
145 # Upstream builds with a newer feature band of the .NET SDK, which isn't needed. dotnet only works
146 # outside the repository until its global.json is updated.
147 local _sdkver
148 _sdkver=$(dotnet --version)
149
150 cd "azure-sdk-for-net-$_commit" || exit
151 # Upstream's NuGet.Config, which has the feed the tests need
152 mv NuGet.Config NuGet.Config.upstream
153 jq --arg sdk "$_sdkver" '.sdk.version = $sdk | .sdk.rollForward = "latestPatch"' global.json >global.json.new
154 mv global.json.new global.json
155 # Release builds have to check the API listing, which is turned off above
156 sed -i '/<Target Name="_CheckGenerateAPIListingValue"/,/<\/Target>/d' eng/ApiListing.targets
157
158 # The test proxy would get the recordings with git, from the git repository it finds above the
159 # sources, so it gets them from the sources instead, in their own repository
160 cp -r "$srcdir/azure-sdk-assets-$_assetscommit/net/sdk/identity/$_nugetid/tests/SessionRecords" "sdk/identity/$_nugetid/tests/"
161 rm "sdk/identity/$_nugetid/assets.json"
162 git init --quiet .
163}
164
165build() {
166 _dotnet_env
167 cd "azure-sdk-for-net-$_commit" || exit
168 # Version as in the official build. On Linux, it builds for all frameworks but the .NET Framework.
169 # The assemblies are public signed with Microsoft's key, giving them the same strong names as
170 # upstream's.
171 _nuget_config "nuget.org=https://api.nuget.org/v3/index.json"
172 dotnet pack "sdk/identity/$_nugetid/src/$_nugetid.csproj" "${_build_arguments[@]}" \
173 -p:OfficialBuildId="$_officialbuildid" --output "$srcdir/nupkg"
174}
175
176check() {
177 _dotnet_env
178 cd "azure-sdk-for-net-$_commit" || exit
179 # The tests need packages from the feed upstream uses, which mirrors nuget.org
180 local _feed
181 _feed=$(sed -n -E 's|.*<add key="([^"]+)" value="(https[^"]+)".*|\1=\2|p' NuGet.Config.upstream)
182 _nuget_config "$_feed"
183 # Like upstream's CI (eng/pipelines/templates/jobs/ci.tests.yml), without the tests that need user
184 # interaction or Azure. Only on the .NET runtime that's installed, the tests target older ones, too.
185 # Without a display and browser, so a test that would sign in interactively can't open sign-in
186 # pages, and failing instead of waiting for the sign-in.
187 local _result=0
188 env -u DISPLAY -u WAYLAND_DISPLAY BROWSER=false \
189 dotnet test "sdk/identity/$_nugetid/tests/$_nugetid.Tests.csproj" "${_build_arguments[@]}" --framework net10.0 \
190 --filter 'TestCategory!=Manually&TestCategory!=Live' --blame-hang-timeout 10m --blame-hang-dump-type none ||
191 _result=$?
192 # The test framework only stops the test proxy it starts on Windows
193 pkill -f "^/usr/bin/dotnet $srcdir/nuget/azure.sdk.tools.testproxy/" || true
194 return "$_result"
195}
196
197# Fails if a binary in $pkgdir, also inside the .nupkg files there, is identical to one of the packages
198# restored from a remote feed like nuget.org into $1, so no prebuilt binary slips in instead of one built
199# from source
200_check_prebuilt() {
201 local _extracted="$srcdir/check-prebuilt" _metadata _file _hash _found=0
202 local _binaries=(-type f '(' -name '*.dll' -o -name '*.exe' -o -name '*.so' -o -name '*.so.*' -o -name '*.dylib' ')')
203 local -A _prebuilt=()
204 while IFS= read -r -d '' _metadata; do
205 grep -qE '"source": *"https?://' "$_metadata" || continue
206 while IFS= read -r -d '' _file; do
207 _prebuilt[$(sha256sum <"$_file")]="${_file#"$1"/}"
208 done < <(find "${_metadata%/*}" "${_binaries[@]}" -print0)
209 done < <(find "$1" -name .nupkg.metadata -print0)
210
211 rm -rf "$_extracted"
212 mkdir -p "$_extracted"
213 while IFS= read -r -d '' _file; do
214 mkdir -p "$_extracted/${_file#"$pkgdir"/}"
215 bsdtar -xf "$_file" -C "$_extracted/${_file#"$pkgdir"/}"
216 done < <(find "$pkgdir" -type f -name '*.nupkg' -print0)
217 while IFS= read -r -d '' _file; do
218 _hash=$(sha256sum <"$_file")
219 if [[ -v "_prebuilt[$_hash]" ]]; then
220 echo "Prebuilt binary: ${_file#"$_extracted"/} is ${_prebuilt[$_hash]}" >&2
221 _found=1
222 fi
223 done < <(find "$pkgdir" "$_extracted" "${_binaries[@]}" -print0)
224 rm -rf "$_extracted"
225 return "$_found"
226}
227
228package() {
229 install -Dm644 "$srcdir/nupkg/$_nugetid.$pkgver.nupkg" -t "$pkgdir/usr/share/dotnet/nuget-packages/"
230 install -Dm644 "azure-sdk-for-net-$_commit/LICENSE.txt" -t "$pkgdir/usr/share/licenses/$pkgname/"
231
232 _check_prebuilt "$srcdir/nuget"
233}
234

Scan history

Scanned at (UTC)SeverityRules
2026-10-31 05:57:59 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion