Skip to content

Commit

Permalink
build(1.0.0.1): publish second alpha version
Browse files Browse the repository at this point in the history
Merge pull request #144 from LiveDevTeam/dev
  • Loading branch information
live-dev999 committed Feb 8, 2022
2 parents a1e2de1 + 90dc3c5 commit 9af2163
Show file tree
Hide file tree
Showing 373 changed files with 27,682 additions and 30,168 deletions.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,29 @@ AK name - 'AK_columnName_columnNameId'


## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FLiveDevTeam%2FO2NextGen.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FLiveDevTeam%2FO2NextGen?ref=badge_large)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FLiveDevTeam%2FO2NextGen.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FLiveDevTeam%2FO2NextGen?ref=badge_large)


# Versions

#### Version information for an assembly consists of the following four values:

```
1.0.0.0
```

Description
```
major - Major Version
minor - Minor Version
build number - Build Number
0 - alpha
sample: 1.1.0.1 like (1.1-a.1)
1 - beta
sample: 1.1.1.2 like (1.1-b.2)
2 - release candidate
sample: 1.1.2.1 like (1.1-rc.1)
3 - release
sample: 1.1.3.3 like (1.1-r.3)
revision - git revision
```
Binary file added design/pfr-app/export/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/iOS App Icon Template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_20pt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_20pt@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_20pt@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_29pt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_29pt@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_29pt@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_40pt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_40pt@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_40pt@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_60pt@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_60pt@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_76pt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_76pt@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added design/pfr-app/export/icon_83.5@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace O2NextGen.Web.BFF.Core.Config
{
public class UrlsConfig
{
public string ESenderUrl { get; set; }
public string CGenUrl { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using Microsoft.AspNetCore.Antiforgery;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using O2NextGen.Web.BFF.Core.Features.Auth.Models;

namespace O2NextGen.Web.BFF.Core.Features.Auth
{
[Route("auth")]
public class AuthController : ControllerBase
{
private readonly IAntiforgery _antiForgery;

public AuthController(IAntiforgery antiForgery)
{
_antiForgery = antiForgery;
}

[HttpGet]
[Route("info")]
public ActionResult<AuthInfoModel> GetInfo()
{
var tokens = _antiForgery.GetAndStoreTokens(HttpContext);
HttpContext.Response.Cookies.Append(
"XSRF-TOKEN",
tokens.RequestToken,
//allow JS to grab the cookie to put it in the request header
new CookieOptions() {HttpOnly = false});

return new AuthInfoModel
{
Name = User.FindFirst("name").Value
};
}

/*
* No need to do anything here, as the auth middleware will take care of redirecting to IdentityServer4.
* When the user is authenticated and gets back here, we can redirect to the desired url.
*/
[HttpGet]
[Route("login")]
public IActionResult Login([FromQuery] string returnUrl)
{
return Redirect(string.IsNullOrWhiteSpace(returnUrl) ? "/" : returnUrl);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace O2NextGen.Web.BFF.Core.Features.Auth.Models
{
public class AuthInfoModel
{
public string Name { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;

namespace O2NextGen.Mobile.BFF.Core.Features.CGen
namespace O2NextGen.Web.BFF.Core.Features.C_Gen
{
[Route("api/features/c-gen/[controller]")]
public class CertificatesController : Controller
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;

namespace O2NextGen.Mobile.BFF.Core.Features.CGen
namespace O2NextGen.Web.BFF.Core.Features.C_Gen
{
[Route("api/features/c-gen/[controller]")]
public class VersionController : Controller
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using O2NextGen.Web.BFF.Core.Features.E_Sender.Models;
using O2NextGen.Web.BFF.Core.Features.E_Sender.Services;

namespace O2NextGen.Web.BFF.Core.Features.E_Sender
{
[Route("api/features/e-sender")]
public class ESenderController : Controller
{
private readonly IESenderService _senderService;

public ESenderController(IESenderService senderService)
{
_senderService = senderService;
}

#region Methods

[HttpGet]
[Route("")]
public async Task<IActionResult> GetAllAsync()
{
throw new NotImplementedException();
}

[HttpGet]
[Route("{id}")]
public async Task<IActionResult> GetByIdAsync(long id, CancellationToken ct)
{
var result =await _senderService.GetAsync(id, ct);
return Ok(result);
}

[HttpPut]
[Route("id")]
public async Task<IActionResult> UpdateAsync(long id, [FromBody] MailRequestViewModel model,
CancellationToken ct)
{
throw new NotImplementedException();
}

[HttpPost]
[HttpPut]
[Route("")]
public async Task<IActionResult> AddAsync([FromBody] MailRequestViewModel model, CancellationToken ct)
{
var result = await _senderService.AddAsync(model, ct);
return CreatedAtAction(nameof(GetByIdAsync), new {id = result.Id}, result);
}

#endregion

[HttpDelete]
[Route("id")]
public async Task<IActionResult> RemoveAsync(long id, CancellationToken ct)
{
throw new NotImplementedException();
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace O2NextGen.Web.BFF.Core.Features.E_Sender.Models
{
public class MailRequestViewModel
{
public long Id { get; set; }
public string From { get; set; }
public string To { get; set; }
public string Body { get; set; }
public string Subject { get; set; }
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using O2NextGen.Web.BFF.Core.Config;
using O2NextGen.Web.BFF.Core.Features.E_Sender.Models;

namespace O2NextGen.Web.BFF.Core.Features.E_Sender.Services
{
public class ESenderService: IESenderService
{
private readonly HttpClient _httpClient;
private readonly IOptions<UrlsConfig> _config;
private string ApiVersion { get; } = "1.0";

public ESenderService(HttpClient httpClient, IOptions<UrlsConfig> config)
{
_httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
_config = config ?? throw new ArgumentNullException(nameof(config));
}
public async Task<MailRequestViewModel> AddAsync(MailRequestViewModel model, CancellationToken ct)
{
var response = await _httpClient.PostAsJsonAsync("api/emailsender",model,ct);
return await response.Content.ReadAsAsync<MailRequestViewModel>(ct);
}

public async Task<MailRequestViewModel> GetAsync(long id, CancellationToken ct)
{
var response = await _httpClient.GetAsync($"api/emailsender/{id}",ct);
return await response.Content.ReadAsAsync<MailRequestViewModel>(ct);

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Threading;
using System.Threading.Tasks;
using O2NextGen.Web.BFF.Core.Features.E_Sender.Models;

namespace O2NextGen.Web.BFF.Core.Features.E_Sender.Services
{
public interface IESenderService
{
Task<MailRequestViewModel> AddAsync(MailRequestViewModel model, CancellationToken ct);
Task<MailRequestViewModel> GetAsync(long id, CancellationToken ct);
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;

namespace O2NextGen.Web.BFF.Core.Features.ESender
namespace O2NextGen.Web.BFF.Core.Features.E_Sender
{
[Route("api/features/e-sender/[controller]")]
public class VersionController : Controller
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;

namespace O2NextGen.Web.BFF.Core.Infrastructure
{
public class HttpClientAuthorizationDelegatingHandler
: DelegatingHandler
{
private readonly IHttpContextAccessor _httpContextAccesor;

public HttpClientAuthorizationDelegatingHandler(IHttpContextAccessor httpContextAccesor)
{
_httpContextAccesor = httpContextAccesor;
}

protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request,
CancellationToken cancellationToken)
{
var authorizationHeader = _httpContextAccesor.HttpContext
.Request.Headers["Authorization"];

if (!string.IsNullOrEmpty(authorizationHeader))
{
request.Headers.Add("Authorization", new List<string>() {authorizationHeader});
}

var token = await GetToken();

if (token != null)
{
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
}

return await base.SendAsync(request, cancellationToken);
}

async Task<string> GetToken()
{
const string ACCESS_TOKEN = "access_token";

return await _httpContextAccesor.HttpContext
.GetTokenAsync(ACCESS_TOKEN);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -13,7 +13,9 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.Http.Polly">
<Version>2.2.0</Version>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace O2NextGen.Web.BFF.Core
{
Expand Down
Loading

0 comments on commit 9af2163

Please sign in to comment.