Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
## add it here

#TEST_DOMAIN=local.altinn.cloud
#AMUI_TEST_DOMAIN=am.ui.local.altinn.cloud
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
- NGINX_PORT=80
- TEST_DOMAIN=${TEST_DOMAIN:-local.altinn.cloud}
- HOST_DOMAIN=host.docker.internal
- AMUI_TEST_DOMAIN=${AMUI_TEST_DOMAIN:-am.ui.local.altinn.cloud}
- INTERNAL_DOMAIN=host.docker.internal
- ALTINN3LOCAL_PORT=${ALTINN3LOCAL_PORT:-80}
- NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx/
Expand Down
41 changes: 33 additions & 8 deletions loadbalancer/templates/nginx.conf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ http {
server ${INTERNAL_DOMAIN}:5300;
}

upstream accessmanagementcomp {
server ${INTERNAL_DOMAIN}:5117;
upstream accessmanagementbff {
server ${INTERNAL_DOMAIN}:5110;
}

server {
Expand Down Expand Up @@ -111,11 +111,6 @@ http {
error_page 502 /502Receipt.html;
}

location /accessmanagement/ {
proxy_pass http://accessmanagementcomp/accessmanagement/;
error_page 502 /502Accessmanagement.html;
}

location /storage/ {
proxy_pass http://localtest/storage/;
}
Expand Down Expand Up @@ -144,5 +139,35 @@ http {
root /www;
}

}
}

server {
listen 80;
server_name ${AMUI_TEST_DOMAIN};

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

error_page 502 /502Accessmanagement.html;

location = / {
proxy_pass http://accessmanagementbff/accessmanagment/;
}

location / {
#Support using Local js, when a cookie value is set
sub_filter_once off;
sub_filter 'https://altinncdn.no/toolkits/altinn-app-frontend/3/' $LOCAL_SUB_FILTER;
proxy_pass http://accessmanagementbff/;
error_page 502 /502Accessmanagement.html;
proxy_cookie_domain altinn3local.no local.altinn.cloud;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proxy_cookie_domain should not be required here, and I’m not sure about the sub_filter

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about it either. @TheTechArch @tjololo Do you have any comments on this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You dont need it. Same with Sub filter also I belive. Test without

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@allinox You can remove the sub_filter and proxy_cookie_domain here and test it out before committing the changes to this branch

}

location /502Accessmanagement.html {
root /www;
}

}
}
2 changes: 1 addition & 1 deletion podman-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
environment:
- NGINX_HOST=localhost
- NGINX_PORT=80
- AMUI_TEST_DOMAIN=${AMUI_TEST_DOMAIN:-am.ui.local.altinn.cloud}
- TEST_DOMAIN=${TEST_DOMAIN:-local.altinn.cloud}
- HOST_DOMAIN=host.docker.internal
- INTERNAL_DOMAIN=host.containers.internal
Expand All @@ -41,7 +42,6 @@ services:
- altinntestlocal_network
ports:
- "5070:5070"

altinn_pdf_service:
container_name: altinn-pdf-service
image: browserless/chrome:1-puppeteer-21.3.6
Expand Down
5 changes: 5 additions & 0 deletions src/Configuration/GeneralSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ public string GetBaseUrl
}
}

/// <summary>
/// Gets or sets the hostname for accessmanagement UI
/// </summary>
public string AMHostname { get; set; }

/// <summary>
/// Get value from environment variable with key equals "GeneralSettings__" + propertyName or directly from
/// the property if the environment variable is missing.
Expand Down
4 changes: 2 additions & 2 deletions src/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public async Task<ActionResult> LogInTestUser(string action, StartAppModel start

if (startAppModel.AppPathSelection?.Equals("accessmanagement") == true)
{
return Redirect($"/accessmanagement/ui/given-api-delegations/overview");
return Redirect($"http://{_generalSettings.AMHostname}/accessmanagement/ui/offered-api-delegations/overview");
}

Application app = await _localApp.GetApplicationMetadata(startAppModel.AppPathSelection);
Expand Down Expand Up @@ -320,7 +320,7 @@ private List<SelectListItem> GetAuthenticationLevels(int defaultAuthLevel)
}

