Skip to content

Commit 85a495a

Browse files
authored
Merge pull request #7 from TechnologyEnhancedLearning/master
RC hot fix - Merge into releases/Phoenix
2 parents 972b8c5 + 1e98c98 commit 85a495a

File tree

18 files changed

+481
-400
lines changed

18 files changed

+481
-400
lines changed

.github/azure-pipelines-ci.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Agent Queue 'Azure Pipelines' was used with unrecognized Agent Specification, vmImage property must be specified to determine image - https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#software
2+
variables:
3+
- name: BuildParameters.RestoreBuildProjects
4+
value: '**/*.csproj'
5+
- name: BuildParameters.TestProjects
6+
value: '**/*[Tt]ests/*.csproj'
7+
trigger:
8+
- CI
9+
name: $(date:yyyyMMdd)$(rev:.r)
10+
resources:
11+
repositories:
12+
- repository: self
13+
type: git
14+
ref: refs/heads/CI
15+
jobs:
16+
- job: Job_1
17+
displayName: Agent job
18+
pool:
19+
vmImage: windows-latest
20+
steps:
21+
- checkout: self
22+
clean: true
23+
fetchTags: false
24+
- task: NodeTool@0
25+
displayName: Use Node 12.19
26+
inputs:
27+
versionSpec: 12.19
28+
- task: Npm@1
29+
displayName: npm custom
30+
inputs:
31+
command: custom
32+
workingDir: Auth/LearningHub.Nhs.Auth
33+
verbose: false
34+
customCommand: install -f
35+
- task: Npm@1
36+
displayName: run webpack build
37+
inputs:
38+
command: custom
39+
workingDir: Auth/LearningHub.Nhs.Auth
40+
verbose: false
41+
customCommand: run build
42+
- task: NuGetToolInstaller@1
43+
displayName: Use NuGet 5.8
44+
inputs:
45+
versionSpec: 5.8
46+
- task: NuGetCommand@2
47+
displayName: NuGet restore
48+
inputs:
49+
feedRestore: d99eaf2c-ad74-4a35-876e-f7dc1e45a604
50+
- task: DotNetCoreCLI@2
51+
displayName: Restore
52+
inputs:
53+
command: restore
54+
projects: $(BuildParameters.RestoreBuildProjects)
55+
- task: DotNetCoreCLI@2
56+
displayName: Build
57+
inputs:
58+
projects: $(BuildParameters.RestoreBuildProjects)
59+
arguments: --configuration $(BuildConfiguration) /p:Platform=x64
60+
- task: DotNetCoreCLI@2
61+
displayName: Test
62+
enabled: False
63+
inputs:
64+
command: test
65+
projects: $(BuildParameters.TestProjects)
66+
arguments: --configuration $(BuildConfiguration)
67+
- task: DotNetCoreCLI@2
68+
displayName: Publish Auth
69+
inputs:
70+
command: publish
71+
publishWebProjects: false
72+
projects: '**/*LearningHub.Nhs.Auth.csproj'
73+
arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/Auth
74+
zipAfterPublish: True
75+
- task: PublishBuildArtifacts@1
76+
displayName: Publish Artifact Auth
77+
condition: succeededOrFailed()
78+
inputs:
79+
PathtoPublish: $(build.artifactstagingdirectory)/Auth
80+
ArtifactName: Auth
81+
TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)'
82+
- task: DotNetCoreCLI@2
83+
displayName: Publish UserAPI
84+
inputs:
85+
command: publish
86+
publishWebProjects: false
87+
projects: '**/*LearningHub.Nhs.UserApi.csproj'
88+
arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/UserAPI
89+
zipAfterPublish: True
90+
- task: PublishBuildArtifacts@1
91+
displayName: Publish Artifact UserAPI
92+
condition: succeededOrFailed()
93+
inputs:
94+
PathtoPublish: $(build.artifactstagingdirectory)/UserAPI
95+
ArtifactName: UserAPI
96+
TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)'
97+
...

