Browse Source

Constant for frontend client.

pull/381/head
Sebastian Stehle 7 years ago
parent
commit
eb750f21f2
  1. 3
      src/Squidex.Domain.Apps.Entities/Context.cs
  2. 14
      src/Squidex.Shared/DefaultClients.cs
  3. 3
      src/Squidex.Web/Constants.cs
  4. 2
      src/Squidex/appsettings.json
  5. 2
      tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentQueryServiceTests.cs

3
src/Squidex.Domain.Apps.Entities/Context.cs

@ -9,6 +9,7 @@ using System.Collections.Generic;
using System.Security.Claims; using System.Security.Claims;
using Squidex.Domain.Apps.Entities.Apps; using Squidex.Domain.Apps.Entities.Apps;
using Squidex.Infrastructure.Security; using Squidex.Infrastructure.Security;
using Squidex.Shared;
using Squidex.Shared.Identity; using Squidex.Shared.Identity;
namespace Squidex.Domain.Apps.Entities namespace Squidex.Domain.Apps.Entities
@ -39,7 +40,7 @@ namespace Squidex.Domain.Apps.Entities
public bool IsFrontendClient public bool IsFrontendClient
{ {
get { return User != null && User.IsInClient("squidex-frontend"); } get { return User != null && User.IsInClient(DefaultClients.Frontend); }
} }
} }
} }

14
src/Squidex.Shared/DefaultClients.cs

@ -0,0 +1,14 @@
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschraenkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
namespace Squidex.Shared
{
public static class DefaultClients
{
public const string Frontend = "squidex-frontend";
}
}

3
src/Squidex.Web/Constants.cs

@ -6,6 +6,7 @@
// ========================================================================== // ==========================================================================
using Squidex.Infrastructure; using Squidex.Infrastructure;
using Squidex.Shared;
namespace Squidex.Web namespace Squidex.Web
{ {
@ -31,7 +32,7 @@ namespace Squidex.Web
public static readonly string ProfileScope = "squidex-profile"; public static readonly string ProfileScope = "squidex-profile";
public static readonly string FrontendClient = "squidex-frontend"; public static readonly string FrontendClient = DefaultClients.Frontend;
public static readonly string InternalClientId = "squidex-internal"; public static readonly string InternalClientId = "squidex-internal";

2
src/Squidex/appsettings.json

@ -497,7 +497,7 @@
}, },
/*" /*"
* A list of configuration valeus that should be exposed from the info endpoint and in the UI. * A list of configuration values that should be exposed from the info endpoint and in the UI.
*/ */
"exposedConfiguration": { "exposedConfiguration": {
"version": "squidex:version" "version": "squidex:version"

2
tests/Squidex.Domain.Apps.Entities.Tests/Contents/ContentQueryServiceTests.cs

@ -465,7 +465,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
{ {
if (isFrontend) if (isFrontend)
{ {
identity.AddClaim(new Claim(OpenIdClaims.ClientId, "squidex-frontend")); identity.AddClaim(new Claim(OpenIdClaims.ClientId, DefaultClients.Frontend));
} }
if (allowSchema) if (allowSchema)

Loading…
Cancel
Save