private async Task<List<SelectListItem>> GetAppsList()
{
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{
{

var applications = await _localApp.GetApplications();
return applications.Select((kv) => GetSelectItem(kv.Value, kv.Key)).ToList();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Services/LocalApp/Implementation/LocalAppFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private string GetAppConfigFolderPath(string appId)
try
{
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("http://localhost:5117/");
client.BaseAddress = new Uri("http://localhost:5110/");
HttpResponseMessage respnse = await client.GetAsync("swagger/index.html");
if (respnse.StatusCode.Equals(HttpStatusCode.OK))
{
Expand Down
5 changes: 3 additions & 2 deletions src/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public void ConfigureServices(IServiceCollection services)
{
opt.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
opt.JsonSerializerOptions.WriteIndented = true;
opt.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull;
});

services.Configure<Altinn.Common.PEP.Configuration.PepSettings>(Configuration.GetSection("PepSettings"));
Expand Down Expand Up @@ -124,10 +125,10 @@ public void ConfigureServices(IServiceCollection services)
services.AddTransient<IAuthorizationHandler, ClaimAccessHandler>();

// Notifications services

GeneralSettings generalSettings = Configuration.GetSection("GeneralSettings").Get<GeneralSettings>();
services.AddNotificationServices(generalSettings.BaseUrl);

// Storage services
services.AddSingleton<IClaimsPrincipalProvider, ClaimsPrincipalProvider>();
services.AddTransient<IAuthorization, AuthorizationService>();
Expand Down
3 changes: 2 additions & 1 deletion src/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"PlatformEndpoint": "http://localhost:5040/",
"ClaimsIdentity": "UserLogin",
"JwtCookieValidityTime": "960",
"AltinnPartyCookieName": "AltinnPartyId"
"AltinnPartyCookieName": "AltinnPartyId",
"AMHostName": "am.ui.local.altinn.cloud"
},
"CertificateSettings": {
"CertificatePwd": "qwer1234",
Expand Down
14 changes: 14 additions & 0 deletions testdata/Profile/User/20004938.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"UserId": 20004938,
"UserName": "JarleErKul",
"PhoneNumber": "90001337",
"Email": "[email protected]",
"PartyId": 50019992,
"Party": {

},
"UserType": 1,
"ProfileSettingPreference": {
"Language": "nb"
}
}
14 changes: 14 additions & 0 deletions testdata/Profile/User/20020252.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"UserId": 20020252,
"UserName": "Albatross4Ever",
"PhoneNumber": "90001337",
"Email": "[email protected]",
"PartyId": 50707389,
"Party": {

},
"UserType": 1,
"ProfileSettingPreference": {
"Language": "nb"
}
}
16 changes: 16 additions & 0 deletions testdata/Register/Org/313523497.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"OrgNumber": "313523497",
"Name": "RAKRYGGET UNG TIGER AS",
"UnitType": "AS",
"TelephoneNumber": "12345678",
"MobileNumber": "92010000",
"FaxNumber": "92110000",
"EMailAddress": "[email protected]",
"InternetAddress": "http://vikesaa.no",
"MailingAddress": "Albatross Gate 1",
"MailingPostalCode": "0170",
"MailingPostalCity": "Moss",
"BusinessAddress": "Albatross Gate 1",
"BusinessPostalCode": "0170",
"BusinessPostalCity": "Moss"
}
16 changes: 16 additions & 0 deletions testdata/Register/Org/910510789.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"OrgNumber": "910510789",
"Name": "VIKESÅ OG ÅLVUNDFJORD",
"UnitType": "AS",
"TelephoneNumber": "12345678",
"MobileNumber": "92010000",
"FaxNumber": "92110000",
"EMailAddress": "[email protected]",
"InternetAddress": "http://vikesaa.no",
"MailingAddress": "Jarles Gate 1",
"MailingPostalCode": "0170",
"MailingPostalCity": "Oslo",
"BusinessAddress": "Jarles Gate 1",
"BusinessPostalCode": "0170",
"BusinessPostalCity": "By"
}
13 changes: 13 additions & 0 deletions testdata/Register/Party/50019992.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"partyId": "50019992",
"partyTypeName": 1,
"orgNumber": null,
"ssn": "09026102194",
"unitType": null,
"name": "JARLE GJERSTAD",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organisation": null,
"childParties": null
}
13 changes: 13 additions & 0 deletions testdata/Register/Party/50067798.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"partyId": "50067798",
"partyTypeName": 2,
"orgNumber": "910510789",
"ssn": null,
"unitType": "AS",
"name": "VIKESÅ OG ÅLVUNDFJORD",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organisation": null,
"childParties": null
}
13 changes: 13 additions & 0 deletions testdata/Register/Party/50707389.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"partyId": "50707389",
"partyTypeName": 1,
"orgNumber": null,
"ssn": "19895199357",
"unitType": null,
"name": "INTELLIGENT ALBATROSS",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organisation": null,
"childParties": null
}
13 changes: 13 additions & 0 deletions testdata/Register/Party/51317934.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"partyId": "51317934",
"partyTypeName": 2,
"orgNumber": "313523497",
"ssn": null,
"unitType": "AS",
"name": "RAKRYGGET UNG TIGER AS",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organisation": null,
"childParties": null
}
19 changes: 19 additions & 0 deletions testdata/Register/Person/09026102194.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"SSN": "09026102194",
"Name": " JARLE GJERSTAD",
"FirstName": "Jarle",
"MiddleName": "",
"LastName": "Gjerstad",
"TelephoneNumber": "123456789",
"MobileNumber": "987654321",
"MailingAddress": "Hardangervegen 11",
"MailingPostalCode": "0157",
"MailingPostalCity": "Oslo",
"AddressMunicipalNumber": "0301",
"AddressMunicipalName": "Oslo",
"AddressStreetName": "Hardangervegen",
"AddressHouseNumber": "11",
"AddressHouseLetter": null,
"AddressPostalCode": "0151",
"AddressCity": "Oslo"
}
19 changes: 19 additions & 0 deletions testdata/Register/Person/19895199357.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"SSN": "19895199357",
"Name": " INTELLIGENT ALBATROSS",
"FirstName": "Intelligent",
"MiddleName": "",
"LastName": "Albatross",
"TelephoneNumber": "123456789",
"MobileNumber": "987654321",
"MailingAddress": "Måkeøya 11",
"MailingPostalCode": "0157",
"MailingPostalCity": "Moss",
"AddressMunicipalNumber": "0301",
"AddressMunicipalName": "Moss",
"AddressStreetName": "Måkeøya",
"AddressHouseNumber": "11",
"AddressHouseLetter": null,
"AddressPostalCode": "0151",
"AddressCity": "Moss"
}
26 changes: 26 additions & 0 deletions testdata/authorization/partylist/20004938.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"partyId": "50019992",
"partyTypeName": 1,
"ssn": "09026102194",
"unitType": null,
"name": "JARLE GJERSTAD",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organisation": null,
"childParties": null
},
{
"partyId": "50067798",
"partyTypeName": 2,
"OrgNumber": "910510789",
"unitType": "AS",
"name": " VIKESÅ OG ÅLVUNDFJORD",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organisation": null,
"childParties": null
}
]
26 changes: 26 additions & 0 deletions testdata/authorization/partylist/20020252.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"partyId": "50707389",
"partyTypeName": 1,
"ssn": "19895199357",
"unitType": null,
"name": "INTELLIGENT ALBATROSS",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organisation": null,
"childParties": null
},
{
"partyId": "51317934",
"partyTypeName": 2,
"OrgNumber": "313523497",
"unitType": "AS",
"name": "RAKRYGGET UNG TIGER AS",
"isDeleted": false,
"onlyHierarchyElementWithNoAccess": false,
"person": null,
"organisation": null,
"childParties": null
}
]
2 changes: 1 addition & 1 deletion testdata/authorization/resources/Appid_400.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"keywords": null,
"validFrom": "2020-03-04T18:04:27.27",
"identifier": "appid-400",
"isComplete": false,
"isComplete": true,
"description": {
"en": "Humbug Registry",
"nb": "Tulleregisteret",
Expand Down
2 changes: 1 addition & 1 deletion testdata/authorization/resources/Appid_401.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"keywords": null,
"validFrom": "2020-03-04T18:04:27.27",
"identifier": "appid-401",
"isComplete": false,
"isComplete": true,
"description": {
"en": "The Flowergarden",
"nb": "Blomsterhagen",
Expand Down
2 changes: 1 addition & 1 deletion testdata/authorization/resources/Appid_402.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"keywords": null,
"validFrom": "2020-03-04T18:04:27.27",
"identifier": "appid-402",
"isComplete": false,
"isComplete": true,
"description": {
"en": "The Magic Closet",
"nb": "Det magiske klesskapet",
Expand Down
Loading