Browse Source

NSwag upgraded

pull/1/head
Sebastian 9 years ago
parent
commit
b73a1aac1d
  1. 5
      .nuget/nuget.config
  2. 4
      src/Squidex.Core/project.json
  3. 2
      src/Squidex.Events/project.json
  4. 2
      src/Squidex.Infrastructure/project.json
  5. 2
      src/Squidex.Read/project.json
  6. 2
      src/Squidex.Store.MongoDb/project.json
  7. 2
      src/Squidex.Write/project.json
  8. 41
      src/Squidex/Config/Identity/IdentityServices.cs
  9. 4
      src/Squidex/Config/Identity/IdentityUsage.cs
  10. 5
      src/Squidex/Config/Identity/LazyClientStore.cs
  11. 2
      src/Squidex/Controllers/Api/Schemas/Models/Fields/NumberField.cs
  12. 2
      src/Squidex/Controllers/Api/Schemas/Models/Fields/StringField.cs
  13. 2
      src/Squidex/project.json
  14. 12
      tests/Squidex.Infrastructure.Tests/TypeNameAttributeTest.cs

5
.nuget/nuget.config

@ -1,5 +0,0 @@
<configuration>
<packageSources>
<add key="Qooroo" value="https://www.myget.org/F/qooroo/api/v2" />
</packageSources>
</configuration>

4
src/Squidex.Core/project.json

