Skip to content

Commit 71a87c3

Browse files
devlooped-botkzu
authored andcommitted
⬆️ Bump files with dotnet-file sync
# devlooped/oss - Fix improper first / in gh api repos devlooped/oss@f2b690c - Group Spectre.Console updates devlooped/oss@917ff54 - Move dotnet setup to composite action devlooped/oss@08c7077 # devlooped/SponsorLink - Improve wording on editor usage requiring sponsorship devlooped/SponsorLink@21d8dac - Introduce standalone SponsorManifest for read/validate devlooped/SponsorLink@a755e4b
1 parent d86b454 commit 71a87c3

File tree

12 files changed

+263
-170
lines changed

12 files changed

+263
-170
lines changed

.github/actions/dotnet/action.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: ⚙ dotnet
2+
description: Configures dotnet if the repo/org defines the DOTNET custom property
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: 🔎 dotnet
8+
id: dotnet
9+
shell: bash
10+
run: |
11+
VERSIONS=$(gh api repos/${{ github.repository }}/properties/values | jq -r '.[] | select(.property_name == "DOTNET") | .value')
12+
# Remove extra whitespace from VERSIONS
13+
VERSIONS=$(echo "$VERSIONS" | tr -s ' ' | tr -d ' ')
14+
# Convert comma-separated to newline-separated
15+
NEWLINE_VERSIONS=$(echo "$VERSIONS" | tr ',' '\n')
16+
# Validate versions
17+
while IFS= read -r version; do
18+
if ! [[ $version =~ ^[0-9]+(\.[0-9]+(\.[0-9]+)?)?(\.x)?$ ]]; then
19+
echo "Error: Invalid version format: $version"
20+
exit 1
21+
fi
22+
done <<< "$NEWLINE_VERSIONS"
23+
# Write multiline output to $GITHUB_OUTPUT
24+
{
25+
echo 'versions<<EOF'
26+
echo "$NEWLINE_VERSIONS"
27+
echo 'EOF'
28+
} >> $GITHUB_OUTPUT
29+
30+
- name: ⚙ dotnet
31+
if: steps.dotnet.outputs.versions != ''
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: |
35+
${{ steps.dotnet.outputs.versions }}

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ updates:
3838
ProtoBuf:
3939
patterns:
4040
- "protobuf-*"
41+
Spectre:
42+
patterns:
43+
- "Spectre.Console*"

.github/workflows/build.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,7 @@ jobs:
6666
fetch-depth: 0
6767

6868
- name: ⚙ dotnet
69-
uses: actions/setup-dotnet@v4
70-
with:
71-
dotnet-version: |
72-
6.x
73-
8.x
74-
9.x
69+
uses: ./.github/actions/dotnet
7570

7671
- name: 🙏 build
7772
run: dotnet build -m:1 -bl:build.binlog

.github/workflows/publish.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
VersionLabel: ${{ github.ref }}
1616
GH_TOKEN: ${{ secrets.GH_TOKEN }}
1717
MSBUILDTERMINALLOGGER: auto
18-
SLEET_FEED_URL: ${{ vars.SLEET_FEED_URL }}
18+
SLEET_FEED_URL: https://api.nuget.org/v3/index.json
1919

2020
jobs:
2121
publish:
@@ -28,12 +28,7 @@ jobs:
2828
fetch-depth: 0
2929

3030
- name: ⚙ dotnet
31-
uses: actions/setup-dotnet@v4
32-
with:
33-
dotnet-version: |
34-
6.x
35-
8.x
36-
9.x
31+
uses: ./.github/actions/dotnet
3732

3833
- name: 🙏 build
3934
run: dotnet build -m:1 -bl:build.binlog

