Skip to content

Commit 828d88d

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 # devlooped/SponsorLink - Introduce standalone SponsorManifest for read/validate devlooped/SponsorLink@a755e4b - Improve wording on editor usage requiring sponsorship devlooped/SponsorLink@21d8dac
1 parent a8e0693 commit 828d88d

File tree

10 files changed

+256
-153
lines changed

10 files changed

+256
-153
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*"

.netconfig

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
weak
4141
[file ".github/dependabot.yml"]
4242
url = https://github.com/devlooped/oss/blob/main/.github/dependabot.yml
43-
sha = 49661dbf0720cde93eb5569be7523b5912351560
44-
etag = c147ea2f3431ca0338c315c4a45b56ee233c4d30f8d6ab698d0e1980a257fd6a
43+
sha = 917ff5486e25bec90038e7ab6d146fd82c61f846
44+
etag = 50bf50df5a6eeb1705baea50f4c6e06d167a89cb5a590887ff939bd4120bd442
4545
weak
4646
[file ".github/workflows/build.yml"]
4747
url = https://github.com/devlooped/oss/blob/main/.github/workflows/build.yml
@@ -206,28 +206,23 @@
206206

207207
etag = a5d79dbc0ed9fac4fb1879fb3790b9ebab18e47c14c454554ce9f53f21487bb5
208208
weak
209-
[file "src/SponsorLink/SponsorLink/ManifestStatus.cs"]
210-
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/ManifestStatus.cs
211-
sha = f47528874a6d9192b5546f84b455f5ccc474a707
212-
etag = e46848f83c0436ba33a1c09a4060ad627a74db41bab66bb37ca40fce8a6532a7
213-
weak
214209
[file "src/SponsorLink/SponsorLink/Resources.es.resx"]
215210
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/Resources.es.resx
216-
sha = 29921560c73bb91c2a21a21800daf0b250773598
211+
sha = 21d8dac3077c75cd07d7cc7f9e10f2620afce834
217212

218-
etag = feb9dc86e4d9c0c4a294cd6e03c5b914943e8d206b88a125abd1b0f882ddb247
213+
etag = 89a7bb797aeacca43e043196a00eea91f282df4caf9bbe937749026a03f707ad
219214
weak
220215
[file "src/SponsorLink/SponsorLink/Resources.resx"]
221216
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/Resources.resx
222-
sha = 29921560c73bb91c2a21a21800daf0b250773598
217+
sha = 21d8dac3077c75cd07d7cc7f9e10f2620afce834
223218

224-
etag = 7665a3be17cd224b1c413ade6a9c1c5a822dace1e7f9daae33a2e52d8bca15bb
219+
etag = 8902652b8907de2fbccf73f3738d0fce503fc667a084171d6b88bf3373e559e7
225220
weak
226221
[file "src/SponsorLink/SponsorLink/SponsorLink.cs"]
227222
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorLink.cs
228-
sha = 3f72a9fd35274a659dd380a7d5b747d71b9732a1
223+
sha = a755e4be0f7cb73cfde208857e28f7cfeba2dcc3
229224

230-
etag = 616598e0ecb6d2ce97660aa6ac049e2a31a1c953669743b7b612b61d40c37706
225+
etag = 402e2beb11cf64c07be3d0fc3e89115fd09fc24133c08a8951bf0e784909c510
231226
weak
232227
[file "src/SponsorLink/SponsorLink/SponsorLink.csproj"]
233228
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorLink.csproj
@@ -310,11 +305,6 @@
310305

311306
etag = 1875555adb7eab21acf1e730b6baeb8c095d9f6f9f07303a87ad9c16e0f6490d
312307
weak
313-
[file "src/SponsorLink/Tests/SponsorLinkTests.cs"]
314-
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Tests/SponsorLinkTests.cs
315-
sha = f47528874a6d9192b5546f84b455f5ccc474a707
316-
etag = 1fa41250bd984e8aa840a966d34ce0e94f2111d1422d7f50b864c38364fcf4a4
317-
weak
318308
[file "src/SponsorLink/Tests/SponsorableManifest.cs"]
319309
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Tests/SponsorableManifest.cs
320310
sha = f47528874a6d9192b5546f84b455f5ccc474a707
@@ -423,3 +413,18 @@
423413
sha = 032439dbf180fca0539a5bd3a019f18ab3484b76
424414
etag = da7c0104131bd474b52fc9bc9f9bda6470e24ae38d4fb9f5c4f719bc01370ab5
425415
weak
416+
[file ".github/actions/dotnet/action.yml"]
417+
url = https://github.com/devlooped/oss/blob/main/.github/actions/dotnet/action.yml
418+
sha = f2b690ce307acb76c5b8d7faec1a5b971a93653e
419+
etag = 27ea11baa2397b3ec9e643a935832da97719c4e44215cfd135c49cad4c29373f
420+
weak
421+
[file "src/SponsorLink/SponsorLink/SponsorManifest.cs"]
422+
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorManifest.cs
423+
sha = a755e4be0f7cb73cfde208857e28f7cfeba2dcc3
424+
etag = 55ef89e8441156541c1c74a50675b7f56633b56493031f0ffa877460839e3536
425+
weak
426+
[file "src/SponsorLink/Tests/SponsorManifestTests.cs"]
427+
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Tests/SponsorManifestTests.cs
428+
sha = a755e4be0f7cb73cfde208857e28f7cfeba2dcc3
429+
etag = 82ae1c417265f2e136544980b4f687a1cc2c1bfb24df93d354c259053550f4a3
430+
weak

readme.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,6 @@ The versioning scheme for packages is:
350350
[![David JENNI](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/davidjenni.png "David JENNI")](https://github.com/davidjenni)
351351
[![Jonathan ](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/Jonathan-Hickey.png "Jonathan ")](https://github.com/Jonathan-Hickey)
352352
[![Charley Wu](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/akunzai.png "Charley Wu")](https://github.com/akunzai)
353-
[![Jakob Tikjøb Andersen](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jakobt.png "Jakob Tikjøb Andersen")](https://github.com/jakobt)
354-
[![Tino Hager](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/tinohager.png "Tino Hager")](https://github.com/tinohager)
355353
[![Ken Bonny](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/KenBonny.png "Ken Bonny")](https://github.com/KenBonny)
356354
[![Simon Cropp](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/SimonCropp.png "Simon Cropp")](https://github.com/SimonCropp)
357355
[![agileworks-eu](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/agileworks-eu.png "agileworks-eu")](https://github.com/agileworks-eu)
@@ -363,7 +361,6 @@ The versioning scheme for packages is:
363361
[![Vincent Limo](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/v-limo.png "Vincent Limo")](https://github.com/v-limo)
364362
[![Jordan S. Jones](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jordansjones.png "Jordan S. Jones")](https://github.com/jordansjones)
365363
[![domischell](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/DominicSchell.png "domischell")](https://github.com/DominicSchell)
366-
[![Joseph Kingry](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jkingry.png "Joseph Kingry")](https://github.com/jkingry)
367364

368365

369366
<!-- sponsors.md -->

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)