@ -1,9 +1,9 @@
{ {
"dependencies": { "dependencies": {
"NETStandard.Library": "1.6.0",
"NodaTime": "2.0.0-alpha20160729", "NodaTime": "2.0.0-alpha20160729",
"Squidex.Infrastructure": "1.0.0-*", "Squidex.Infrastructure": "1.0.0-*",
"protobuf-net": "2.1.0" "protobuf-net": "2.1.0",
"NETStandard.Library": "1.6.1"
}, },
"frameworks": { "frameworks": {
"netcoreapp1.0": { "netcoreapp1.0": {

2
src/Squidex.Events/project.json

@ -2,7 +2,7 @@
"version": "1.0.0-*", "version": "1.0.0-*",
"dependencies": { "dependencies": {
"NETStandard.Library": "1.6.0", "NETStandard.Library": "1.6.1",
"NodaTime": "2.0.0-alpha20160729", "NodaTime": "2.0.0-alpha20160729",
"Squidex.Core": "1.0.0-*", "Squidex.Core": "1.0.0-*",
"Squidex.Infrastructure": "1.0.0-*" "Squidex.Infrastructure": "1.0.0-*"

2
src/Squidex.Infrastructure/project.json

@ -4,7 +4,7 @@
"Autofac": "4.2.1", "Autofac": "4.2.1",
"EventStore.ClientAPI.NetCore": "0.0.1-alpha", "EventStore.ClientAPI.NetCore": "0.0.1-alpha",
"Microsoft.Extensions.Logging": "1.1.0", "Microsoft.Extensions.Logging": "1.1.0",
"NETStandard.Library": "1.6.0", "NETStandard.Library": "1.6.1",
"Newtonsoft.Json": "9.0.2-beta1", "Newtonsoft.Json": "9.0.2-beta1",
"NodaTime": "2.0.0-alpha20160729", "NodaTime": "2.0.0-alpha20160729",
"protobuf-net": "2.1.0", "protobuf-net": "2.1.0",

2
src/Squidex.Read/project.json

@ -4,7 +4,7 @@
"dependencies": { "dependencies": {
"Microsoft.Extensions.Caching.Memory": "1.1.0", "Microsoft.Extensions.Caching.Memory": "1.1.0",
"MongoDB.Driver": "2.4.0", "MongoDB.Driver": "2.4.0",
"NETStandard.Library": "1.6.0", "NETStandard.Library": "1.6.1",
"NodaTime": "2.0.0-alpha20160729", "NodaTime": "2.0.0-alpha20160729",
"Squidex.Core": "1.0.0-*", "Squidex.Core": "1.0.0-*",
"Squidex.Events": "1.0.0-*", "Squidex.Events": "1.0.0-*",

2
src/Squidex.Store.MongoDb/project.json

@ -5,7 +5,7 @@
"Microsoft.AspNetCore.Identity": "1.1.0", "Microsoft.AspNetCore.Identity": "1.1.0",
"Microsoft.AspNetCore.Identity.MongoDB": "1.0.2", "Microsoft.AspNetCore.Identity.MongoDB": "1.0.2",
"MongoDB.Driver": "2.4.0", "MongoDB.Driver": "2.4.0",
"NETStandard.Library": "1.6.0", "NETStandard.Library": "1.6.1",
"Squidex.Core": "1.0.0-*", "Squidex.Core": "1.0.0-*",
"Squidex.Events": "1.0.0-*", "Squidex.Events": "1.0.0-*",
"Squidex.Infrastructure": "1.0.0-*", "Squidex.Infrastructure": "1.0.0-*",

2
src/Squidex.Write/project.json

@ -3,7 +3,7 @@
"dependencies": { "dependencies": {
"Microsoft.AspNetCore.Identity": "1.1.0", "Microsoft.AspNetCore.Identity": "1.1.0",
"NETStandard.Library": "1.6.0", "NETStandard.Library": "1.6.1",
"NodaTime": "2.0.0-alpha20160729", "NodaTime": "2.0.0-alpha20160729",
"Squidex.Core": "1.0.0-*", "Squidex.Core": "1.0.0-*",
"Squidex.Events": "1.0.0-*", "Squidex.Events": "1.0.0-*",

41
src/Squidex/Config/Identity/IdentityServices.cs

@ -40,17 +40,21 @@ namespace Squidex.Config.Identity
} }
services.AddSingleton( services.AddSingleton(
GetScopes()); GetApiResources());
services.AddSingleton(
GetIdentityResources());
services.AddSingleton<IClientStore, services.AddSingleton<IClientStore,
LazyClientStore>(); LazyClientStore>();
services.AddSingleton<IScopeStore, services.AddSingleton<IResourceStore,
InMemoryScopeStore>(); InMemoryResourcesStore>();
services.AddIdentityServer(options => services.AddIdentityServer(options =>
{ {
options.UserInteractionOptions.ErrorUrl = "/account/error/"; options.UserInteractionOptions.ErrorUrl = "/account/error/";
}) })
.SetSigningCredential(certificate) .AddInMemoryApiResources(GetApiResources())
.AddInMemoryIdentityResources(GetIdentityResources())
.AddSigningCredential(certificate)
.AddAspNetIdentity<IdentityUser>(); .AddAspNetIdentity<IdentityUser>();
return services; return services;
@ -64,26 +68,21 @@ namespace Squidex.Config.Identity
return services; return services;
} }
public static IEnumerable<Scope> GetScopes() private static IEnumerable<ApiResource> GetApiResources()
{
return new List<Scope>
{
StandardScopes.OpenId,
StandardScopes.Profile,
new Scope
{
Name = Constants.ProfileScope, Type = ScopeType.Identity,
Claims = new List<ScopeClaim>
{ {
new ScopeClaim(ExtendedClaimTypes.SquidexDisplayName, true), yield return new ApiResource(Constants.ApiScope);
new ScopeClaim(ExtendedClaimTypes.SquidexPictureUrl, true)
} }
},
new Scope private static IEnumerable<IdentityResource> GetIdentityResources()
{ {
Name = Constants.ApiScope, Type = ScopeType.Resource yield return new IdentityResources.OpenId();
} yield return new IdentityResources.Profile();
}; yield return new IdentityResource(Constants.ProfileScope,
new[]
{
ExtendedClaimTypes.SquidexDisplayName,
ExtendedClaimTypes.SquidexPictureUrl
});
} }
} }
} }

4
src/Squidex/Config/Identity/IdentityUsage.cs

@ -100,8 +100,8 @@ namespace Squidex.Config.Identity
app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
{ {
Authority = apiAuthorityUrl, Authority = apiAuthorityUrl,
ScopeName = apiScope, ApiName = apiScope,
ScopeSecret = null, ApiSecret = null,
RequireHttpsMetadata = identityOptions.RequiresHttps RequireHttpsMetadata = identityOptions.RequiresHttps
}); });
} }