.netconfig

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@
3737
weak
3838
[file ".github/dependabot.yml"]
3939
url = https://github.com/devlooped/oss/blob/main/.github/dependabot.yml
40-
sha = 49661dbf0720cde93eb5569be7523b5912351560
41-
etag = c147ea2f3431ca0338c315c4a45b56ee233c4d30f8d6ab698d0e1980a257fd6a
40+
sha = 917ff5486e25bec90038e7ab6d146fd82c61f846
41+
etag = 50bf50df5a6eeb1705baea50f4c6e06d167a89cb5a590887ff939bd4120bd442
4242
weak
4343
[file ".github/workflows/build.yml"]
4444
url = https://github.com/devlooped/oss/blob/main/.github/workflows/build.yml
45-
sha = 931da830a361d69b419887a0edbb424517ca75fc
45+
sha = 08c70776943839f73dbea2e65355108747468508
4646

47-
etag = ea785d08ab67abc57629649b0a418a515dc58248de12668f3616908873f8ecc6
47+
etag = fb2e91cdc9fb7a4d3e8f698e525816c5d8febb35b005c278eecca8056e78f809
4848
weak
4949
[file ".github/workflows/changelog.yml"]
5050
url = https://github.com/devlooped/oss/blob/main/.github/workflows/changelog.yml
@@ -66,9 +66,9 @@
6666
weak
6767
[file ".github/workflows/publish.yml"]
6868
url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml
69-
sha = 931da830a361d69b419887a0edbb424517ca75fc
69+
sha = 08c70776943839f73dbea2e65355108747468508
7070

71-
etag = 62a13b8b34b1b265cdc045bf7ea001dee7bdc184cba7abfea5fe77283cf419a6
71+
etag = 722a2c7cb3a42bc24ca7fb48d2e9a336641ed0599418239e24efbafccf64bd50
7272
weak
7373
[file ".gitignore"]
7474
url = https://github.com/devlooped/oss/blob/main/.gitignore
@@ -245,12 +245,6 @@
245245

246246
etag = a5d79dbc0ed9fac4fb1879fb3790b9ebab18e47c14c454554ce9f53f21487bb5
247247
weak
248-
[file "src/SponsorLink/SponsorLink/ManifestStatus.cs"]
249-
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/ManifestStatus.cs
250-
sha = f47528874a6d9192b5546f84b455f5ccc474a707
251-
252-
etag = e46848f83c0436ba33a1c09a4060ad627a74db41bab66bb37ca40fce8a6532a7
253-
weak
254248
[file "src/SponsorLink/SponsorLink/Resources.es-AR.resx"]
255249
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/Resources.es-AR.resx
256250
sha = 586398c3e650495f36601ecc8983a14ed745e058
@@ -259,22 +253,22 @@
259253
weak
260254
[file "src/SponsorLink/SponsorLink/Resources.es.resx"]
261255
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/Resources.es.resx
262-
sha = 29921560c73bb91c2a21a21800daf0b250773598
256+
sha = 21d8dac3077c75cd07d7cc7f9e10f2620afce834
263257

264-
etag = feb9dc86e4d9c0c4a294cd6e03c5b914943e8d206b88a125abd1b0f882ddb247
258+
etag = 89a7bb797aeacca43e043196a00eea91f282df4caf9bbe937749026a03f707ad
265259
weak
266260
[file "src/SponsorLink/SponsorLink/Resources.resx"]
267261
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/Resources.resx
268-
sha = 29921560c73bb91c2a21a21800daf0b250773598
262+
sha = 21d8dac3077c75cd07d7cc7f9e10f2620afce834
269263

270-
etag = 7665a3be17cd224b1c413ade6a9c1c5a822dace1e7f9daae33a2e52d8bca15bb
264+
etag = 8902652b8907de2fbccf73f3738d0fce503fc667a084171d6b88bf3373e559e7
271265
weak
272266
[file "src/SponsorLink/SponsorLink/SponsorLink.cs"]
273267
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorLink.cs
274-
sha = 3f72a9fd35274a659dd380a7d5b747d71b9732a1
268+
sha = a755e4be0f7cb73cfde208857e28f7cfeba2dcc3
275269

276270

277-
etag = 616598e0ecb6d2ce97660aa6ac049e2a31a1c953669743b7b612b61d40c37706
271+
etag = 402e2beb11cf64c07be3d0fc3e89115fd09fc24133c08a8951bf0e784909c510
278272
weak
279273
[file "src/SponsorLink/SponsorLink/SponsorLink.csproj"]
280274
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorLink.csproj
@@ -367,12 +361,6 @@
367361

