Skip to content

Commit ac8ecdb

Browse files
committed
⬆️ Bump files with dotnet-file sync
# devlooped/SponsorLink - Introduce standalone SponsorManifest for read/validate devlooped/SponsorLink@a755e4b - Improve wording on editor usage requiring sponsorship devlooped/SponsorLink@21d8dac - Bump Microsoft.IdentityModel.JsonWebTokens in the identity group devlooped/SponsorLink@d641245 # devlooped/oss - Group Spectre.Console updates devlooped/oss@917ff54 - Fix improper first / in gh api repos devlooped/oss@f2b690c - Add explicit write permissions from caller workflow devlooped/oss@8fa147d
1 parent 752b34b commit ac8ecdb

File tree

14 files changed

+275
-167
lines changed

14 files changed

+275
-167
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/dotnet-file.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ env:
1212

1313
jobs:
1414
run:
15+
permissions:
16+
contents: write
1517
uses: devlooped/oss/.github/workflows/dotnet-file-core.yml@main
16-
secrets: inherit
18+
secrets:
19+
BOT_NAME: ${{ secrets.BOT_NAME }}
20+
BOT_EMAIL: ${{ secrets.BOT_EMAIL }}
21+
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.netconfig

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
weak
5353
[file ".github/dependabot.yml"]
5454
url = https://github.com/devlooped/oss/blob/main/.github/dependabot.yml
55-
sha = 49661dbf0720cde93eb5569be7523b5912351560
56-
etag = c147ea2f3431ca0338c315c4a45b56ee233c4d30f8d6ab698d0e1980a257fd6a
55+
sha = 917ff5486e25bec90038e7ab6d146fd82c61f846
56+
etag = 50bf50df5a6eeb1705baea50f4c6e06d167a89cb5a590887ff939bd4120bd442
5757
weak
5858
[file ".github/workflows/build.yml"]
5959
url = https://github.com/devlooped/oss/blob/main/.github/workflows/build.yml
@@ -65,8 +65,8 @@
6565
weak
6666
[file ".github/workflows/dotnet-file.yml"]
6767
url = https://github.com/devlooped/oss/blob/main/.github/workflows/dotnet-file.yml
68-
sha = 59aaf432369b5ea597831d4feec5a6ac4024c2e3
69-
etag = 1374e3f8c9b7af69c443605c03f7262300dcb7d783738d9eb9fe84268ed2d10c
68+
sha = 8fa147d4799d73819040736c399d0b1db2c2d86c
69+
etag = 1ca805a23656e99c03f9d478dba8ccef6e571f5de2ac0e9bb7e3c5216c99a694
7070
weak
7171
[file ".github/workflows/publish.yml"]
7272
url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml
@@ -798,8 +798,8 @@
798798
weak
799799
[file "src/SponsorLink/SponsorLink.Analyzer.targets"]
800800
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink.Analyzer.targets
801-
sha = 1454a8f481610a6cf33adfc6082a19421bbed43c
802-
etag = 0b4028f3cbc6463257b741106186689bdc7d1b20af5d1d0075e81e6d4fbe8d7b
801+
sha = d641245c71b6d9355129d8e66d752f71b10ce871
802+
etag = f732b7eaadddbc858728ca1858a05897d69378e3850e5de589e25497c901efbb
803803
weak
804804
[file "src/SponsorLink/SponsorLink/AnalyzerOptionsExtensions.cs"]
805805
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/AnalyzerOptionsExtensions.cs
@@ -816,35 +816,30 @@
816816
sha = 29921560c73bb91c2a21a21800daf0b250773598
817817
etag = a5d79dbc0ed9fac4fb1879fb3790b9ebab18e47c14c454554ce9f53f21487bb5
818818
weak
819-
[file "src/SponsorLink/SponsorLink/ManifestStatus.cs"]
820-
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/ManifestStatus.cs
821-
sha = f47528874a6d9192b5546f84b455f5ccc474a707
822-
etag = e46848f83c0436ba33a1c09a4060ad627a74db41bab66bb37ca40fce8a6532a7
823-
weak
824819
[file "src/SponsorLink/SponsorLink/Resources.es-AR.resx"]
825820
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/Resources.es-AR.resx
826821
sha = 586398c3e650495f36601ecc8983a14ed745e058
827822
etag = 1d6ca61601815a20581fc13f9efdad151ee0e5cf952318723265d5c183d3e1cc
828823
weak
829824
[file "src/SponsorLink/SponsorLink/Resources.es.resx"]
830825
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/Resources.es.resx
831-
sha = 29921560c73bb91c2a21a21800daf0b250773598
832-
etag = feb9dc86e4d9c0c4a294cd6e03c5b914943e8d206b88a125abd1b0f882ddb247
826+
sha = 21d8dac3077c75cd07d7cc7f9e10f2620afce834
827+
etag = 89a7bb797aeacca43e043196a00eea91f282df4caf9bbe937749026a03f707ad
833828
weak
834829
[file "src/SponsorLink/SponsorLink/Resources.resx"]
835830
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/Resources.resx
836-
sha = 29921560c73bb91c2a21a21800daf0b250773598
837-
etag = 7665a3be17cd224b1c413ade6a9c1c5a822dace1e7f9daae33a2e52d8bca15bb
831+
sha = 21d8dac3077c75cd07d7cc7f9e10f2620afce834
832+
etag = 8902652b8907de2fbccf73f3738d0fce503fc667a084171d6b88bf3373e559e7
838833
weak
839834
[file "src/SponsorLink/SponsorLink/SponsorLink.cs"]
840835
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorLink.cs
841-
sha = 3f72a9fd35274a659dd380a7d5b747d71b9732a1
842-
etag = 616598e0ecb6d2ce97660aa6ac049e2a31a1c953669743b7b612b61d40c37706
836+
sha = a755e4be0f7cb73cfde208857e28f7cfeba2dcc3
837+
etag = 402e2beb11cf64c07be3d0fc3e89115fd09fc24133c08a8951bf0e784909c510
843838
weak
844839
[file "src/SponsorLink/SponsorLink/SponsorLink.csproj"]
845840
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorLink.csproj
846-
sha = 2de6c983fd620ac8a268327c247f1ba4351ba29a
847-
etag = 0d1ba307ebf2ffa53af749afc408c738566cf1a334eb7df16dc64cb243f6233d
841+
sha = d641245c71b6d9355129d8e66d752f71b10ce871
842+
etag = 69899ef30a11b1eb6164c3067baea72ee9b284147cc4127d0ae5fc0f16b0fa22
848843
weak
849844
[file "src/SponsorLink/SponsorLink/SponsorLinkAnalyzer.cs"]
850845
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorLinkAnalyzer.cs
@@ -916,21 +911,16 @@
916911
sha = ca82a9d6298a933192c5dfd2c5881ebadb85d0fe
917912
etag = 1875555adb7eab21acf1e730b6baeb8c095d9f6f9f07303a87ad9c16e0f6490d
918913
weak
919-
[file "src/SponsorLink/Tests/SponsorLinkTests.cs"]
920-
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Tests/SponsorLinkTests.cs
921-
sha = f47528874a6d9192b5546f84b455f5ccc474a707
922-
etag = 1fa41250bd984e8aa840a966d34ce0e94f2111d1422d7f50b864c38364fcf4a4
923-
weak
924914
[file "src/SponsorLink/Tests/SponsorableManifest.cs"]
925915
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Tests/SponsorableManifest.cs
926916
sha = f47528874a6d9192b5546f84b455f5ccc474a707
927917
etag = eb2292c6d7bf53a56acbb73d7c89ccc78fd8bec2e2198d70e36da93c01d36374
928918
weak
929919
[file "src/SponsorLink/Tests/Tests.csproj"]
930920
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Tests/Tests.csproj
931-
sha = 2de6c983fd620ac8a268327c247f1ba4351ba29a
921+
sha = d641245c71b6d9355129d8e66d752f71b10ce871
932922