.github/workflows/continuous-integration-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Continuous Integration
2-
on: [pull_request]
2+
on: [push]
33
env:
44
BuildParameters.RestoreBuildProjects: '**/*.csproj'
55
BuildParameters.TestProjects: '**/*[Tt]ests/*.csproj'

Auth/LearningHub.Nhs.Auth/Configuration/WebSettings.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,10 @@ public class WebSettings
5555
/// Gets or sets the SupportForm.
5656
/// </summary>
5757
public string SupportForm { get; set; }
58-
}
58+
59+
/// <summary>
60+
/// Gets or sets the SupportFeedbackForm.
61+
/// </summary>
62+
public string SupportFeedbackForm { get; set; }
63+
}
5964
}

Auth/LearningHub.Nhs.Auth/Controllers/AccountController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ private async Task<LoginViewModel> BuildLoginViewModelAsync(string returnUrl)
334334

335335
// Base _layout.cshtml template config
336336
this.ViewData["AuthMainTitle"] = loginClientTemplate.AuthMainTitle;
337+
this.ViewData["ClientUrl"] = loginClientTemplate.ClientUrl;
337338
this.ViewData["ClientLogoUrl"] = loginClientTemplate.ClientLogoUrl;
338339
this.ViewData["ClientLogoSrc"] = loginClientTemplate.ClientLogoSrc;
339340
this.ViewData["ClientLogoAltText"] = loginClientTemplate.ClientLogoAltText;
@@ -380,7 +381,6 @@ private async Task<LoginViewModel> BuildLoginViewModelAsync(string returnUrl)
380381
if (client != null)
381382
{
382383
allowLocal = client.EnableLocalLogin;
383-
384384
if (client.IdentityProviderRestrictions != null && client.IdentityProviderRestrictions.Any())
385385
{
386386
providers = providers.Where(provider => client.IdentityProviderRestrictions.Contains(provider.AuthenticationScheme)).ToList();

Auth/LearningHub.Nhs.Auth/Filters/SecurityHeadersAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public override void OnResultExecuting(ResultExecutingContext context)
3737

3838
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
3939
////var csp = "default-src 'self'; object-src 'none'; frame-ancestors 'none'; sandbox allow-forms allow-same-origin allow-scripts; base-uri 'self';";
40-
var csp = "object-src 'none'; frame-ancestors 'none'; sandbox allow-forms allow-same-origin allow-scripts; base-uri 'self';";
40+
var csp = "object-src 'none'; frame-ancestors 'none'; sandbox allow-forms allow-same-origin allow-scripts allow-popups; base-uri 'self';";
4141
//// also consider adding upgrade-insecure-requests once you have HTTPS in place for production
4242
////csp += "upgrade-insecure-requests;";
4343
//// also an example if you need client images to be displayed from twitter

Auth/LearningHub.Nhs.Auth/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
var builder = WebApplication.CreateBuilder(args);
1919

20-
builder.Configuration.AddUserSecrets(string.Empty);
20+
builder.Configuration.AddUserSecrets("a2ecb5d2-cf13-4551-9cb6-3d86dfbcf8ef");
2121

2222
builder.Logging.ClearProviders();
2323

Auth/LearningHub.Nhs.Auth/Styles/sso.scss

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,6 @@ body {
1010
background-color: $nhsuk-grey-white;
1111
}
1212

13-
header {
14-
background-color: $nhsuk-blue;
15-
height: 112px;
16-
padding: 0 15px;
17-
}
18-
19-
footer {
20-
background-color: $nhsuk-blue;
21-
height: 130px;
22-
padding: 0 15px;
23-
position: absolute;
24-
left: 0;
25-
bottom: 0;
26-
width: 100%;
27-
}
28-
2913
a {
3014
text-decoration: underline;
3115
}

Auth/LearningHub.Nhs.Auth/Views/Shared/LearningHub/_Layout.cshtml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
<header class="nhsuk-header" role="banner">
3939
<partial name="~/Views/Shared/LearningHub/_NavPartial.cshtml" />
4040
</header>
41+
<div class="nhsuk-width-container app-width-container beta-banner">
42+
<span class="beta-banner__beta-box">BETA</span>
43+
<span class="beta-banner__text">This is a new platform - your <a href="@(settings.Value.SupportFeedbackForm)" target="_blank">feedback</a> will help us to improve it.</span>
44+
</div>
4145
<div class="nhsuk-width-container app-width-container--full">
4246
<main role="main" id="maincontent" class="nhsuk-main-wrapper app-main-wrapper--no-padding nhsuk-bg-white">
4347
@RenderBody()
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
<div class="nhsuk-width-container nhsuk-header__container app-width-container @PreLoginClass()">
2-
<div class="nhsuk-header__logo">
3-
<a class="nhsuk-header__link nhsuk-header__link--service " href="/" aria-label="NHS homepage">
4-
<svg class="nhsuk-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 16" height="40" width="100">
5-
<path class="nhsuk-logo__background" fill="#005eb8" d="M0 0h40v16H0z"></path>
6-
<path class="nhsuk-logo__text" fill="#fff" d="M3.9 1.5h4.4l2.6 9h.1l1.8-9h3.3l-2.8 13H9l-2.7-9h-.1l-1.8 9H1.1M17.3 1.5h3.6l-1 4.9h4L25 1.5h3.5l-2.7 13h-3.5l1.1-5.6h-4.1l-1.2 5.6h-3.4M37.7 4.4c-.7-.3-1.6-.6-2.9-.6-1.4 0-2.5.2-2.5 1.3 0 1.8 5.1 1.2 5.1 5.1 0 3.6-3.3 4.5-6.4 4.5-1.3 0-2.9-.3-4-.7l.8-2.7c.7.4 2.1.7 3.2.7s2.8-.2 2.8-1.5c0-2.1-5.1-1.3-5.1-5 0-3.4 2.9-4.4 5.8-4.4 1.6 0 3.1.2 4 .6"></path>
7-
</svg>
8-
<span class="nhsuk-header__service-name">
9-
Learning Hub
10-
</span>
11-
</a>
12-
</div>
13-
<div class="nhsuk-header__mobile-only-nav">
14-
</div>
15-
<div class="nhsuk-account__login nhsuk-header__not-mobile">
16-
</div>
2+
<div class="nhsuk-header__logo">
3+
<a class="nhsuk-header__link nhsuk-header__link--service " href="https://@ViewData["ClientUrl"]" aria-label="NHS homepage">
4+
<svg class="nhsuk-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 16" height="40" width="100">
5+
<path class="nhsuk-logo__background" fill="#005eb8" d="M0 0h40v16H0z"></path>
6+
<path class="nhsuk-logo__text" fill="#fff" d="M3.9 1.5h4.4l2.6 9h.1l1.8-9h3.3l-2.8 13H9l-2.7-9h-.1l-1.8 9H1.1M17.3 1.5h3.6l-1 4.9h4L25 1.5h3.5l-2.7 13h-3.5l1.1-5.6h-4.1l-1.2 5.6h-3.4M37.7 4.4c-.7-.3-1.6-.6-2.9-.6-1.4 0-2.5.2-2.5 1.3 0 1.8 5.1 1.2 5.1 5.1 0 3.6-3.3 4.5-6.4 4.5-1.3 0-2.9-.3-4-.7l.8-2.7c.7.4 2.1.7 3.2.7s2.8-.2 2.8-1.5c0-2.1-5.1-1.3-5.1-5 0-3.4 2.9-4.4 5.8-4.4 1.6 0 3.1.2 4 .6"></path>
7+
</svg>
8+
<span class="nhsuk-header__service-name">
9+
Learning Hub
10+
</span>
11+
</a>
12+
</div>
13+
<div class="nhsuk-header__mobile-only-nav">
14+
</div>
15+
<div class="nhsuk-account__login nhsuk-header__not-mobile">
16+
</div>
1717
</div>
1818
@functions {
19-
public string PreLoginClass()
20-
{
21-
if (!User.Identity.IsAuthenticated) return "nhsuk-header__pre-login";
22-
return "";
23-
}
19+
public string PreLoginClass()
20+
{
21+
if (!User.Identity.IsAuthenticated) return "nhsuk-header__pre-login";
22+
return "";
23+
}
2424
}

Auth/LearningHub.Nhs.Auth/Views/Shared/_Signout_Layout.cshtml

Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,49 @@
55
<!DOCTYPE html>
66
<html>
77
<head>
8-
<meta charset="utf-8" />
9-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
10-
<title>@ViewData["Title"] - Learning Hub Authentication</title>
11-
12-
<environment include="Development">
13-
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
14-
<link rel="stylesheet" type="text/css" href="~/css/site.css" />
15-
<link rel="stylesheet" type="text/css" href="~/css/auth.css" />
16-
<link rel="stylesheet" type="text/css" href="~/lib/fontawesome-pro-5.9.0/css/all.css" />
17-
</environment>
18-
<environment exclude="Development">
19-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"
20-
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
21-
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
22-
crossorigin="anonymous"
23-
integrity="sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE=" />
24-
25-
<link rel="stylesheet" type="text/css" href="~/css/site.min.css" />
26-
<link rel="stylesheet" type="text/css" href="~/css/auth.min.css" />
27-
<link rel="stylesheet" type="text/css" href="~/lib/fontawesome-pro-5.9.0/css/all.min.css" />
28-
</environment>
8+
<meta charset="utf-8" />
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
10+
<title>@ViewData["Title"] - Learning Hub Authentication</title>
11+
<link rel="stylesheet" type="text/css" href="~/css/site.css" />
12+
<link rel="stylesheet" type="text/css" href="~/css/auth.css" />
13+
<environment include="Development">
14+
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
15+
<link rel="stylesheet" type="text/css" href="~/lib/fontawesome-pro-5.9.0/css/all.css" />
16+
</environment>
17+
<environment exclude="Development">
18+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"
19+
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
20+
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
21+
crossorigin="anonymous"
22+
integrity="sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE=" />
23+
<link rel="stylesheet" type="text/css" href="~/lib/fontawesome-pro-5.9.0/css/all.min.css" />
24+
</environment>
2925
</head>
3026
<body>
31-
<div class="container-fluid">
32-
<main role="main" id="maincontent" tabindex="-1">
33-
@RenderBody()
34-
</main>
35-
</div>
27+
<div class="container-fluid">
28+
<main role="main" id="maincontent" tabindex="-1">
29+
@RenderBody()
30+
</main>
31+
</div>
3632

37-
<environment include="Development">
38-
<script src="~/lib/jquery/dist/jquery.js"></script>
39-
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
40-
</environment>
41-
<environment exclude="Development">
42-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
43-
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
44-
asp-fallback-test="window.jQuery"
45-
crossorigin="anonymous"
46-
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
47-
</script>
48-
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js"
49-
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
50-
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
51-
crossorigin="anonymous"
52-
integrity="sha256-E/V4cWE4qvAeO5MOhjtGtqDzPndRO1LBk8lJ/PR7CA4=">
53-
</script>
54-
</environment>
55-
@RenderSection("Scripts", required: false)
33+
<environment include="Development">
34+
<script src="~/lib/jquery/dist/jquery.js"></script>
35+
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
36+
</environment>
37+
<environment exclude="Development">
38+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
39+
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
40+
asp-fallback-test="window.jQuery"
41+
crossorigin="anonymous"
42+
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
43+
</script>
44+
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js"
45+
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
46+
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
47+
crossorigin="anonymous"
48+
integrity="sha256-E/V4cWE4qvAeO5MOhjtGtqDzPndRO1LBk8lJ/PR7CA4=">
49+
</script>
50+
</environment>
51+
@RenderSection("Scripts", required: false)
5652
</body>
5753
</html>

0 commit comments

Comments
 (0)