368362
etag = 1875555adb7eab21acf1e730b6baeb8c095d9f6f9f07303a87ad9c16e0f6490d
369363
weak
370-
[file "src/SponsorLink/Tests/SponsorLinkTests.cs"]
371-
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Tests/SponsorLinkTests.cs
372-
sha = f47528874a6d9192b5546f84b455f5ccc474a707
373-
374-
etag = 1fa41250bd984e8aa840a966d34ce0e94f2111d1422d7f50b864c38364fcf4a4
375-
weak
376364
[file "src/SponsorLink/Tests/SponsorableManifest.cs"]
377365
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Tests/SponsorableManifest.cs
378366
sha = f47528874a6d9192b5546f84b455f5ccc474a707
@@ -450,3 +438,18 @@
450438
sha = 032439dbf180fca0539a5bd3a019f18ab3484b76
451439
etag = da7c0104131bd474b52fc9bc9f9bda6470e24ae38d4fb9f5c4f719bc01370ab5
452440
weak
441+
[file ".github/actions/dotnet/action.yml"]
442+
url = https://github.com/devlooped/oss/blob/main/.github/actions/dotnet/action.yml
443+
sha = f2b690ce307acb76c5b8d7faec1a5b971a93653e
444+
etag = 27ea11baa2397b3ec9e643a935832da97719c4e44215cfd135c49cad4c29373f
445+
weak
446+
[file "src/SponsorLink/SponsorLink/SponsorManifest.cs"]
447+
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorManifest.cs
448+
sha = a755e4be0f7cb73cfde208857e28f7cfeba2dcc3
449+
etag = 55ef89e8441156541c1c74a50675b7f56633b56493031f0ffa877460839e3536
450+
weak
451+
[file "src/SponsorLink/Tests/SponsorManifestTests.cs"]
452+
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Tests/SponsorManifestTests.cs
453+
sha = a755e4be0f7cb73cfde208857e28f7cfeba2dcc3
454+
etag = 82ae1c417265f2e136544980b4f687a1cc2c1bfb24df93d354c259053550f4a3
455+
weak

readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ The versioning scheme for packages is:
330330
[![David JENNI](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/davidjenni.png "David JENNI")](https://github.com/davidjenni)
331331
[![Jonathan ](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/Jonathan-Hickey.png "Jonathan ")](https://github.com/Jonathan-Hickey)
332332
[![Charley Wu](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/akunzai.png "Charley Wu")](https://github.com/akunzai)
333-
[![Jakob Tikjøb Andersen](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jakobt.png "Jakob Tikjøb Andersen")](https://github.com/jakobt)
334333
[![Ken Bonny](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/KenBonny.png "Ken Bonny")](https://github.com/KenBonny)
335334
[![Simon Cropp](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/SimonCropp.png "Simon Cropp")](https://github.com/SimonCropp)
336335
[![agileworks-eu](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/agileworks-eu.png "agileworks-eu")](https://github.com/agileworks-eu)

src/SponsorLink/SponsorLink/ManifestStatus.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/SponsorLink/SponsorLink/Resources.es.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ Por favor considera apoyar el proyecto patrocinando en {0} y ejecutando posterio
169169
<data name="Contributor_Title" xml:space="preserve">
170170
<value>Eres un contribuidor al proyecto, eres lo máximo 💟!</value>
171171
</data>
172+
<data name="Editor_Disabled" xml:space="preserve">
173+
<value>El uso de {0} sin warnings en el editor requiere un patrocinio activo. Ver mas en {1}.</value>
174+
</data>
172175
<data name="Grace_Description" xml:space="preserve">
173176
<value>Patrocinar los proyectos en que dependes asegura que se mantengan activos, y que recibas el apoyo que necesitas. También es muy económico y está disponible en todo el mundo!
174177
Por favor considera apoyar el proyecto patrocinando en {0} y ejecutando posteriormente 'sponsor sync {1}'.</value>

src/SponsorLink/SponsorLink/Resources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Please consider supporting the project by sponsoring at {0} and running 'sponsor
171171
<value>You are a contributor to the project, you rock 💟!</value>
172172
</data>
173173
<data name="Editor_Disabled" xml:space="preserve">
174-
<value>Editor usage of {0} requires an active sponsorship. Learn more at {1}.</value>
174+
<value>Editor usage of {0} without warnings requires an active sponsorship. Learn more at {1}.</value>
175175
</data>
176176
<data name="Grace_Description" xml:space="preserve">
177177
<value>Sponsoring projects you depend on ensures they remain active, and that you get the support you need. It's also super affordable and available worldwide!

src/SponsorLink/SponsorLink/SponsorLink.cs

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -165,82 +165,4 @@ public static bool TryRead([NotNullWhen(true)] out ClaimsPrincipal? principal, I
165165

166166
return principal != null;
167167
}
168-
169-
/// <summary>
170-
/// Validates the manifest signature and optional expiration.
171-
/// </summary>
172-
/// <param name="jwt">The JWT to validate.</param>
173-
/// <param name="jwk">The key to validate the manifest signature with.</param>
174-
/// <param name="token">Except when returning <see cref="Status.Unknown"/>, returns the security token read from the JWT, even if signature check failed.</param>
175-
/// <param name="identity">The associated claims, only when return value is not <see cref="Status.Unknown"/>.</param>
176-
/// <param name="requireExpiration">Whether to check for expiration.</param>
177-
/// <returns>The status of the validation.</returns>
178-
public static ManifestStatus Validate(string jwt, string jwk, out SecurityToken? token, out ClaimsIdentity? identity, bool validateExpiration)
179-
{
180-
token = default;
181-
identity = default;
182-
183-
SecurityKey key;
184-
try
185-
{
186-
key = JsonWebKey.Create(jwk);
187-
}
188-
catch (ArgumentException)
189-
{
190-
return ManifestStatus.Unknown;
191-
}
192-
193-
var handler = new JsonWebTokenHandler { MapInboundClaims = false };
194-
195-
if (!handler.CanReadToken(jwt))
196-
return ManifestStatus.Unknown;
197-
198-
var validation = new TokenValidationParameters
199-
{
200-
RequireExpirationTime = false,
201-
ValidateLifetime = false,
202-
ValidateAudience = false,
203-
ValidateIssuer = false,
204-
ValidateIssuerSigningKey = true,
205-
IssuerSigningKey = key,
206-
RoleClaimType = "roles",
207-
NameClaimType = "sub",
208-
};
209-
210-
var result = handler.ValidateTokenAsync(jwt, validation).Result;
211-
if (result.Exception != null)
212-
{
213-
if (result.Exception is SecurityTokenInvalidSignatureException)
214-
{
215-
var jwtToken = handler.ReadJsonWebToken(jwt);
216-
token = jwtToken;
217-
identity = new ClaimsIdentity(jwtToken.Claims);
218-
return ManifestStatus.Invalid;
219-
}
220-
else
221-
{
222-
var jwtToken = handler.ReadJsonWebToken(jwt);
223-
token = jwtToken;
224-
identity = new ClaimsIdentity(jwtToken.Claims);
225-
return ManifestStatus.Invalid;
226-
}
227-
}
228-
229-
token = result.SecurityToken;
230-
identity = new ClaimsIdentity(result.ClaimsIdentity.Claims, "JWT");
231-
232-
if (validateExpiration && token.ValidTo == DateTime.MinValue)
233-
return ManifestStatus.Invalid;
234-
235-
// The sponsorable manifest does not have an expiration time.
236-
if (validateExpiration && token.ValidTo < DateTimeOffset.UtcNow)
237-
return ManifestStatus.Expired;
238-
239-
return ManifestStatus.Valid;
240-
}
241-
242-
class JwtRolesPrincipal(ClaimsIdentity identity) : ClaimsPrincipal([identity])
243-
{
244-
public override bool IsInRole(string role) => HasClaim("roles", role) || base.IsInRole(role);
245-
}
246168
}

0 commit comments

Comments
 (0)