933-
etag = 3fc99ed4d45124df055e60a0b89aedc46286c973c05859a5cada0daa0457efbd
923+
etag = c5e4259082e3c2094f089dcaa6bc2429c241c414ac4bce644793fb8ed129eeeb
934924
weak
935925
[file "src/SponsorLink/Tests/keys/kzu.key"]
936926
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Tests/keys/kzu.key
@@ -992,3 +982,18 @@
992982

993983
etag = 2e3ec899bfd58e206cf4f98ab6b2fa65723ed449c4b9cfb9ec34a029a9664be4
994984
weak
985+
[file "src/SponsorLink/SponsorLink/SponsorManifest.cs"]
986+
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorManifest.cs
987+
sha = a755e4be0f7cb73cfde208857e28f7cfeba2dcc3
988+
etag = 55ef89e8441156541c1c74a50675b7f56633b56493031f0ffa877460839e3536
989+
weak
990+
[file "src/SponsorLink/Tests/SponsorManifestTests.cs"]
991+
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Tests/SponsorManifestTests.cs
992+
sha = a755e4be0f7cb73cfde208857e28f7cfeba2dcc3
993+
etag = 82ae1c417265f2e136544980b4f687a1cc2c1bfb24df93d354c259053550f4a3
994+
weak
995+
[file ".github/actions/dotnet/action.yml"]
996+
url = https://github.com/devlooped/oss/blob/main/.github/actions/dotnet/action.yml
997+
sha = f2b690ce307acb76c5b8d7faec1a5b971a93653e
998+
etag = 27ea11baa2397b3ec9e643a935832da97719c4e44215cfd135c49cad4c29373f
999+
weak