5
src/Squidex/Config/Identity/LazyClientStore.cs

@ -10,6 +10,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using IdentityServer4;
using IdentityServer4.Models; using IdentityServer4.Models;
using IdentityServer4.Stores; using IdentityServer4.Stores;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
@ -111,8 +112,8 @@ namespace Squidex.Config.Identity
AllowedGrantTypes = GrantTypes.Implicit, AllowedGrantTypes = GrantTypes.Implicit,
AllowedScopes = new List<string> AllowedScopes = new List<string>
{ {
StandardScopes.OpenId.Name, IdentityServerConstants.StandardScopes.OpenId,
StandardScopes.Profile.Name, IdentityServerConstants.StandardScopes.Profile,
Constants.ApiScope, Constants.ApiScope,
Constants.ProfileScope Constants.ProfileScope
}, },

2
src/Squidex/Controllers/Api/Schemas/Models/Fields/NumberField.cs

@ -6,11 +6,13 @@
// All rights reserved. // All rights reserved.
// ========================================================================== // ==========================================================================
using NJsonSchema.Annotations;
using Squidex.Core.Schemas; using Squidex.Core.Schemas;
using Squidex.Infrastructure.Reflection; using Squidex.Infrastructure.Reflection;
namespace Squidex.Controllers.Api.Schemas.Models.Fields namespace Squidex.Controllers.Api.Schemas.Models.Fields
{ {
[JsonSchema("Number")]
public sealed class NumberField : FieldPropertiesDto public sealed class NumberField : FieldPropertiesDto
{ {
/// <summary> /// <summary>

2
src/Squidex/Controllers/Api/Schemas/Models/Fields/StringField.cs

@ -6,11 +6,13 @@
// All rights reserved. // All rights reserved.
// ========================================================================== // ==========================================================================
using NJsonSchema.Annotations;
using Squidex.Core.Schemas; using Squidex.Core.Schemas;
using Squidex.Infrastructure.Reflection; using Squidex.Infrastructure.Reflection;
namespace Squidex.Controllers.Api.Schemas.Models.Fields namespace Squidex.Controllers.Api.Schemas.Models.Fields
{ {
[JsonSchema("String")]
public sealed class StringField : FieldPropertiesDto public sealed class StringField : FieldPropertiesDto
{ {
/// <summary> /// <summary>

2
src/Squidex/project.json

@ -27,7 +27,7 @@
"type": "platform" "type": "platform"
}, },
"MongoDB.Driver": "2.4.0", "MongoDB.Driver": "2.4.0",
"NJsonSchema": "6.5.6190.16910", "NJsonSchema": "6.3.6185.19861",
"NSwag.AspNetCore": "8.0.0", "NSwag.AspNetCore": "8.0.0",
"OpenCover": "4.6.519", "OpenCover": "4.6.519",
"ReportGenerator": "2.5.2-beta2", "ReportGenerator": "2.5.2-beta2",

12
tests/Squidex.Infrastructure.Tests/TypeNameAttributeTest.cs

@ -1,7 +1,11 @@
using System; // ==========================================================================
using System.Collections.Generic; // TypeNameAttributeTest.cs
using System.Linq; // Squidex Headless CMS
using System.Threading.Tasks; // ==========================================================================
// Copyright (c) Squidex Group
// All rights reserved.
// ==========================================================================
using Xunit; using Xunit;
namespace Squidex.Infrastructure namespace Squidex.Infrastructure

Loading…
Cancel
Save