Rename project to InitializrService

This commit is contained in:
Chris Cheetham 2022-02-15 13:33:29 -05:00
Родитель 4380751fec
Коммит 56ba479896
60 изменённых файлов: 161 добавлений и 160 удалений

Просмотреть файл

@ -12,4 +12,4 @@ RUN curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for
&& chmod +x wait-for-it
COPY --from=build /srv .
ENV DOTNET_URLS http://0.0.0.0:80
ENTRYPOINT ["dotnet", "Steeltoe.InitializrApi.dll"]
ENTRYPOINT ["dotnet", "Steeltoe.InitializrService.dll"]

Просмотреть файл

@ -1,14 +1,14 @@
# Steeltoe InitializrApi
# Steeltoe InitializrService
Steeltoe Initializr API reference implementation
Steeltoe Initializr Service reference implementation
[![Build Status](https://dev.azure.com/SteeltoeOSS/Steeltoe/_apis/build/status/Initializr/SteeltoeOSS.InitializrApi?branchName=main)](https://dev.azure.com/SteeltoeOSS/Steeltoe/_build/latest?definitionId=31&branchName=main)
[![Build Status](https://dev.azure.com/SteeltoeOSS/Steeltoe/_apis/build/status/Initializr/SteeltoeOSS.InitializrService?branchName=main)](https://dev.azure.com/SteeltoeOSS/Steeltoe/_build/latest?definitionId=31&branchName=main)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=InitializrApi&metric=alert_status)](https://sonarcloud.io/dashboard?id=InitializrApi)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=InitializrService&metric=alert_status)](https://sonarcloud.io/dashboard?id=InitializrService)
## Using the Server
_InitializrApi_ provides 4 REST/HTTP endpoints:
_InitializrService_ provides 4 REST/HTTP endpoints:
* `api/`
* `api/about`
* `api/config`
@ -42,8 +42,8 @@ The URI templates take a set of parameters to customize the result of a request.
$ http -p b https://start.steeltoe.io/api/about
{
"commit": "381bbd2a1e30d621ed6ad4a07790955447ffe468",
"name": "Steeltoe.InitializrApi",
"url": "https://github.com/SteeltoeOSS/InitializrApi/",
"name": "Steeltoe.InitializrService",
"url": "https://github.com/SteeltoeOSS/InitializrService/",
"vendor": "SteeltoeOSS/VMware",
"version": "0.8.0"
}
@ -51,7 +51,7 @@ $ http -p b https://start.steeltoe.io/api/about
### `api/config`
`api/config` accepts GET requests and returns _InitializrApi_ configuration.
`api/config` accepts GET requests and returns _InitializrService_ configuration.
The returned document includes _all_ configuration. Sub-endpoints are available allowing for more targeted responses.
@ -131,7 +131,7 @@ The former is recommended for production deployments; the latter is intended pri
The Initializr API uses the [Steeltoe Config Server Provider](https://docs.steeltoe.io/api/v3/configuration/config-server-provider.html) to get configuration from a Spring Cloud Config Server.
The _InitializrAPI_ running at https://start.steeltoe.io/api/ uses a Spring Cloud Config Server backended at https://github.com/SteeltoeOSS/InitializrConfig.
The following `appsettings.json` sample snippet is part of the _InitializrApi_'s configuration:
The following `appsettings.json` sample snippet is part of the _InitializrService_'s configuration:
```json
...,
"spring": {

Просмотреть файл

@ -2,15 +2,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30320.27
MinimumVisualStudioVersion = 15.0.26124.0
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Steeltoe.InitializrApi", "src\InitializrApi\Steeltoe.InitializrApi.csproj", "{7597F74D-528E-448B-BBE8-994092F04CA4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Steeltoe.InitializrService", "src\InitializrService\Steeltoe.InitializrService.csproj", "{7597F74D-528E-448B-BBE8-994092F04CA4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Steeltoe.InitializrApi.Config", "src\InitializrApi.Config\Steeltoe.InitializrApi.Config.csproj", "{ACE6FEE1-9CEA-4A95-9D76-C62A41947C8F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Steeltoe.InitializrService.Config", "src\InitializrService.Config\Steeltoe.InitializrService.Config.csproj", "{ACE6FEE1-9CEA-4A95-9D76-C62A41947C8F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Steeltoe.InitializrApi.Test.Utils", "test\InitializrApi.Test.Utils\Steeltoe.InitializrApi.Test.Utils.csproj", "{EC08DC14-11D5-40D3-8908-BDB0D789F48D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Steeltoe.InitializrService.Test.Utils", "test\InitializrService.Test.Utils\Steeltoe.InitializrService.Test.Utils.csproj", "{EC08DC14-11D5-40D3-8908-BDB0D789F48D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Steeltoe.InitializrApi.Test.Unit", "test\InitializrApi.Test.Unit\Steeltoe.InitializrApi.Test.Unit.csproj", "{EA849C8F-7118-45DB-BBF2-D36CE1FD43B4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Steeltoe.InitializrService.Test.Unit", "test\InitializrService.Test.Unit\Steeltoe.InitializrService.Test.Unit.csproj", "{EA849C8F-7118-45DB-BBF2-D36CE1FD43B4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Steeltoe.InitializrApi.Test.Integration", "test\InitializrApi.Test.Integration\Steeltoe.InitializrApi.Test.Integration.csproj", "{24A2AB13-F4C4-4C88-B67D-D280610240B8}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Steeltoe.InitializrService.Test.Integration", "test\InitializrService.Test.Integration\Steeltoe.InitializrService.Test.Integration.csproj", "{24A2AB13-F4C4-4C88-B67D-D280610240B8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F80B44AC-7383-40DA-B353-16163BF279F1}"
ProjectSection(SolutionItems) = preProject
@ -21,7 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.props = Directory.Build.props
docker-compose.yaml = docker-compose.yaml
Dockerfile = Dockerfile
Steeltoe.InitializrApi.sln.DotSettings = Steeltoe.InitializrApi.sln.DotSettings
Steeltoe.InitializrService.sln.DotSettings = Steeltoe.InitializrService.sln.DotSettings
LICENSE = LICENSE
README.md = README.md
stylecop.json = stylecop.json

Просмотреть файл

@ -2,7 +2,7 @@
<PropertyGroup>
<GoogleAnalyticsTrackerVersion>6.0.7</GoogleAnalyticsTrackerVersion>
<SteeltoeInitializrApiVersion>0.0.0</SteeltoeInitializrApiVersion>
<SteeltoeInitializrServiceVersion>0.0.0</SteeltoeInitializrServiceVersion>
<SteeltoeVersion>3.1.0</SteeltoeVersion>
<YamlDotNetVersion>8.1.2</YamlDotNetVersion>
</PropertyGroup>

Просмотреть файл

@ -5,7 +5,7 @@ variables:
- name: major
value: 0
- name: minor
value: 23
value: 24
- name: patch
value: 0
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
@ -40,7 +40,7 @@ stages:
inputs:
SonarCloud: SonarCloud
organization: steeltoeoss
projectKey: InitializrApi
projectKey: InitializrService
extraProperties: |
sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/*.opencover.xml
- task: DotNetCoreCLI@2
@ -72,7 +72,7 @@ stages:
displayName: dotnet pack
inputs:
command: pack
packagesToPack: src/InitializrApi.Config
packagesToPack: src/InitializrService.Config
arguments: --no-build
- task: Powershell@2
displayName: Sign NuGets

Просмотреть файл

@ -74,4 +74,5 @@ fi
echo "Setting version to $major.$minor.$patch"
$sed -i 's:<SteeltoeInitializrApiVersion>.*</SteeltoeInitializrApiVersion>:<SteeltoeInitializrApiVersion>'$major.$minor.$patch'</SteeltoeInitializrApiVersion>:' $base_dir/Version.props
$sed -i
's:<SteeltoeInitializrServiceVersion>.*</SteeltoeInitializrServiceVersion>:<SteeltoeInitializrServiceVersion>'$major.$minor.$patch'</SteeltoeInitializrServiceVersion>:' $base_dir/Version.props

Просмотреть файл

@ -20,7 +20,7 @@
</PropertyGroup>
<PropertyGroup>
<Version Condition=" '$(BUILD_BUILDNUMBER)' == '' ">$(SteeltoeInitializrApiVersion)</Version>
<Version Condition=" '$(BUILD_BUILDNUMBER)' == '' ">$(SteeltoeInitializrServiceVersion)</Version>
<Version Condition=" '$(BUILD_BUILDNUMBER)' != '' ">$(BUILD_BUILDNUMBER)</Version>
</PropertyGroup>

Просмотреть файл

@ -2,13 +2,13 @@
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
using Steeltoe.InitializrApi.Config.Utilities;
using Steeltoe.InitializrService.Config.Utilities;
using System;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
namespace Steeltoe.InitializrApi.Config
namespace Steeltoe.InitializrService.Config
{
/// <summary>
/// A model of a release range.

Просмотреть файл

@ -2,10 +2,10 @@
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
namespace Steeltoe.InitializrApi.Config
namespace Steeltoe.InitializrService.Config
{
/// <summary>
/// A model of an InitializrApi server configuration.
/// A model of an InitializrService server configuration.
/// </summary>
public sealed class UiConfig
{

Просмотреть файл

@ -6,7 +6,7 @@ using System;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Steeltoe.InitializrApi.Config.Utilities
namespace Steeltoe.InitializrService.Config.Utilities
{
/// <summary>
/// Deserializes a <see cref="ReleaseRange"/> in JSON expressions.

Просмотреть файл

@ -9,7 +9,7 @@ using YamlDotNet.Core;
using YamlDotNet.Core.Events;
using YamlDotNet.Serialization;
namespace Steeltoe.InitializrApi.Config.Utilities
namespace Steeltoe.InitializrService.Config.Utilities
{
/// <summary>
/// Deserializes a <see cref="ReleaseRange"/> in YAML expressions.

Просмотреть файл

@ -4,18 +4,18 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Steeltoe.InitializrApi.Config;
using Steeltoe.InitializrApi.Services;
using Steeltoe.InitializrApi.Utilities;
using Steeltoe.InitializrService.Config;
using Steeltoe.InitializrService.Services;
using Steeltoe.InitializrService.Utilities;
using System;
using System.IO;
namespace Steeltoe.InitializrApi.Configuration
namespace Steeltoe.InitializrService.Configuration
{
/// <summary>
/// An <see cref="IUiConfigService"/> using a local configuration file backend.
/// </summary>
public class UiConfigFile : InitializrApiServiceBase, IUiConfigService
public class UiConfigFile : InitializrServiceBase, IUiConfigService
{
/* ----------------------------------------------------------------- *
* constructors *
@ -26,7 +26,7 @@ namespace Steeltoe.InitializrApi.Configuration
/// </summary>
/// <param name="options">Injected options from appsettings.</param>
/// <param name="logger">Injected logger.</param>
public UiConfigFile(IOptions<InitializrApiOptions> options, ILogger<UiConfigFile> logger)
public UiConfigFile(IOptions<InitializrServiceOptions> options, ILogger<UiConfigFile> logger)
: base(logger)
{
var apiOptions = options.Value;

Просмотреть файл

@ -5,15 +5,15 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Steeltoe.Extensions.Configuration.ConfigServer;
using Steeltoe.InitializrApi.Config;
using Steeltoe.InitializrApi.Services;
using Steeltoe.InitializrService.Config;
using Steeltoe.InitializrService.Services;
namespace Steeltoe.InitializrApi.Configuration
namespace Steeltoe.InitializrService.Configuration
{
/// <summary>
/// An <see cref="IUiConfigService"/> using a <a href="https://cloud.spring.io/spring-cloud-config/reference/html/#_spring_cloud_config_server">Spring Cloud Config Server</a> backend.
/// </summary>
public class UiConfigService : InitializrApiServiceBase, IUiConfigService
public class UiConfigService : InitializrServiceBase, IUiConfigService
{
/* ----------------------------------------------------------------- *
* constructors *

Просмотреть файл

@ -5,14 +5,14 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace Steeltoe.InitializrApi.Controllers
namespace Steeltoe.InitializrService.Controllers
{
/// <summary>
/// About endpoint.
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class AboutController : InitializrApiControllerBase
public class AboutController : InitializrServiceControllerBase
{
/* ----------------------------------------------------------------- *
* constructors *

Просмотреть файл

@ -5,22 +5,22 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace Steeltoe.InitializrApi.Controllers
namespace Steeltoe.InitializrService.Controllers
{
/// <summary>
/// Base class for InitializrApi controllers.
/// Base class for InitializrService controllers.
/// </summary>
public abstract class InitializrApiControllerBase : ControllerBase
public abstract class InitializrServiceControllerBase : ControllerBase
{
/* ----------------------------------------------------------------- *
* constructors *
* ----------------------------------------------------------------- */
/// <summary>
/// Initializes a new instance of the <see cref="InitializrApiControllerBase"/> class.
/// Initializes a new instance of the <see cref="InitializrServiceControllerBase"/> class.
/// </summary>
/// <param name="logger">Injected logger.</param>
protected InitializrApiControllerBase(ILogger logger)
protected InitializrServiceControllerBase(ILogger logger)
{
Logger = logger;
}

Просмотреть файл

@ -5,20 +5,20 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Steeltoe.InitializrApi.Config;
using Steeltoe.InitializrApi.Models;
using Steeltoe.InitializrApi.Services;
using Steeltoe.InitializrService.Config;
using Steeltoe.InitializrService.Models;
using Steeltoe.InitializrService.Services;
using System;
using System.Threading.Tasks;
namespace Steeltoe.InitializrApi.Controllers
namespace Steeltoe.InitializrService.Controllers
{
/// <summary>
/// Project generation endpoint.
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class ProjectController : InitializrApiControllerBase
public class ProjectController : InitializrServiceControllerBase
{
/* ----------------------------------------------------------------- *
* fields *

Просмотреть файл

@ -5,27 +5,27 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Steeltoe.InitializrApi.Config;
using Steeltoe.InitializrApi.Services;
using Steeltoe.InitializrService.Config;
using Steeltoe.InitializrService.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Steeltoe.InitializrApi.Controllers
namespace Steeltoe.InitializrService.Controllers
{
/// <summary>
/// About endpoint.
/// </summary>
[ApiController]
[Route("api")]
public class RootController : InitializrApiControllerBase
public class RootController : InitializrServiceControllerBase
{
/* ----------------------------------------------------------------- *
* fields *
* ----------------------------------------------------------------- */
private readonly InitializrApiOptions _apiOptions;
private readonly InitializrServiceOptions _serviceOptions;
private readonly IUiConfigService _uiConfigService;
@ -40,12 +40,12 @@ namespace Steeltoe.InitializrApi.Controllers
/// <param name="uiConfigService">Injected Initializr configuration service.</param>
/// <param name="logger">Injected logger.</param>
public RootController(
IOptions<InitializrApiOptions> options,
IOptions<InitializrServiceOptions> options,
IUiConfigService uiConfigService,
ILogger<RootController> logger)
: base(logger)
{
_apiOptions = options.Value;
_serviceOptions = options.Value;
_uiConfigService = uiConfigService;
}
@ -61,12 +61,12 @@ namespace Steeltoe.InitializrApi.Controllers
public IActionResult GetHelp()
{
var help = new List<string>();
if (_apiOptions?.Logo is not null)
if (_serviceOptions?.Logo is not null)
{
try
{
help.Add(string.Empty);
var logoPath = _apiOptions.Logo;
var logoPath = _serviceOptions.Logo;
System.IO.File.ReadAllLines(logoPath).ToList().ForEach(l => help.Add(l));
help.Add(string.Empty);
}

Просмотреть файл

@ -4,16 +4,16 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Steeltoe.InitializrApi.Services;
using Steeltoe.InitializrService.Services;
namespace Steeltoe.InitializrApi.Controllers
namespace Steeltoe.InitializrService.Controllers
{
/// <summary>
/// Server configuration endpoint.
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class UiConfigController : InitializrApiControllerBase
public class UiConfigController : InitializrServiceControllerBase
{
/* ----------------------------------------------------------------- *
* fields *

Просмотреть файл

@ -4,20 +4,20 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Steeltoe.InitializrApi.Models;
using Steeltoe.InitializrApi.Services;
using Steeltoe.InitializrService.Models;
using Steeltoe.InitializrService.Services;
using System.IO;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Web;
namespace Steeltoe.InitializrApi.Generators
namespace Steeltoe.InitializrService.Generators
{
/// <summary>
/// a A project generator that uses a NetCoreToolService.
/// </summary>
public class NetCoreToolProjectGenerator : InitializrApiServiceBase, IProjectGenerator
public class NetCoreToolProjectGenerator : InitializrServiceBase, IProjectGenerator
{
private static readonly HttpClient Client = new ();
@ -29,7 +29,7 @@ namespace Steeltoe.InitializrApi.Generators
/// <param name="options">Injected options.</param>
/// <param name="logger">Injected logger.</param>
public NetCoreToolProjectGenerator(
IOptions<InitializrApiOptions> options,
IOptions<InitializrServiceOptions> options,
ILogger<NetCoreToolProjectGenerator> logger)
: base(logger)
{

Просмотреть файл

@ -4,17 +4,17 @@
using System.Collections.Generic;
namespace Steeltoe.InitializrApi
namespace Steeltoe.InitializrService
{
/// <summary>
/// Initializr configuration options.
/// </summary>
public sealed class InitializrApiOptions
public sealed class InitializrServiceOptions
{
/// <summary>
/// The value of the appsettings section name.
/// </summary>
public const string InitializrApi = "InitializrApi";
public const string InitializrService = "InitializrService";
/// <summary>
/// Gets or sets the Net Core Tool Service config dictionary.

Просмотреть файл

@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
namespace Steeltoe.InitializrApi.Models
namespace Steeltoe.InitializrService.Models
{
/// <summary>
/// Application information, such as version.

Просмотреть файл

@ -4,7 +4,7 @@
using System.Text;
namespace Steeltoe.InitializrApi.Models
namespace Steeltoe.InitializrService.Models
{
/// <summary>
/// A model of the project generation spec.

Просмотреть файл

@ -6,11 +6,11 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Steeltoe.Extensions.Configuration.ConfigServer;
using Steeltoe.Extensions.Logging;
using Steeltoe.InitializrApi.Models;
using Steeltoe.InitializrService.Models;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
namespace Steeltoe.InitializrApi
namespace Steeltoe.InitializrService
{
/// <summary>
/// The Steeltoe Initializr Api program.
@ -37,7 +37,7 @@ namespace Steeltoe.InitializrApi
{
Name = typeof(Program).Namespace ?? "unknown",
Vendor = "SteeltoeOSS/VMware",
Url = "https://github.com/SteeltoeOSS/InitializrApi/",
Url = "https://github.com/SteeltoeOSS/InitializrService/",
Version = fields[0],
Commit = fields[1],
};

Просмотреть файл

@ -2,12 +2,12 @@
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
using Steeltoe.InitializrApi.Models;
using Steeltoe.InitializrService.Models;
using System;
using System.Runtime.Serialization;
using System.Threading.Tasks;
namespace Steeltoe.InitializrApi.Services
namespace Steeltoe.InitializrService.Services
{
/// <summary>
/// Contract for a project generator implementations.

Просмотреть файл

@ -2,9 +2,9 @@
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
using Steeltoe.InitializrApi.Config;
using Steeltoe.InitializrService.Config;
namespace Steeltoe.InitializrApi.Services
namespace Steeltoe.InitializrService.Services
{
/// <summary>
/// Contract for Initializr configuration service implementations.

Просмотреть файл

@ -4,18 +4,18 @@
using Microsoft.Extensions.Logging;
namespace Steeltoe.InitializrApi.Services
namespace Steeltoe.InitializrService.Services
{
/// <summary>
/// Base class for InitializrApi services.
/// Base class for InitializrService services.
/// </summary>
public abstract class InitializrApiServiceBase
public abstract class InitializrServiceBase
{
/// <summary>
/// Initializes a new instance of the <see cref="InitializrApiServiceBase"/> class.
/// Initializes a new instance of the <see cref="InitializrServiceBase"/> class.
/// </summary>
/// <param name="logger">Injected logger.</param>
protected InitializrApiServiceBase(ILogger logger)
protected InitializrServiceBase(ILogger logger)
{
Logger = logger;
}

Просмотреть файл

@ -9,16 +9,16 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Steeltoe.Extensions.Configuration.ConfigServer;
using Steeltoe.InitializrApi.Config;
using Steeltoe.InitializrApi.Configuration;
using Steeltoe.InitializrApi.Generators;
using Steeltoe.InitializrApi.Services;
using Steeltoe.InitializrService.Config;
using Steeltoe.InitializrService.Configuration;
using Steeltoe.InitializrService.Generators;
using Steeltoe.InitializrService.Services;
using Steeltoe.Management.Endpoint;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
namespace Steeltoe.InitializrApi
namespace Steeltoe.InitializrService
{
/// <summary>
/// The Steeltoe Initializr Api dependency injection setup.
@ -49,17 +49,17 @@ namespace Steeltoe.InitializrApi
public void ConfigureServices(IServiceCollection services)
{
services.AddOptions();
services.Configure<InitializrApiOptions>(Configuration.GetSection(InitializrApiOptions.InitializrApi));
InitializrApiOptions options;
services.Configure<InitializrServiceOptions>(Configuration.GetSection(InitializrServiceOptions.InitializrService));
InitializrServiceOptions options;
try
{
options = Configuration.GetSection(InitializrApiOptions.InitializrApi).Get<InitializrApiOptions>();
options = Configuration.GetSection(InitializrServiceOptions.InitializrService).Get<InitializrServiceOptions>();
}
catch (Exception e)
{
if (e.InnerException is KeyNotFoundException)
{
throw new ArgumentException("InitializrApi configuration is missing or errant");
throw new ArgumentException("InitializrService configuration is missing or errant");
}
throw;

Просмотреть файл

@ -6,7 +6,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\InitializrApi.Config\Steeltoe.InitializrApi.Config.csproj" />
<ProjectReference Include="..\InitializrService.Config\Steeltoe.InitializrService.Config.csproj" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -2,12 +2,12 @@
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
using Steeltoe.InitializrApi.Config.Utilities;
using Steeltoe.InitializrService.Config.Utilities;
using System.Text.Json;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;
namespace Steeltoe.InitializrApi.Utilities
namespace Steeltoe.InitializrService.Utilities
{
/// <summary>
/// A utility wrapper for JSON serialization/deserialization.

Просмотреть файл

@ -1,5 +1,5 @@
{
"InitializrApi": {
"InitializrService": {
"NetCoreToolService": {
"Uri": "http://localhost:1922/api"
},
@ -16,7 +16,7 @@
},
"Logging": {
"LogLevel": {
"Steeltoe.InitializrApi": "Debug"
"Steeltoe.InitializrService": "Debug"
}
}
}

Просмотреть файл

@ -8,7 +8,7 @@
},
"Logging": {
"LogLevel": {
"Steeltoe.InitializrApi": "Debug"
"Steeltoe.InitializrServiceApi": "Debug"
}
}
}

Просмотреть файл

@ -1,7 +1,7 @@
{
"Logging": {
"LogLevel": {
"Steeltoe.InitializrApi": "Debug"
"Steeltoe.InitializrService": "Debug"
}
}
}

Просмотреть файл

@ -1,5 +1,5 @@
{
"InitializrApi": {
"InitializrService": {
"Logo": "Resources/logo.txt",
"NetCoreToolService": {
"Uri": "http://net-core-tool-service/api"
@ -20,7 +20,7 @@
"LogLevel": {
"Default": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"Steeltoe.InitializrApi": "Information"
"Steeltoe.InitializrService": "Information"
}
},
"Management": {

Просмотреть файл

@ -4,10 +4,10 @@ using System.Net.Http.Json;
using System.Threading.Tasks;
using FluentAssertions;
using Microsoft.AspNetCore.Mvc.Testing;
using Steeltoe.InitializrApi.Config;
using Steeltoe.InitializrService.Config;
using Xunit;
namespace Steeltoe.InitializrApi.Test.Integration
namespace Steeltoe.InitializrService.Test.Integration
{
public class HttpTests : IClassFixture<WebApplicationFactory<Startup>>
{

Просмотреть файл

@ -5,11 +5,11 @@
using System;
using System.Net;
using FluentAssertions;
using Steeltoe.InitializrApi.Config;
using Steeltoe.InitializrApi.Utilities;
using Steeltoe.InitializrService.Config;
using Steeltoe.InitializrService.Utilities;
using Xunit;
namespace Steeltoe.InitializrApi.Test.Integration
namespace Steeltoe.InitializrService.Test.Integration
{
public class ModelTests
{

Просмотреть файл

@ -5,7 +5,7 @@
using FluentAssertions;
using Xunit;
namespace Steeltoe.InitializrApi.Test.Integration
namespace Steeltoe.InitializrService.Test.Integration
{
public class ProgramTests
{
@ -17,9 +17,9 @@ namespace Steeltoe.InitializrApi.Test.Integration
public void About_Should_Contain_About_Details()
{
var about = Program.About;
about.Name.Should().Be("Steeltoe.InitializrApi");
about.Name.Should().Be("Steeltoe.InitializrService");
about.Vendor.Should().Be("SteeltoeOSS/VMware");
about.Url.Should().Be("https://github.com/SteeltoeOSS/InitializrApi/");
about.Url.Should().Be("https://github.com/SteeltoeOSS/InitializrService/");
about.Version.Should().NotBeNull();
/* about.Version.Should().StartWith("0.0.0"); */
about.Commit.Should().NotBeNull();

Просмотреть файл

@ -7,8 +7,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\InitializrApi\Steeltoe.InitializrApi.csproj" />
<ProjectReference Include="..\InitializrApi.Test.Utils\Steeltoe.InitializrApi.Test.Utils.csproj" />
<ProjectReference Include="..\..\src\InitializrService\Steeltoe.InitializrService.csproj" />
<ProjectReference Include="..\InitializrService.Test.Utils\Steeltoe.InitializrService.Test.Utils.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
namespace Steeltoe.InitializrApi.Test.Unit.Configuration
namespace Steeltoe.InitializrService.Test.Unit.Configuration
{
public class InitializrConfigServiceTests
{

Просмотреть файл

@ -8,12 +8,12 @@ using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Moq;
using Steeltoe.InitializrApi.Configuration;
using Steeltoe.InitializrService.Configuration;
using Xunit;
namespace Steeltoe.InitializrApi.Test.Unit.Configuration
namespace Steeltoe.InitializrService.Test.Unit.Configuration
{
public class InitializrApiOptionsTests
public class InitializrServiceOptionsTests
{
/* ----------------------------------------------------------------- *
* positive tests *
@ -27,8 +27,8 @@ namespace Steeltoe.InitializrApi.Test.Unit.Configuration
public void Non_Existent_UiConfig_Path_Should_Throw_ArgumentException()
{
// Arrange
var options = new Mock<IOptions<InitializrApiOptions>>();
options.Setup(opts => opts.Value).Returns(new InitializrApiOptions
var options = new Mock<IOptions<InitializrServiceOptions>>();
options.Setup(opts => opts.Value).Returns(new InitializrServiceOptions
{ UiConfig = new Dictionary<string, string> { { "Path", "no_such_path" } } });
var logger = new NullLogger<UiConfigFile>();
@ -47,8 +47,8 @@ namespace Steeltoe.InitializrApi.Test.Unit.Configuration
public void Directory_UiConfig_Path_Should_Throw_ArgumentException()
{
// Arrange
var options = new Mock<IOptions<InitializrApiOptions>>();
options.Setup(opts => opts.Value).Returns(new InitializrApiOptions
var options = new Mock<IOptions<InitializrServiceOptions>>();
options.Setup(opts => opts.Value).Returns(new InitializrServiceOptions
{ UiConfig = new Dictionary<string, string> { { "Path", "." } } });
var logger = new NullLogger<UiConfigFile>();
@ -67,9 +67,9 @@ namespace Steeltoe.InitializrApi.Test.Unit.Configuration
public void Non_Json_UiConfig_Should_Throw_ArgumentException()
{
// Arrange
var options = new Mock<IOptions<InitializrApiOptions>>();
options.Setup(opts => opts.Value).Returns(new InitializrApiOptions
{ UiConfig = new Dictionary<string, string> { { "Path", "Steeltoe.InitializrApi.dll" } } });
var options = new Mock<IOptions<InitializrServiceOptions>>();
options.Setup(opts => opts.Value).Returns(new InitializrServiceOptions
{ UiConfig = new Dictionary<string, string> { { "Path", "Steeltoe.InitializrService.dll" } } });
var logger = new NullLogger<UiConfigFile>();
// Act

Просмотреть файл

@ -5,11 +5,11 @@
using FluentAssertions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging.Abstractions;
using Steeltoe.InitializrApi.Controllers;
using Steeltoe.InitializrApi.Models;
using Steeltoe.InitializrService.Controllers;
using Steeltoe.InitializrService.Models;
using Xunit;
namespace Steeltoe.InitializrApi.Test.Unit.Controllers
namespace Steeltoe.InitializrService.Test.Unit.Controllers
{
public class AboutControllerTests
{
@ -30,9 +30,9 @@ namespace Steeltoe.InitializrApi.Test.Unit.Controllers
var indexResult = Assert.IsType<OkObjectResult>(result);
indexResult.Value.Should().BeOfType<About>();
var about = Assert.IsType<About>(indexResult.Value);
about.Name.Should().Be("Steeltoe.InitializrApi");
about.Name.Should().Be("Steeltoe.InitializrService");
about.Vendor.Should().Be("SteeltoeOSS/VMware");
about.Url.Should().Be("https://github.com/SteeltoeOSS/InitializrApi/");
about.Url.Should().Be("https://github.com/SteeltoeOSS/InitializrService/");
/* about.Version.Should().StartWith("0.0.0"); */
about.Commit.Should().NotBeNullOrWhiteSpace();
}

Просмотреть файл

@ -9,13 +9,13 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging.Abstractions;
using Moq;
using Steeltoe.InitializrApi.Config;
using Steeltoe.InitializrApi.Controllers;
using Steeltoe.InitializrApi.Models;
using Steeltoe.InitializrApi.Services;
using Steeltoe.InitializrService.Config;
using Steeltoe.InitializrService.Controllers;
using Steeltoe.InitializrService.Models;
using Steeltoe.InitializrService.Services;
using Xunit;
namespace Steeltoe.InitializrApi.Test.Unit.Controllers
namespace Steeltoe.InitializrService.Test.Unit.Controllers
{
public class ProjectControllerTests
{

Просмотреть файл

@ -7,12 +7,12 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Moq;
using Steeltoe.InitializrApi.Config;
using Steeltoe.InitializrApi.Controllers;
using Steeltoe.InitializrApi.Services;
using Steeltoe.InitializrService.Config;
using Steeltoe.InitializrService.Controllers;
using Steeltoe.InitializrService.Services;
using Xunit;
namespace Steeltoe.InitializrApi.Test.Unit.Controllers
namespace Steeltoe.InitializrService.Test.Unit.Controllers
{
public class RootControllerTests
{
@ -24,8 +24,8 @@ namespace Steeltoe.InitializrApi.Test.Unit.Controllers
public void Get_Should_Return_Help()
{
// Arrange
var initializrCfg = new Mock<IOptions<InitializrApiOptions>>();
var initializrOpts = new InitializrApiOptions { Logo = "/no/such/logo" };
var initializrCfg = new Mock<IOptions<InitializrServiceOptions>>();
var initializrOpts = new InitializrServiceOptions { Logo = "/no/such/logo" };
initializrCfg.Setup(cfg => cfg.Value).Returns(initializrOpts);
var config = new UiConfig
{

Просмотреть файл

@ -6,12 +6,12 @@ using FluentAssertions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging.Abstractions;
using Moq;
using Steeltoe.InitializrApi.Config;
using Steeltoe.InitializrApi.Controllers;
using Steeltoe.InitializrApi.Services;
using Steeltoe.InitializrService.Config;
using Steeltoe.InitializrService.Controllers;
using Steeltoe.InitializrService.Services;
using Xunit;
namespace Steeltoe.InitializrApi.Test.Unit.Controllers
namespace Steeltoe.InitializrService.Test.Unit.Controllers
{
public class UiConfigControllerTests
{

Просмотреть файл

@ -3,10 +3,10 @@
// See the LICENSE file in the project root for more information.
using FluentAssertions;
using Steeltoe.InitializrApi.Models;
using Steeltoe.InitializrService.Models;
using Xunit;
namespace Steeltoe.InitializrApi.Test.Unit.Models
namespace Steeltoe.InitializrService.Test.Unit.Models
{
public class AboutTests
{

Просмотреть файл

@ -3,10 +3,10 @@
// See the LICENSE file in the project root for more information.
using FluentAssertions;
using Steeltoe.InitializrApi.Models;
using Steeltoe.InitializrService.Models;
using Xunit;
namespace Steeltoe.InitializrApi.Test.Unit.Models
namespace Steeltoe.InitializrService.Test.Unit.Models
{
public class ProjectSpecTests
{

Просмотреть файл

@ -4,10 +4,10 @@
using System;
using FluentAssertions;
using Steeltoe.InitializrApi.Config;
using Steeltoe.InitializrService.Config;
using Xunit;
namespace Steeltoe.InitializrApi.Test.Unit.Models
namespace Steeltoe.InitializrService.Test.Unit.Models
{
public class ReleaseRangeTests
{

Просмотреть файл

@ -3,10 +3,10 @@
// See the LICENSE file in the project root for more information.
using FluentAssertions;
using Steeltoe.InitializrApi.Config;
using Steeltoe.InitializrService.Config;
using Xunit;
namespace Steeltoe.InitializrApi.Test.Unit.Models
namespace Steeltoe.InitializrService.Test.Unit.Models
{
public class UiConfigTests
{

Просмотреть файл

@ -7,8 +7,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\InitializrApi\Steeltoe.InitializrApi.csproj" />
<ProjectReference Include="..\InitializrApi.Test.Utils\Steeltoe.InitializrApi.Test.Utils.csproj" />
<ProjectReference Include="..\..\src\InitializrService\Steeltoe.InitializrService.csproj" />
<ProjectReference Include="..\InitializrService.Test.Utils\Steeltoe.InitializrService.Test.Utils.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -3,10 +3,10 @@
// See the LICENSE file in the project root for more information.
using FluentAssertions;
using Steeltoe.InitializrApi.Utilities;
using Steeltoe.InitializrService.Utilities;
using Xunit;
namespace Steeltoe.InitializrApi.Test.Unit.Utilities
namespace Steeltoe.InitializrService.Test.Unit.Utilities
{
public class SerializerTest
{

Просмотреть файл

@ -8,7 +8,7 @@ using System;
using Microsoft.Extensions.Logging;
using Moq;
namespace Steeltoe.InitializrApi.Test.Utils
namespace Steeltoe.InitializrService.Test.Utils
{
public static class MockLoggerExtensions
{

Просмотреть файл

@ -5,7 +5,7 @@
using System;
using System.Net;
namespace Steeltoe.InitializrApi.Test.Utils
namespace Steeltoe.InitializrService.Test.Utils
{
public class MockProjectTemplateWebRequest : WebRequest
{

Просмотреть файл

@ -9,7 +9,7 @@ using System.IO.Compression;
using System.Net;
using System.Text;
namespace Steeltoe.InitializrApi.Test.Utils
namespace Steeltoe.InitializrService.Test.Utils
{
public class MockProjectTemplateWebResponse : WebResponse
{

Просмотреть файл

@ -5,7 +5,7 @@
using System;
using System.Net;
namespace Steeltoe.InitializrApi.Test.Utils
namespace Steeltoe.InitializrService.Test.Utils
{
public class MockProjectTemplateWebScheme : IWebRequestCreate
{

Просмотреть файл

@ -5,7 +5,7 @@
using System;
using System.IO;
namespace Steeltoe.InitializrApi.Test.Utils
namespace Steeltoe.InitializrService.Test.Utils
{
public sealed class TempFile : IDisposable
{