readme.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,9 @@ To create a new release:
7979
[![Jacob Foshee](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jfoshee.png "Jacob Foshee")](https://github.com/jfoshee)
8080
[![](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/Mrxx99.png "")](https://github.com/Mrxx99)
8181
[![Eric Johnson](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/eajhnsn1.png "Eric Johnson")](https://github.com/eajhnsn1)
82-
[![Ix Technologies B.V.](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/IxTechnologies.png "Ix Technologies B.V.")](https://github.com/IxTechnologies)
8382
[![David JENNI](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/davidjenni.png "David JENNI")](https://github.com/davidjenni)
8483
[![Jonathan ](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/Jonathan-Hickey.png "Jonathan ")](https://github.com/Jonathan-Hickey)
8584
[![Charley Wu](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/akunzai.png "Charley Wu")](https://github.com/akunzai)
86-
[![Jakob Tikjøb Andersen](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jakobt.png "Jakob Tikjøb Andersen")](https://github.com/jakobt)
87-
[![Tino Hager](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/tinohager.png "Tino Hager")](https://github.com/tinohager)
8885
[![Ken Bonny](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/KenBonny.png "Ken Bonny")](https://github.com/KenBonny)
8986
[![Simon Cropp](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/SimonCropp.png "Simon Cropp")](https://github.com/SimonCropp)
9087
[![agileworks-eu](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/agileworks-eu.png "agileworks-eu")](https://github.com/agileworks-eu)
@@ -96,7 +93,7 @@ To create a new release:
9693
[![Vincent Limo](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/v-limo.png "Vincent Limo")](https://github.com/v-limo)
9794
[![Jordan S. Jones](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jordansjones.png "Jordan S. Jones")](https://github.com/jordansjones)
9895
[![domischell](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/DominicSchell.png "domischell")](https://github.com/DominicSchell)
99-
[![Joseph Kingry](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jkingry.png "Joseph Kingry")](https://github.com/jkingry)
96+
[![Mauricio Scheffer](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/mausch.png "Mauricio Scheffer")](https://github.com/mausch)
10097

10198

10299
<!-- sponsors.md -->

src/SponsorLink/SponsorLink.Analyzer.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@
8484
<ItemGroup Condition="'$(ManagePackageVersionsCentrally)' == 'true'">
8585
<PackageReference Include="Humanizer.Core" VersionOverride="2.14.1" PrivateAssets="all" Pack="$(PackMergedAssemblies)" />
8686
<PackageReference Include="Humanizer.Core.es" VersionOverride="2.14.1" PrivateAssets="all" />
87-
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" VersionOverride="8.5.0" PrivateAssets="all" Pack="$(PackMergedAssemblies)" />
87+
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" VersionOverride="8.8.0" PrivateAssets="all" Pack="$(PackMergedAssemblies)" />
8888
<PackageReference Include="ILRepack" Version="2.0.37" VersionOverride="all" PrivateAssets="all" Pack="false" />
8989
</ItemGroup>
9090

9191
<ItemGroup Condition="'$(ManagePackageVersionsCentrally)' != 'true'">
9292
<PackageReference Include="Humanizer.Core" Version="2.14.1" PrivateAssets="all" Pack="$(PackMergedAssemblies)" />
9393
<PackageReference Include="Humanizer.Core.es" Version="2.14.1" PrivateAssets="all" />
94-
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.5.0" PrivateAssets="all" Pack="$(PackMergedAssemblies)" />
94+
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.8.0" PrivateAssets="all" Pack="$(PackMergedAssemblies)" />
9595
<PackageReference Include="ILRepack" Version="2.0.37" PrivateAssets="all" Pack="false" />
9696
</ItemGroup>
9797

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
}

src/SponsorLink/SponsorLink/SponsorLink.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<PackageReference Include="NuGetizer" Version="1.2.4" />
2929
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" Pack="false" />
3030
<PackageReference Include="PolySharp" Version="1.15.0" PrivateAssets="all" />
31-
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.5.0" PrivateAssets="all" />
31+
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.8.0" PrivateAssets="all" />
3232
</ItemGroup>
3333

3434
<ItemGroup>

0 commit comments

Comments
 (0)