Skip to content

Commit

Permalink
Ticket #670 : Fix some translation problems
Browse files Browse the repository at this point in the history
  • Loading branch information
thabart committed Feb 23, 2024
1 parent e251127 commit 93a61d2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>4.0.7</VersionPrefix>
<VersionPrefix>4.0.8</VersionPrefix>
<Authors>SimpleIdServer</Authors>
<Owners>SimpleIdServer</Owners>
</PropertyGroup>
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ deploy:
secure: kSru0/Mz8HMao/s+D3eNoTjOdwYRKMESn144kSw8tWrIKZGNCWDKL5Zh57ca9LwP
on:
branch: master
appveyor_repo_tag: true
- provider: GitHub
auth_token:
secure: FJAvb5bFQzM98phfQ2/dLL7I10Hvof/fdHorRLuDId8PyjAxcdkfWYf5fZ0/0g+e
artifact: /.*\.zip/
on:
branch: master
appveyor_repo_tag: true

Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
@((MarkupString)(@Global.SelectProofOfPossessionHelper))
</p>
</div>
@if (highlySecuredWebsiteApplication.ProofOfPossession == MTLs.Name)
@if (highlySecuredWebsiteApplication.ProofOfPossession == MtlsName)
{
<RadzenAlert AlertStyle="AlertStyle.Info" ShowIcon="false" Variant="Variant.Flat" AllowClose="false" Shade="Shade.Lighter">
@((MarkupString)(@Global.SelectMtlsProofOfPossessionHelper))
Expand All @@ -297,7 +297,7 @@
</p>
</div>
}
else if (highlySecuredWebsiteApplication.ProofOfPossession == DPoP.Name)
else if (highlySecuredWebsiteApplication.ProofOfPossession == DpopName)
{
<RadzenAlert AlertStyle="AlertStyle.Info" ShowIcon="false" Variant="Variant.Flat" AllowClose="false" Shade="Shade.Lighter">
@((MarkupString)(@Global.SelectDpopProofOfPossessionHelper))
Expand Down Expand Up @@ -352,7 +352,7 @@
@((MarkupString)(@Global.SelectProofOfPossessionHelper))
</p>
</div>
@if (highlySecuredWebApplicationWithGrantMgtSupport.ProofOfPossession == MTLs.Name)
@if (highlySecuredWebApplicationWithGrantMgtSupport.ProofOfPossession == MtlsName)
{
<RadzenAlert AlertStyle="AlertStyle.Info" ShowIcon="false" Variant="Variant.Flat" AllowClose="false" Shade="Shade.Lighter">
@((MarkupString)(@Global.SelectMtlsProofOfPossessionHelper))
Expand All @@ -365,7 +365,7 @@
</p>
</div>
}
else if (highlySecuredWebApplicationWithGrantMgtSupport.ProofOfPossession == DPoP.Name)
else if (highlySecuredWebApplicationWithGrantMgtSupport.ProofOfPossession == DpopName)
{
<RadzenAlert AlertStyle="AlertStyle.Info" ShowIcon="false" Variant="Variant.Flat" AllowClose="false" Shade="Shade.Lighter">
@((MarkupString)(@Global.SelectDpopProofOfPossessionHelper))
Expand Down Expand Up @@ -441,8 +441,8 @@
</RadzenSteps>

@code {
static ProofOfPossession DPoP = new ProofOfPossession { Name = "DPoP", Description = "DPoP" };
static ProofOfPossession MTLs = new ProofOfPossession { Name = "MTLS", Description = Global.Mtls };
static string DpopName = "DPoP";
static string MtlsName = "MTLS";

record ApplicationType
{
Expand Down Expand Up @@ -476,7 +476,7 @@
public string ClientSecret { get; set; } = null!;
public string RedirectionUris { get; set; } = null!;
public string SubjectName { get; set; } = null!;
public string ProofOfPossession { get; set; } = MTLs.Name;
public string ProofOfPossession { get; set; } = MtlsName;
}

record HighlySecuredWebApplicationWithGrantMgtSupport
Expand All @@ -486,7 +486,7 @@
public string ClientSecret { get; set; } = null!;
public string RedirectionUris { get; set; } = null!;
public string SubjectName { get; set; } = null!;
public string ProofOfPossession { get; set; } = MTLs.Name;
public string ProofOfPossession { get; set; } = MtlsName;
public string? AuthDataTypes { get; set; } = null;
}

Expand Down Expand Up @@ -565,8 +565,8 @@
CredentialIssuerApplication credentialIssuerApplication = new CredentialIssuerApplication();
ICollection<ProofOfPossession> ProofOfPossessions { get; set; } = new List<ProofOfPossession>
{
DPoP,
MTLs
new ProofOfPossession { Name = DpopName, Description = "DPoP" },
new ProofOfPossession { Name = MtlsName, Description = Global.Mtls }
};
enum ClientTemplateTypes
{
Expand Down Expand Up @@ -657,12 +657,12 @@

void AddHighlySecuredWebsiteApplication(HighlySecuredWebApplication websiteApplication)
{
dispatcher.Dispatch(new AddHighlySecuredWebsiteApplicationAction { ClientId = websiteApplication.ClientIdentifier, ClientName = websiteApplication.ClientName, ClientSecret = websiteApplication.ClientSecret, IsDPoP = websiteApplication.ProofOfPossession == DPoP.Name, RedirectionUrls = websiteApplication.RedirectionUris.Split(';'), SubjectName = websiteApplication.SubjectName });
dispatcher.Dispatch(new AddHighlySecuredWebsiteApplicationAction { ClientId = websiteApplication.ClientIdentifier, ClientName = websiteApplication.ClientName, ClientSecret = websiteApplication.ClientSecret, IsDPoP = websiteApplication.ProofOfPossession == DpopName, RedirectionUrls = websiteApplication.RedirectionUris.Split(';'), SubjectName = websiteApplication.SubjectName });
}

void AddHighlySecuredWebsiteApplicationWithGrantMgtSupport(HighlySecuredWebApplicationWithGrantMgtSupport websiteApplication)
{
dispatcher.Dispatch(new AddHighlySecuredWebsiteApplicationWithGrantMgtSupportAction { ClientId = websiteApplication.ClientIdentifier, ClientName = websiteApplication.ClientName, ClientSecret = websiteApplication.ClientSecret, IsDPoP = websiteApplication.ProofOfPossession == DPoP.Name, RedirectionUrls = websiteApplication.RedirectionUris.Split(';'), SubjectName = websiteApplication.SubjectName, AuthDataTypes = websiteApplication.AuthDataTypes });
dispatcher.Dispatch(new AddHighlySecuredWebsiteApplicationWithGrantMgtSupportAction { ClientId = websiteApplication.ClientIdentifier, ClientName = websiteApplication.ClientName, ClientSecret = websiteApplication.ClientSecret, IsDPoP = websiteApplication.ProofOfPossession == DpopName, RedirectionUrls = websiteApplication.RedirectionUris.Split(';'), SubjectName = websiteApplication.SubjectName, AuthDataTypes = websiteApplication.AuthDataTypes });
}

void AddMobileApplication(MobileApplication mobileApplication)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using SimpleIdServer.IdServer.Saml.Idp.Extensions;
using SimpleIdServer.IdServer.Store;
using SimpleIdServer.IdServer.WsFederation;
using System.Globalization;
using System.IdentityModel.Tokens.Jwt;
using System.Linq.Dynamic.Core;
using System.Text;
Expand Down Expand Up @@ -80,7 +81,7 @@ public async Task Handle(AddSpaClientAction action, IDispatcher dispatcher)
var newClientBuilder = ClientBuilder.BuildUserAgentClient(action.ClientId, Guid.NewGuid().ToString(), null, action.RedirectionUrls.ToArray())
.AddScope(new Domains.Scope { Name = Constants.StandardScopes.OpenIdScope.Name }, new Domains.Scope { Name = Constants.StandardScopes.Profile.Name });
if (!string.IsNullOrWhiteSpace(action.ClientName))
newClientBuilder.SetClientName(action.ClientName);
newClientBuilder.SetClientName(action.ClientName, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
var newClient = newClientBuilder.Build();
await CreateClient(newClient, dispatcher, ClientTypes.SPA);
}
Expand All @@ -90,7 +91,7 @@ public async Task Handle(AddMachineClientApplicationAction action, IDispatcher d
{
var newClientBuilder = ClientBuilder.BuildApiClient(action.ClientId, action.ClientSecret, null);
if (!string.IsNullOrWhiteSpace(action.ClientName))
newClientBuilder.SetClientName(action.ClientName);
newClientBuilder.SetClientName(action.ClientName, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
var newClient = newClientBuilder.Build();
await CreateClient(newClient, dispatcher, ClientTypes.MACHINE);
}
Expand All @@ -101,7 +102,7 @@ public async Task Handle(AddWebsiteApplicationAction action, IDispatcher dispatc
var newClientBuilder = ClientBuilder.BuildTraditionalWebsiteClient(action.ClientId, action.ClientSecret, null, action.RedirectionUrls.ToArray())
.AddScope(new Domains.Scope { Name = Constants.StandardScopes.OpenIdScope.Name }, new Domains.Scope { Name = Constants.StandardScopes.Profile.Name });
if (!string.IsNullOrWhiteSpace(action.ClientName))
newClientBuilder.SetClientName(action.ClientName);
newClientBuilder.SetClientName(action.ClientName, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
var newClient = newClientBuilder.Build();
await CreateClient(newClient, dispatcher, ClientTypes.WEBSITE);
}
Expand All @@ -112,7 +113,7 @@ public async Task Handle(AddHighlySecuredWebsiteApplicationAction action, IDispa
var newClientBuilder = ClientBuilder.BuildTraditionalWebsiteClient(action.ClientId, action.ClientSecret, null, action.RedirectionUrls.ToArray())
.AddScope(new Domains.Scope { Name = Constants.StandardScopes.OpenIdScope.Name }, new Domains.Scope { Name = Constants.StandardScopes.Profile.Name });
if (!string.IsNullOrWhiteSpace(action.ClientName))
newClientBuilder.SetClientName(action.ClientName);
newClientBuilder.SetClientName(action.ClientName, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);

// FAPI2.0
newClientBuilder.SetSigAuthorizationResponse(SecurityAlgorithms.EcdsaSha256);
Expand Down Expand Up @@ -141,7 +142,7 @@ public async Task Handle(AddHighlySecuredWebsiteApplicationWithGrantMgtSupportAc
var newClientBuilder = ClientBuilder.BuildTraditionalWebsiteClient(action.ClientId, action.ClientSecret, null, action.RedirectionUrls.ToArray())
.AddScope(new Domains.Scope { Name = Constants.StandardScopes.OpenIdScope.Name }, new Domains.Scope { Name = Constants.StandardScopes.Profile.Name });
if (!string.IsNullOrWhiteSpace(action.ClientName))
newClientBuilder.SetClientName(action.ClientName);
newClientBuilder.SetClientName(action.ClientName, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);

// FAPI2.0
newClientBuilder.SetSigAuthorizationResponse(SecurityAlgorithms.EcdsaSha256);
Expand Down Expand Up @@ -176,7 +177,7 @@ public async Task Handle(AddMobileApplicationAction action, IDispatcher dispatch
var newClientBuilder = ClientBuilder.BuildMobileApplication(action.ClientId, Guid.NewGuid().ToString(), null, action.RedirectionUrls.ToArray())
.AddScope(new Domains.Scope { Name = Constants.StandardScopes.OpenIdScope.Name }, new Domains.Scope { Name = Constants.StandardScopes.Profile.Name });
if (!string.IsNullOrWhiteSpace(action.ClientName))
newClientBuilder.SetClientName(action.ClientName);
newClientBuilder.SetClientName(action.ClientName, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
var newClient = newClientBuilder.Build();
await CreateClient(newClient, dispatcher, ClientTypes.MOBILE);
}
Expand All @@ -187,7 +188,7 @@ public async Task Handle(AddExternalDeviceApplicationAction action, IDispatcher
var newClientBuilder = ClientBuilder.BuildExternalAuthDeviceClient(action.ClientId, action.SubjectName, null)
.AddScope(new Domains.Scope { Name = Constants.StandardScopes.OpenIdScope.Name }, new Domains.Scope { Name = Constants.StandardScopes.Profile.Name });
if (!string.IsNullOrWhiteSpace(action.ClientName))
newClientBuilder.SetClientName(action.ClientName);
newClientBuilder.SetClientName(action.ClientName, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
var newClient = newClientBuilder.Build();
await CreateClient(newClient, dispatcher, ClientTypes.EXTERNAL);
}
Expand All @@ -198,7 +199,7 @@ public async Task Handle(AddDeviceApplicationAction action, IDispatcher dispatch
var newClientBuilder = ClientBuilder.BuildDeviceClient(action.ClientId, action.ClientSecret, null)
.AddScope(new Domains.Scope { Name = Constants.StandardScopes.OpenIdScope.Name }, new Domains.Scope { Name = Constants.StandardScopes.Profile.Name });
if (!string.IsNullOrWhiteSpace(action.ClientName))
newClientBuilder.SetClientName(action.ClientName);
newClientBuilder.SetClientName(action.ClientName, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
var newClient = newClientBuilder.Build();
await CreateClient(newClient, dispatcher, ClientTypes.DEVICE);
}
Expand All @@ -209,7 +210,7 @@ public async Task Handle(AddCredentialIssuerApplicationAction action, IDispatche
var newClientBuilder = ClientBuilder.BuildCredentialIssuer(action.ClientId, action.ClientSecret, null, action.RedirectionUrls.ToArray())
.AddScope(new Domains.Scope { Name = Constants.StandardScopes.OpenIdScope.Name }, new Domains.Scope { Name = Constants.StandardScopes.Profile.Name });
if (!string.IsNullOrWhiteSpace(action.ClientName))
newClientBuilder.SetClientName(action.ClientName);
newClientBuilder.SetClientName(action.ClientName, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
var newClient = newClientBuilder.Build();
await CreateClient(newClient, dispatcher, ClientTypes.CREDENTIAL_ISSUER);
}
Expand All @@ -219,7 +220,7 @@ public async Task Handle(AddWsFederationApplicationAction action, IDispatcher di
{
var newClientBuilder = WsClientBuilder.BuildWsFederationClient(action.ClientId, null);
if (!string.IsNullOrWhiteSpace(action.ClientName))
newClientBuilder.SetClientName(action.ClientName);
newClientBuilder.SetClientName(action.ClientName, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
var newClient = newClientBuilder.Build();
await CreateClient(newClient, dispatcher, WsFederationConstants.CLIENT_TYPE);
}
Expand All @@ -231,7 +232,7 @@ public async Task Handle(AddSamlSpApplicationAction action, IDispatcher dispatch
var securityKey = new X509SecurityKey(certificate, Guid.NewGuid().ToString());
var newClientBuilder = SamlSpClientBuilder.BuildSamlSpClient(action.ClientIdentifier, action.MetadataUrl, certificate, null);
if (!string.IsNullOrWhiteSpace(action.ClientName))
newClientBuilder.SetClientName(action.ClientName);
newClientBuilder.SetClientName(action.ClientName, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
newClientBuilder.SetUseAcsArtifact(action.UseAcs);
var newClient = newClientBuilder.Build();
var pemResult = PemConverter.ConvertFromSecurityKey(securityKey);
Expand Down

0 comments on commit 93a61d2

Please sign in to comment.