├── src ├── KubernetesWrapper │ ├── .dockerignore │ ├── appsettings.json │ ├── appsettings.Development.json │ ├── Models │ │ ├── DaemonSet.cs │ │ ├── Deployment.cs │ │ ├── ResourceType.cs │ │ └── DeployedResource.cs │ ├── Dockerfile │ ├── Properties │ │ └── launchSettings.json │ ├── KubernetesWrapper.csproj │ ├── Program.cs │ ├── Controllers │ │ ├── DaemonSetsController.cs │ │ └── DeploymentsController.cs │ └── Services │ │ ├── Interfaces │ │ └── IKubernetesAPIWrapper.cs │ │ └── Implementation │ │ └── KubernetesApiWrapper.cs └── Altinn.KubernetesWrapper.sln ├── renovate.json ├── .vscode ├── extensions.json ├── tasks.json ├── settings.json └── launch.json ├── .github └── workflows │ ├── add-to-project.yml │ ├── integrationtests-kind.yaml │ └── codeql.yml ├── README.md ├── .editorconfig ├── Makefile ├── integrationtests ├── curl-test.sh └── kubewrapper.yaml ├── LICENSE.md ├── stylecop.json ├── .gitattributes ├── Altinn3.ruleset ├── Settings.StyleCop └── .gitignore /src/KubernetesWrapper/.dockerignore: -------------------------------------------------------------------------------- 1 | */bin 2 | */obj 3 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "local>Altinn/renovate-config" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/Models/DaemonSet.cs: -------------------------------------------------------------------------------- 1 | namespace KubernetesWrapper.Models 2 | { 3 | /// 4 | /// Class describing a daemon set 5 | /// 6 | public class DaemonSet : DeployedResource 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/Models/Deployment.cs: -------------------------------------------------------------------------------- 1 | namespace KubernetesWrapper.Models 2 | { 3 | /// 4 | /// Class describing a deployment 5 | /// 6 | public class Deployment : DeployedResource 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/Models/ResourceType.cs: -------------------------------------------------------------------------------- 1 | namespace KubernetesWrapper.Models 2 | { 3 | /// 4 | /// Enum class descibing deployed entity types 5 | /// 6 | public enum ResourceType 7 | { 8 | Deployment, 9 | DaemonSet 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "github.vscode-pull-request-github", 5 | "hediet.vscode-drawio", 6 | "ms-azuretools.vscode-docker", 7 | "ms-dotnettools.csharp", 8 | "ms-vscode-remote.remote-containers", 9 | "ms-vsliveshare.vsliveshare", 10 | "esbenp.prettier-vscode", 11 | "editorconfig.editorconfig" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.github/workflows/add-to-project.yml: -------------------------------------------------------------------------------- 1 | name: Add new issues to Team Apps project 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | 8 | jobs: 9 | add-to-project: 10 | name: Add issue to Team Apps project 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/add-to-project@main 14 | with: 15 | project-url: https://github.com/orgs/Altinn/projects/39 16 | github-token: ${{ secrets.ASSIGN_PROJECT_TOKEN }} 17 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:7.0.400-alpine3.17 AS build 2 | WORKDIR /app 3 | 4 | # Copy csproj and restore as distinct layers 5 | COPY *.csproj ./ 6 | RUN dotnet restore 7 | 8 | # Copy everything else and build 9 | COPY . ./ 10 | RUN dotnet publish -c Release -o out 11 | 12 | # Build runtime image 13 | FROM mcr.microsoft.com/dotnet/aspnet:7.0.10-alpine3.17 AS final 14 | WORKDIR /app 15 | COPY --from=build /app/out . 16 | ENTRYPOINT ["dotnet", "KubernetesWrapper.dll"] 17 | -------------------------------------------------------------------------------- /.github/workflows/integrationtests-kind.yaml: -------------------------------------------------------------------------------- 1 | name: "Integrationtests" 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | # The branches below must be a subset of the branches above 8 | branches: [ "main" ] 9 | 10 | jobs: 11 | integrationtests: 12 | name: Deploy and run test against a kind cluster 13 | runs-on: ubuntu-latest 14 | permissions: 15 | contents: read 16 | 17 | steps: 18 | - name: Checkout repository 19 | uses: actions/checkout@v4 20 | - name: Run integration tests 21 | run: | 22 | make test 23 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/Models/DeployedResource.cs: -------------------------------------------------------------------------------- 1 | namespace KubernetesWrapper.Models 2 | { 3 | /// 4 | /// Class describing a deployed entity i kubernetes 5 | /// 6 | public abstract class DeployedResource 7 | { 8 | /// 9 | /// Gets or sets the version of the deployed entity, the image tag number 10 | /// 11 | public string Version { get; set; } 12 | 13 | /// 14 | /// Gets or sets release name 15 | /// 16 | public string Release { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://code.visualstudio.com/docs/editor/tasks for documentation about the tasks.json format 3 | "version": "2.0.0", 4 | "command": "dotnet", 5 | "isShellCommand": true, 6 | "args": [], 7 | "tasks": [ 8 | { 9 | "taskName": "restore", 10 | "isBuildCommand": false, 11 | "showOutput": "always" 12 | }, 13 | { 14 | "taskName": "build", 15 | "isBuildCommand": true, 16 | "showOutput": "always", 17 | "problemMatcher": "$msCompile" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes Wrapper 2 | Application exposing information about deployments in kubernetes in a rest API 3 | 4 | ## Testing 5 | 6 | ### Linux and macOS 7 | To test kuberneteswrapper in a kubernetes cluster (kind) lokally run the following command 8 | 9 | ```shell 10 | make test 11 | ``` 12 | 13 | This will do the following 14 | 1. create a kind kubernetescluster 15 | 2. build kuberneteswrapper docker image 16 | 3. load the image into kind 17 | 4. deploy kuberneteswrapper and test services 18 | 5. add portfowrward to the kuberneteswrapper service in kind 19 | 6. test that kuberneteswrapper produces the expected responses 20 | 21 | After the test command is executed a portforward on port 8080 is left intact if you want to execute api calls to kuberneteswrapper 22 | 23 | To clean up after you are done testing run: 24 | 25 | ```shell 26 | make clean 27 | ``` -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Default settings: 7 | # A newline ending every file 8 | # Use 4 spaces as indentation 9 | [*] 10 | insert_final_newline = true 11 | indent_style = space 12 | indent_size = 2 13 | trim_trailing_whitespace = true 14 | charset = utf-8 15 | 16 | [*.json] 17 | indent_size = 2 18 | 19 | [*.cs] 20 | indent_size = 4 21 | # IDE0090: Use 'new(...)' 22 | csharp_style_implicit_object_creation_when_type_is_apparent = false 23 | 24 | 25 | # Xml project files 26 | [*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj,xproj}] 27 | indent_size = 2 28 | 29 | # Xml files 30 | [*.{xml,xsd,stylecop,resx,ruleset}] 31 | indent_size = 2 32 | 33 | # Xml config files 34 | [*.{props,targets,config,nuspec}] 35 | indent_size = 2 36 | 37 | # Shell scripts 38 | [*.sh] 39 | end_of_line = lf 40 | [*.{cmd, bat}] 41 | end_of_line = crlf 42 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:20960", 8 | "sslPort": 44375 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "api/v1/deployments", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "KubernetesWrapper": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "api/v1/deployments", 24 | "applicationUrl": "http://localhost:5004", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "[csharp]": { 4 | "editor.tabSize": 4 5 | }, 6 | "editor.tabSize": 2, 7 | "editor.insertSpaces": true, 8 | "editor.detectIndentation": false, 9 | "editor.rulers": [80], 10 | "search.exclude": { 11 | "**/node_modules": true, 12 | "**/bower_components": true, 13 | "**/bin": true, 14 | "**/obj": true, 15 | "**/publish/**": true, 16 | "**/Debug": true 17 | }, 18 | "typescript.surveys.enabled": false, 19 | "cSpell.words": ["api", "i", "kubernetes", "wrapper"], 20 | "java.configuration.updateBuildConfiguration": "interactive", 21 | "eslint.workingDirectories": [ 22 | { "directory": "./src/studio/src/designer/frontend", "changeProcessCWD": true }, 23 | { "directory": "./src/Altinn.Apps/AppFrontend/react", "changeProcessCWD": true } 24 | ], 25 | "editor.codeActionsOnSave": { "source.fixAll": true } 26 | } 27 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: setup-kind 2 | setup-kind: 3 | kind create cluster 4 | 5 | .PHONY: build-docker-image 6 | build-docker-image: 7 | docker build src/KubernetesWrapper -t altinn-kuberneteswrapper:local 8 | 9 | .PHONY: load-image 10 | load-image: build-docker-image 11 | kind load docker-image altinn-kuberneteswrapper:local 12 | 13 | .PHONY: deploy-components 14 | deploy-components: load-image 15 | kubectl delete -f integrationtests/kubewrapper.yaml --ignore-not-found 16 | kubectl apply -f integrationtests/kubewrapper.yaml 17 | 18 | .PHONY: port-forward 19 | port-forward: 20 | kubectl wait deployment -n default kuberneteswrapper --for condition=Available=True --timeout=90s 21 | kubectl port-forward svc/kuberneteswrapper 8080:8080 & 22 | sleep 5 23 | 24 | .PHONY: build 25 | build: setup-kind deploy-components 26 | 27 | .PHONY: run-test 28 | run-test: 29 | ./integrationtests/curl-test.sh 30 | 31 | .PHONY: test 32 | test: build run-test clean 33 | 34 | .PHONY: clean 35 | clean: 36 | kind delete cluster 37 | -------------------------------------------------------------------------------- /integrationtests/curl-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | kubectl wait deployment -n default kuberneteswrapper --for condition=Available=True --timeout=90s 3 | kubectl port-forward svc/kuberneteswrapper 8080:8080 & 4 | PORTFORWARD_PID=$! 5 | sleep 5 # Wait for portforward to be ready 6 | expectedDeployment='[{"version":"1.23.2-alpine","release":"dummy-deployment"},{"version":"local","release":"kuberneteswrapper"}]' 7 | expectedDaemonsets='[{"version":"1.23.2-alpine","release":"dummy-daemonset"}]' 8 | actualDeployment=$(curl http://localhost:8080/api/v1/deployments --silent) 9 | test $expectedDeployment = $actualDeployment 10 | if [ $? -gt 0 ] 11 | then 12 | echo "Deployment test failed" 13 | echo "Exp: $expectedDeployment" 14 | echo "Got: $actualDeployment" 15 | exit 1 16 | else 17 | echo "Deployment tests ran OK" 18 | fi 19 | 20 | actualDaemonsets=$(curl http://localhost:8080/api/v1/daemonsets --silent) 21 | test $expectedDaemonsets = $actualDaemonsets 22 | if [ $? -gt 0 ] 23 | then 24 | echo "DaemonsetsTest failed" 25 | echo "Exp: $expectedDaemonsets" 26 | echo "Got: $actualDaemonsets" 27 | exit 1 28 | else 29 | echo "Daemonsets tests ran OK" 30 | fi 31 | kill $PORTFORWARD_PID 32 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/KubernetesWrapper.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | 6 | {1eba5dd5-58eb-4f50-be1d-f30fd9fd326d} 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | all 18 | runtime; build; native; contentfiles; analyzers 19 | 20 | 21 | stylecop.json 22 | 23 | 24 | 25 | 26 | ..\..\Altinn3.ruleset 27 | 28 | 29 | 30 | true 31 | $(NoWarn);1591 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2017, Altinn 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | * Neither the name of Altinn nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | // ACTION REQUIRED: This file was automatically added to your project, but it 3 | // will not take effect until additional steps are taken to enable it. See the 4 | // following page for additional information: 5 | // 6 | // https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/EnableConfiguration.md 7 | 8 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", 9 | "settings": { 10 | "documentationRules": { 11 | "companyName": "PlaceholderCompany" 12 | }, 13 | "orderingRules": { 14 | "usingDirectivesPlacement": "outsideNamespace", 15 | "systemUsingDirectivesFirst": true, 16 | "blankLinesBetweenUsingGroups": "allow" 17 | }, 18 | "namingRules": { 19 | "allowCommonHungarianPrefixes": true, 20 | "allowedHungarianPrefixes": [ 21 | "as", 22 | "d", 23 | "db", 24 | "dn", 25 | "do", 26 | "dr", 27 | "ds", 28 | "dt", 29 | "e", 30 | "e2", 31 | "er", 32 | "f", 33 | "fs", 34 | "go", 35 | "id", 36 | "if", 37 | "in", 38 | "ip", 39 | "is", 40 | "js", 41 | "li", 42 | "my", 43 | "no", 44 | "ns", 45 | "on", 46 | "or", 47 | "pi", 48 | "pv", 49 | "sa", 50 | "sb", 51 | "se", 52 | "si", 53 | "so", 54 | "sp", 55 | "tc", 56 | "to", 57 | "tr", 58 | "ui", 59 | "un", 60 | "wf", 61 | "ws", 62 | "x", 63 | "y", 64 | "j", 65 | "js" 66 | ] 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/Altinn.KubernetesWrapper.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30517.126 5 | MinimumVisualStudioVersion = 15.0.26124.0 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KubernetesWrapper", "KubernetesWrapper\KubernetesWrapper.csproj", "{1EBA5DD5-58EB-4F50-BE1D-F30FD9FD326D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {1EBA5DD5-58EB-4F50-BE1D-F30FD9FD326D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {1EBA5DD5-58EB-4F50-BE1D-F30FD9FD326D}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {1EBA5DD5-58EB-4F50-BE1D-F30FD9FD326D}.Debug|x64.ActiveCfg = Debug|Any CPU 21 | {1EBA5DD5-58EB-4F50-BE1D-F30FD9FD326D}.Debug|x64.Build.0 = Debug|Any CPU 22 | {1EBA5DD5-58EB-4F50-BE1D-F30FD9FD326D}.Debug|x86.ActiveCfg = Debug|Any CPU 23 | {1EBA5DD5-58EB-4F50-BE1D-F30FD9FD326D}.Debug|x86.Build.0 = Debug|Any CPU 24 | {1EBA5DD5-58EB-4F50-BE1D-F30FD9FD326D}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {1EBA5DD5-58EB-4F50-BE1D-F30FD9FD326D}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {1EBA5DD5-58EB-4F50-BE1D-F30FD9FD326D}.Release|x64.ActiveCfg = Release|Any CPU 27 | {1EBA5DD5-58EB-4F50-BE1D-F30FD9FD326D}.Release|x64.Build.0 = Release|Any CPU 28 | {1EBA5DD5-58EB-4F50-BE1D-F30FD9FD326D}.Release|x86.ActiveCfg = Release|Any CPU 29 | {1EBA5DD5-58EB-4F50-BE1D-F30FD9FD326D}.Release|x86.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {14484280-61CE-4792-BE1C-CA330E0B1894} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [{ 4 | "name": ".NET Core Attach", 5 | "type": "coreclr", 6 | "request": "attach", 7 | "processId": "${command:pickProcess}" 8 | }, 9 | { 10 | "name": "Google Chrome", 11 | "type": "coreclr", 12 | "request": "launch", 13 | "env": { 14 | "ASPNETCORE_ENVIRONMENT": "Development" 15 | }, 16 | "preLaunchTask": "build", 17 | "internalConsoleOptions": "openOnSessionStart", 18 | "program": "${workspaceRoot}/src/AltinnCore/Designer/bin/Debug/netcoreapp2.2/AltinnCore.Designer.dll", 19 | "args": [], 20 | "cwd": "${workspaceRoot}/src/AltinnCore/Designer", 21 | "stopAtEntry": false, 22 | "launchBrowser": { 23 | "enabled": true, 24 | "args": "${auto-detect-url}", 25 | "windows": { 26 | "command": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe" 27 | }, 28 | "osx": { 29 | "command": "open", 30 | "args": "-b com.google.Chrome ${auto-detect-url}" 31 | }, 32 | "linux": { 33 | "command": "/usr/bin/google-chrome" 34 | } 35 | } 36 | }, 37 | { 38 | "name": ".NET Core Launch (web)", 39 | "type": "coreclr", 40 | "request": "launch", 41 | "env": { 42 | "ASPNETCORE_ENVIRONMENT": "Development" 43 | }, 44 | "preLaunchTask": "build", 45 | "internalConsoleOptions": "openOnSessionStart", 46 | "program": "${workspaceRoot}/src/AltinnCore/Designer/bin/Debug/netcoreapp2.2/AltinnCore.Designer.dll", 47 | "args": [], 48 | "cwd": "${workspaceRoot}/src/AltinnCore/Designer", 49 | "stopAtEntry": false, 50 | "launchBrowser": { 51 | "enabled": true, 52 | "args": "${auto-detect-url}", 53 | "windows": { 54 | "command": "cmd.exe", 55 | "args": "/C start ${auto-detect-url}" 56 | }, 57 | "osx": { 58 | "command": "open" 59 | }, 60 | "linux": { 61 | "command": "xdg-open" 62 | } 63 | } 64 | } 65 | ] 66 | } 67 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/Program.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | using KubernetesWrapper.Services.Implementation; 4 | using KubernetesWrapper.Services.Interfaces; 5 | 6 | using Microsoft.OpenApi.Models; 7 | 8 | using Swashbuckle.AspNetCore.SwaggerGen; 9 | 10 | var builder = WebApplication.CreateBuilder(args); 11 | 12 | RegisterServices(builder.Services); 13 | 14 | var app = builder.Build(); 15 | 16 | ConfigureApp(app); 17 | 18 | app.Run(); 19 | 20 | static void ConfigureApp(WebApplication app) 21 | { 22 | if (!app.Environment.IsDevelopment()) 23 | { 24 | app.UseHsts(); 25 | } 26 | else 27 | { 28 | app.UseDeveloperExceptionPage(); 29 | } 30 | 31 | app.UseSwagger(o => o.RouteTemplate = "kuberneteswrapper/swagger/{documentName}/swagger.json"); 32 | 33 | app.UseSwaggerUI(c => 34 | { 35 | c.SwaggerEndpoint("/kuberneteswrapper/swagger/v1/swagger.json", "Altinn Platform kuberneteswrapper API"); 36 | c.RoutePrefix = "kuberneteswrapper/swagger"; 37 | }); 38 | 39 | // app.UseRouting(); 40 | app.UseCors(); 41 | app.MapControllers(); 42 | } 43 | 44 | static void RegisterServices(IServiceCollection services) 45 | { 46 | services.AddCors(options => 47 | { 48 | options.AddDefaultPolicy(builder => 49 | { 50 | builder.AllowAnyOrigin(); 51 | builder.WithMethods("GET"); 52 | builder.AllowAnyHeader(); 53 | }); 54 | }); 55 | services.AddControllers(); 56 | services.AddSingleton(); 57 | 58 | services.AddSwaggerGen(c => 59 | { 60 | c.SwaggerDoc("v1", new OpenApiInfo { Title = "Altinn Kuberneteswrapper", Version = "v1" }); 61 | IncludeXmlComments(c); 62 | }); 63 | } 64 | 65 | static void IncludeXmlComments(SwaggerGenOptions swaggerGenOptions) 66 | { 67 | try 68 | { 69 | string xmlFile = $"{Assembly.GetEntryAssembly().GetName().Name}.xml"; 70 | string xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); 71 | swaggerGenOptions.IncludeXmlComments(xmlPath); 72 | } 73 | catch 74 | { 75 | // not critical for the application 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/Controllers/DaemonSetsController.cs: -------------------------------------------------------------------------------- 1 | using KubernetesWrapper.Services.Interfaces; 2 | 3 | using Microsoft.AspNetCore.Cors; 4 | using Microsoft.AspNetCore.Mvc; 5 | 6 | namespace KubernetesWrapper.Controllers 7 | { 8 | /// 9 | /// Controller containing all actions related to kubernetes deamon set 10 | /// 11 | [Route("api/v1/[controller]")] 12 | [ApiController] 13 | public class DaemonSetsController : ControllerBase 14 | { 15 | private readonly IKubernetesApiWrapper _apiWrapper; 16 | private readonly ILogger _logger; 17 | 18 | /// 19 | /// Initializes a new instance of the class 20 | /// 21 | /// The kubernetes api wrapper client 22 | /// The logger 23 | public DaemonSetsController(IKubernetesApiWrapper apiWrapper, ILogger logger) 24 | { 25 | _apiWrapper = apiWrapper; 26 | _logger = logger; 27 | } 28 | 29 | /// 30 | /// Get a list of daemonSets. For a more detailed spec of parameters see Kubernetes API DOC 31 | /// 32 | /// A selector to restrict the list of returned objects by their labels. Defaults to everything. 33 | /// A selector to restrict the list of returned objects by their fields. Defaults to everything. 34 | /// A list of daemonSets in the cluster 35 | [HttpGet] 36 | [EnableCors] 37 | public async Task GetDaemonSets(string labelSelector, string fieldSelector) 38 | { 39 | try 40 | { 41 | var daemonSets = await _apiWrapper.GetDeployedResources(Models.ResourceType.DaemonSet, null, null, fieldSelector, labelSelector); 42 | return Ok(daemonSets); 43 | } 44 | catch (Exception e) 45 | { 46 | _logger.LogError(e, "Unable to GetDaemonSets"); 47 | return StatusCode(500); 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/Controllers/DeploymentsController.cs: -------------------------------------------------------------------------------- 1 | using KubernetesWrapper.Services.Interfaces; 2 | 3 | using Microsoft.AspNetCore.Cors; 4 | using Microsoft.AspNetCore.Mvc; 5 | 6 | namespace KubernetesWrapper.Controllers 7 | { 8 | /// 9 | /// Controller containing all actions related to kubernetes deployments 10 | /// 11 | [Route("api/v1/[controller]")] 12 | [ApiController] 13 | public class DeploymentsController : ControllerBase 14 | { 15 | private readonly IKubernetesApiWrapper _apiWrapper; 16 | private readonly ILogger _logger; 17 | 18 | /// 19 | /// Initializes a new instance of the class 20 | /// 21 | /// The kubernetes api wrapper client 22 | /// The logger 23 | public DeploymentsController(IKubernetesApiWrapper apiWrapper, ILogger logger) 24 | { 25 | _apiWrapper = apiWrapper; 26 | _logger = logger; 27 | } 28 | 29 | /// 30 | /// Get a list of deployments. For a more detailed spec of parameters see Kubernetes API DOC 31 | /// 32 | /// A selector to restrict the list of returned objects by their labels. Defaults to everything. 33 | /// A selector to restrict the list of returned objects by their fields. Defaults to everything. 34 | /// A list of deployments in the cluster 35 | [HttpGet] 36 | [EnableCors] 37 | public async Task GetDeployments(string labelSelector, string fieldSelector) 38 | { 39 | try 40 | { 41 | var deployments = await _apiWrapper.GetDeployedResources(Models.ResourceType.Deployment, null, null, fieldSelector, labelSelector); 42 | return Ok(deployments); 43 | } 44 | catch (Exception e) 45 | { 46 | _logger.LogError(e, "Unable to GetDeployments"); 47 | return StatusCode(500); 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/Services/Interfaces/IKubernetesAPIWrapper.cs: -------------------------------------------------------------------------------- 1 | using KubernetesWrapper.Models; 2 | 3 | namespace KubernetesWrapper.Services.Interfaces 4 | { 5 | /// 6 | /// Interface for the kubernetes api wrapper 7 | /// 8 | public interface IKubernetesApiWrapper 9 | { 10 | /// 11 | /// Gets a list of deployed resources of a given type in the cluster. Parameters are described in further detail in the kubernetes api doc. 12 | /// 13 | /// The deployed resource type to retrieve. 14 | /// Continue parameter. Defaults to null. 15 | /// allowWatchBookmarks requests watch events with type "BOOKMARK". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. 16 | /// A selector to restrict the list of returned objects by their fields. Defaults to everything 17 | /// A selector to restrict the list of returned objects by their labels. Defaults to everything 18 | /// Limits the response length. 19 | /// Resource versions type 20 | /// Timeout in seconds 21 | /// Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. 22 | /// If 'true', then the output is pretty printed. 23 | /// A list of deployments 24 | Task> GetDeployedResources( 25 | ResourceType resourceType, 26 | string continueParameter = null, 27 | bool? allowWatchBookmarks = null, 28 | string fieldSelector = null, 29 | string labelSelector = null, 30 | int? limit = null, 31 | string resourceVersion = null, 32 | int? timeoutSeconds = null, 33 | bool? watch = null, 34 | bool? pretty = null); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ "main" ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ "main" ] 20 | schedule: 21 | - cron: '45 11 * * 3' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: [ 'csharp' ] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 37 | # Use only 'java' to analyze code written in Java, Kotlin or both 38 | # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both 39 | # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support 40 | 41 | steps: 42 | - name: Checkout repository 43 | uses: actions/checkout@v4 44 | 45 | # Initializes the CodeQL tools for scanning. 46 | - name: Initialize CodeQL 47 | uses: github/codeql-action/init@v3 48 | with: 49 | languages: ${{ matrix.language }} 50 | # If you wish to specify custom queries, you can do so here or in a config file. 51 | # By default, queries listed here will override any specified in a config file. 52 | # Prefix the list here with "+" to use these queries and those in the config file. 53 | 54 | # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs 55 | # queries: security-extended,security-and-quality 56 | 57 | 58 | # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). 59 | # If this step fails, then you should remove it and run the build manually (see below) 60 | - name: Autobuild 61 | uses: github/codeql-action/autobuild@v3 62 | 63 | # ℹ️ Command-line programs to run using the OS shell. 64 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun 65 | 66 | # If the Autobuild fails above, remove it and uncomment the following three lines. 67 | # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. 68 | 69 | # - run: | 70 | # echo "Run, Build Application using script" 71 | # ./location_of_script_within_repo/buildscript.sh 72 | 73 | - name: Perform CodeQL Analysis 74 | uses: github/codeql-action/analyze@v3 75 | with: 76 | category: "/language:${{matrix.language}}" 77 | -------------------------------------------------------------------------------- /integrationtests/kubewrapper.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | creationTimestamp: null 5 | name: kuberneteswrapper 6 | --- 7 | apiVersion: rbac.authorization.k8s.io/v1 8 | kind: Role 9 | metadata: 10 | creationTimestamp: null 11 | name: kuberneteswrapper 12 | rules: 13 | - apiGroups: 14 | - apps 15 | resources: 16 | - deployments 17 | - daemonsets 18 | verbs: 19 | - get 20 | - list 21 | - watch 22 | --- 23 | apiVersion: rbac.authorization.k8s.io/v1 24 | kind: RoleBinding 25 | metadata: 26 | creationTimestamp: null 27 | name: kuberneteswrapper 28 | roleRef: 29 | apiGroup: rbac.authorization.k8s.io 30 | kind: Role 31 | name: kuberneteswrapper 32 | subjects: 33 | - kind: ServiceAccount 34 | name: kuberneteswrapper 35 | namespace: default 36 | --- 37 | apiVersion: apps/v1 38 | kind: Deployment 39 | metadata: 40 | creationTimestamp: null 41 | labels: 42 | app: kuberneteswrapper 43 | release: kuberneteswrapper 44 | name: kuberneteswrapper 45 | spec: 46 | replicas: 1 47 | selector: 48 | matchLabels: 49 | app: kuberneteswrapper 50 | strategy: {} 51 | template: 52 | metadata: 53 | creationTimestamp: null 54 | labels: 55 | app: kuberneteswrapper 56 | release: kuberneteswrapper 57 | spec: 58 | serviceAccountName: kuberneteswrapper 59 | containers: 60 | - image: altinn-kuberneteswrapper:local 61 | name: altinn-kuberneteswrapper 62 | ports: 63 | - containerPort: 80 64 | resources: {} 65 | --- 66 | apiVersion: v1 67 | kind: Service 68 | metadata: 69 | creationTimestamp: null 70 | labels: 71 | app: kuberneteswrapper 72 | name: kuberneteswrapper 73 | spec: 74 | ports: 75 | - port: 8080 76 | protocol: TCP 77 | targetPort: 80 78 | selector: 79 | app: kuberneteswrapper 80 | --- 81 | apiVersion: apps/v1 82 | kind: Deployment 83 | metadata: 84 | creationTimestamp: null 85 | labels: 86 | app: dummy-deployment 87 | release: dummy-deployment 88 | name: dummy-deployment 89 | spec: 90 | replicas: 1 91 | selector: 92 | matchLabels: 93 | app: dummy-deployment 94 | strategy: {} 95 | template: 96 | metadata: 97 | creationTimestamp: null 98 | labels: 99 | app: dummy-deployment 100 | spec: 101 | containers: 102 | - image: nginx:1.23.2-alpine 103 | name: nginx 104 | ports: 105 | - containerPort: 8080 106 | resources: {} 107 | --- 108 | apiVersion: apps/v1 109 | kind: DaemonSet 110 | metadata: 111 | creationTimestamp: null 112 | labels: 113 | app: dummy-daemonset 114 | release: dummy-daemonset 115 | name: dummy-daemonset 116 | spec: 117 | selector: 118 | matchLabels: 119 | app: dummy-daemonset 120 | template: 121 | metadata: 122 | creationTimestamp: null 123 | labels: 124 | app: dummy-daemonset 125 | spec: 126 | containers: 127 | - image: nginx:1.23.2-alpine 128 | name: nginx 129 | ports: 130 | - containerPort: 8080 131 | resources: {} 132 | -------------------------------------------------------------------------------- /src/KubernetesWrapper/Services/Implementation/KubernetesApiWrapper.cs: -------------------------------------------------------------------------------- 1 | using k8s; 2 | using k8s.Models; 3 | 4 | using KubernetesWrapper.Models; 5 | using KubernetesWrapper.Services.Interfaces; 6 | 7 | namespace KubernetesWrapper.Services.Implementation 8 | { 9 | /// 10 | /// An implementation of the Kubernetes API wrapper 11 | /// 12 | public class KubernetesApiWrapper : IKubernetesApiWrapper 13 | { 14 | private readonly Kubernetes _client; 15 | private readonly ILogger _logger; 16 | 17 | /// 18 | /// Initializes a new instance of the class 19 | /// 20 | /// The logger 21 | public KubernetesApiWrapper(ILogger logger) 22 | { 23 | _logger = logger; 24 | try 25 | { 26 | var config = KubernetesClientConfiguration.InClusterConfig(); 27 | _client = new Kubernetes(config); 28 | } 29 | catch (Exception e) 30 | { 31 | _logger.LogError(e, "Unable to initialize KubernetesApiWrapper"); 32 | } 33 | } 34 | 35 | /// 36 | async Task> IKubernetesApiWrapper.GetDeployedResources( 37 | ResourceType resourceType, 38 | string continueParameter, 39 | bool? allowWatchBookmarks, 40 | string fieldSelector, 41 | string labelSelector, 42 | int? limit, 43 | string resourceVersion, 44 | int? timeoutSeconds, 45 | bool? watch, 46 | bool? pretty) 47 | { 48 | IList mappedResources = new List(); 49 | 50 | switch (resourceType) 51 | { 52 | case ResourceType.Deployment: 53 | V1DeploymentList deployments = await _client.ListNamespacedDeploymentAsync("default", allowWatchBookmarks, continueParameter, fieldSelector, labelSelector, limit, resourceVersion, null, null, timeoutSeconds, watch, pretty); 54 | mappedResources = MapDeployments(deployments.Items); 55 | break; 56 | case ResourceType.DaemonSet: 57 | V1DaemonSetList deamonSets = await _client.ListNamespacedDaemonSetAsync("default", allowWatchBookmarks, continueParameter, fieldSelector, labelSelector, limit, resourceVersion, null, null, timeoutSeconds, watch, pretty); 58 | mappedResources = MapDaemonSets(deamonSets.Items); 59 | break; 60 | } 61 | 62 | return mappedResources; 63 | } 64 | 65 | /// 66 | /// Maps a list of k8s.Models.V1DaemonSet to DaemonSet 67 | /// 68 | /// The list to be mapped 69 | private static IList MapDaemonSets(IList list) 70 | { 71 | IList mappedList = new List(); 72 | if (list == null || list.Count == 0) 73 | { 74 | return mappedList; 75 | } 76 | 77 | foreach (V1DaemonSet element in list) 78 | { 79 | IList containers = element.Spec?.Template?.Spec?.Containers; 80 | if (containers != null && containers.Count > 0) 81 | { 82 | DaemonSet daemonSet = new DaemonSet { Release = element.Metadata?.Name }; 83 | 84 | string[] splittedVersion = containers[0].Image?.Split(":"); 85 | if (splittedVersion != null && splittedVersion.Length > 1) 86 | { 87 | daemonSet.Version = splittedVersion[1]; 88 | } 89 | 90 | mappedList.Add(daemonSet); 91 | } 92 | } 93 | 94 | return mappedList; 95 | } 96 | 97 | /// 98 | /// Maps a list of k8s.Models.V1Deployment to Deployment 99 | /// 100 | /// The list to be mapped 101 | private static IList MapDeployments(IList list) 102 | { 103 | IList mappedList = new List(); 104 | if (list == null || list.Count == 0) 105 | { 106 | return mappedList; 107 | } 108 | 109 | foreach (V1Deployment element in list) 110 | { 111 | Deployment deployment = new Deployment(); 112 | IList containers = element.Spec?.Template?.Spec?.Containers; 113 | if (containers != null && containers.Count > 0) 114 | { 115 | string[] splittedVersion = containers[0].Image?.Split(":"); 116 | if (splittedVersion != null && splittedVersion.Length > 1) 117 | { 118 | deployment.Version = splittedVersion[1]; 119 | } 120 | } 121 | 122 | var labels = element.Metadata?.Labels; 123 | 124 | if (labels != null && labels.TryGetValue("release", out string release)) 125 | { 126 | deployment.Release = release; 127 | } 128 | 129 | mappedList.Add(deployment); 130 | } 131 | 132 | return mappedList; 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /Altinn3.ruleset: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | -------------------------------------------------------------------------------- /Settings.StyleCop: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | preprocessor, pre-processor 5 | shortlived, short-lived 6 | 7 | 8 | altinn 9 | arbeidsgiveravgift 10 | aspx 11 | BankID 12 | brreg 13 | Buypass 14 | Commfides 15 | compat 16 | Compat.browser 17 | Creuna 18 | css 19 | dequeue 20 | Dequeue 21 | deserializing 22 | Determinator 23 | enum 24 | en-US 25 | formset 26 | Functoid 27 | ID-Porten 28 | js 29 | leveranse 30 | linq 31 | msdn 32 | oppgave 33 | orid 34 | participant 35 | Porten 36 | psa 37 | referer 38 | reportee 39 | sone 40 | ssn 41 | subform 42 | subforms 43 | virksomhet 44 | Winnovative 45 | xfd 46 | xsd 47 | Guid 48 | Api 49 | OAuth 50 | Auth 51 | mpcId 52 | mpc 53 | Sdp 54 | Difi 55 | Difis 56 | Rijndael 57 | eq 58 | orderby 59 | Oppgaveregister 60 | Seres 61 | reportees 62 | 63 | 10000 64 | 65 | 66 | 67 | 68 | 69 | 70 | False 71 | 72 | 73 | 74 | 75 | False 76 | 77 | 78 | 79 | 80 | False 81 | 82 | 83 | 84 | 85 | False 86 | 87 | 88 | 89 | 90 | False 91 | 92 | 93 | 94 | 95 | False 96 | 97 | 98 | 99 | 100 | False 101 | 102 | 103 | 104 | 105 | True 106 | 107 | 108 | 109 | 110 | 111 | 112 | False 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | False 123 | 124 | 125 | 126 | 127 | False 128 | 129 | 130 | 131 | 132 | 133 | a1 134 | as 135 | at 136 | d 137 | db 138 | dn 139 | do 140 | dr 141 | ds 142 | dt 143 | e 144 | e2 145 | er 146 | f 147 | fs 148 | go 149 | id 150 | if 151 | in 152 | ip 153 | is 154 | js 155 | li 156 | my 157 | no 158 | ns 159 | on 160 | or 161 | pi 162 | pv 163 | sa 164 | sb 165 | se 166 | si 167 | so 168 | sp 169 | tc 170 | to 171 | tr 172 | ui 173 | un 174 | wf 175 | ws 176 | x 177 | y 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | False 186 | 187 | 188 | 189 | 190 | False 191 | 192 | 193 | 194 | 195 | False 196 | 197 | 198 | 199 | 200 | False 201 | 202 | 203 | 204 | 205 | False 206 | 207 | 208 | 209 | 210 | False 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | False 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | False 231 | 232 | 233 | 234 | 235 | 236 | 237 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | 3 | ### VisualStudio ### 4 | 5 | # Tool Runtime Dir 6 | [Tt]ools/ 7 | 8 | # User-specific files 9 | *.suo 10 | *.user 11 | *.userosscache 12 | *.sln.docstates 13 | 14 | # Entity Framework 15 | Migrations/ 16 | 17 | # Build results 18 | [Dd]ebug/ 19 | [Dd]ebugPublic/ 20 | x64/ 21 | x86/ 22 | build/ 23 | bld/ 24 | [Bb]in/ 25 | [Oo]bj/ 26 | msbuild.log 27 | 28 | # Cross building rootfs 29 | cross/rootfs/ 30 | 31 | # Visual Studio 2015 32 | .vs/ 33 | 34 | # Visual Studio 2015 Pre-CTP6 35 | *.sln.ide 36 | *.ide/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | #NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | #JUNIT 47 | junit.xml 48 | 49 | # Build Results of an ATL Project 50 | [Dd]ebugPS/ 51 | [Rr]eleasePS/ 52 | dlldata.c 53 | 54 | *_i.c 55 | *_p.c 56 | *_i.h 57 | *.ilk 58 | *.meta 59 | *.obj 60 | *.pch 61 | *.pdb 62 | *.pgc 63 | *.pgd 64 | *.rsp 65 | *.sbr 66 | *.tlb 67 | *.tli 68 | *.tlh 69 | *.tmp 70 | *.tmp_proj 71 | *.log 72 | *.vspscc 73 | *.vssscc 74 | .builds 75 | *.pidb 76 | *.svclog 77 | *.scc 78 | 79 | # Chutzpah Test files 80 | _Chutzpah* 81 | 82 | # Visual C++ cache files 83 | ipch/ 84 | *.aps 85 | *.ncb 86 | *.opendb 87 | *.opensdf 88 | *.sdf 89 | *.cachefile 90 | 91 | # Visual Studio profiler 92 | *.psess 93 | *.vsp 94 | *.vspx 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding addin-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # NCrunch 117 | _NCrunch_* 118 | .*crunch*.local.xml 119 | 120 | # MightyMoose 121 | *.mm.* 122 | AutoTest.Net/ 123 | 124 | # Web workbench (sass) 125 | .sass-cache/ 126 | 127 | # Installshield output folder 128 | [Ee]xpress/ 129 | 130 | # DocProject is a documentation generator add-in 131 | DocProject/buildhelp/ 132 | DocProject/Help/*.HxT 133 | DocProject/Help/*.HxC 134 | DocProject/Help/*.hhc 135 | DocProject/Help/*.hhk 136 | DocProject/Help/*.hhp 137 | DocProject/Help/Html2 138 | DocProject/Help/html 139 | 140 | # Click-Once directory 141 | publish/ 142 | 143 | # Publish Web Output 144 | *.[Pp]ublish.xml 145 | *.azurePubxml 146 | *.pubxml 147 | *.publishproj 148 | 149 | # NuGet Packages 150 | *.nuget.props 151 | *.nuget.targets 152 | *.nupkg 153 | **/packages/* 154 | 155 | # Allow frontend packages 156 | !**/frontend/packages/* 157 | 158 | # NuGet package restore lockfiles 159 | project.lock.json 160 | 161 | # yarn lock file 162 | /yarn.lock 163 | package-lock.json 164 | 165 | # Windows Azure Build Output 166 | csx/ 167 | *.build.csdef 168 | 169 | # Windows Store app package directory 170 | AppPackages/ 171 | 172 | # Others 173 | *.Cache 174 | ClientBin/ 175 | [Ss]tyle[Cc]op.* 176 | ~$* 177 | *.dbmdl 178 | *.dbproj.schemaview 179 | *.publishsettings 180 | node_modules/ 181 | *.metaproj 182 | *.metaproj.tmp 183 | 184 | # RIA/Silverlight projects 185 | Generated_Code/ 186 | 187 | # Backup & report files from converting an old project file 188 | # to a newer Visual Studio version. Backup files are not needed, 189 | # because we have git ;-) 190 | _UpgradeReport_Files/ 191 | Backup*/ 192 | UpgradeLog*.XML 193 | UpgradeLog*.htm 194 | 195 | # SQL Server files 196 | *.mdf 197 | *.ldf 198 | 199 | # Business Intelligence projects 200 | *.rdl.data 201 | *.bim.layout 202 | *.bim_*.settings 203 | 204 | # Microsoft Fakes 205 | FakesAssemblies/ 206 | 207 | ### MonoDevelop ### 208 | 209 | *.pidb 210 | *.userprefs 211 | 212 | ### Windows ### 213 | 214 | # Windows image file caches 215 | Thumbs.db 216 | ehthumbs.db 217 | 218 | # Folder config file 219 | Desktop.ini 220 | 221 | # Recycle Bin used on file shares 222 | $RECYCLE.BIN/ 223 | 224 | # Windows Installer files 225 | *.cab 226 | *.msi 227 | *.msm 228 | *.msp 229 | 230 | # Windows shortcuts 231 | *.lnk 232 | 233 | ### Linux ### 234 | 235 | *~ 236 | 237 | # KDE directory preferences 238 | .directory 239 | 240 | ### OSX ### 241 | 242 | .DS_Store 243 | .AppleDouble 244 | .LSOverride 245 | 246 | # Icon must end with two \r 247 | Icon 248 | 249 | # Thumbnails 250 | ._* 251 | 252 | # Files that might appear on external disk 253 | .Spotlight-V100 254 | .Trashes 255 | 256 | # Directories potentially created on remote AFP share 257 | .AppleDB 258 | .AppleDesktop 259 | Network Trash Folder 260 | Temporary Items 261 | .apdisk 262 | 263 | # vim temporary files 264 | [._]*.s[a-w][a-z] 265 | [._]s[a-w][a-z] 266 | *.un~ 267 | Session.vim 268 | .netrwhist 269 | *~ 270 | /AltinnPoCExperiments 271 | 272 | # Sonarqube 273 | .scannerwork 274 | 275 | # TSLint report 276 | tslint_report.json 277 | 278 | 279 | 280 | ## -- Repositories -- 281 | 282 | # Binaries for programs and plugins 283 | *.exe 284 | *.dll 285 | *.so 286 | *.dylib 287 | 288 | # Test binary, build with `go test -c` 289 | *.test 290 | 291 | # Output of the go coverage tool, specifically when used with LiteIDE 292 | *.out 293 | 294 | # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 295 | .glide/ 296 | postgres/* 297 | !src/AltinnRepositories/gitea-data/ 298 | src/AltinnRepositories/gitea-data/* 299 | !src/AltinnRepositories/gitea-data/gitea/ 300 | src/AltinnRepositories/gitea-data/gitea/* 301 | !src/AltinnRepositories/gitea-data/gitea/conf/ 302 | !src/AltinnRepositories/gitea-data/gitea/options/ 303 | !src/AltinnRepositories/gitea-data/gitea/public/ 304 | !src/AltinnRepositories/gitea-data/gitea/templates/ 305 | 306 | ######### Built react apps for receipt ########### 307 | src/Altinn.Platform/Altinn.Platform.Receipt/Receipt/wwwroot/receipt/js/react 308 | src/Altinn.Platform/Altinn.Platform.Receipt/Receipt/wwwroot/receipt/css 309 | 310 | ######### Built react apps for designer ########### 311 | src/studio/src/designer/backend/wwwroot/designer/css/react 312 | src/studio/src/designer/backend/wwwroot/designer/js/react 313 | src/studio/src/designer/backend/wwwroot/designer/js/lib 314 | src/studio/src/designer/backend/wwwroot/designer/css/lib 315 | src/studio/src/designer/backend/wwwroot/designer/css/font-awesome 316 | src/studio/src/designer/backend/wwwroot/designer/css/fonts 317 | src/studio/src/designer/backend/wwwroot/designer/css/bootstrap*.css 318 | src/studio/src/designer/backend/wwwroot/designer/frontend 319 | 320 | ######### Testdata created by testrun ######### 321 | src/Altinn.Platform/Altinn.Platform.Authorization/IntegrationTests/Data/blobs/output/ 322 | 323 | # Jest test coverage 324 | coverage 325 | /deploy/kubernetes/helm-charts/altinn-dataservice-0.1.0.tgz 326 | /deploy/kubernetes/altinn-dbsettings-secret.json 327 | 328 | /src/Altinn.Platform/Altinn.Platform.Storage/Storage/values.dev.yaml 329 | /src/Altinn.Platform/Altinn.Platform.Storage/Storage.Interface/Storage.Interface.xml 330 | /src/Altinn.Platform/Altinn.Platform.Profile/Profile/charts/profile 331 | /src/Altinn.Platform/Altinn.Platform.Profile/Profile/azds.yaml 332 | /src/AltinnCore/UnitTest/coverage.opencover.xml 333 | /src/Altinn.Platform/Altinn.Platform.Authorization/Altinn.Authorization.ABAC/Altinn.Authorization.ABAC.xml 334 | 335 | ## Java 336 | *.class 337 | .mtj.tmp/ 338 | *.jar 339 | *.war 340 | *.ear 341 | hs_err_pid* 342 | 343 | ## Maven 344 | target/ 345 | pom.xml.tag 346 | pom.xml.releaseBackup 347 | pom.xml.versionsBackup 348 | pom.xml.next 349 | release.properties 350 | 351 | ## Eclipse 352 | .metadata 353 | .classpath 354 | .project 355 | .settings/ 356 | bin/ 357 | tmp/ 358 | *.tmp 359 | *.bak 360 | *.swp 361 | *~.nib 362 | local.properties 363 | .loadpath 364 | 365 | ## NetBeans 366 | nbproject/private/ 367 | build/ 368 | nbbuild/ 369 | dist/ 370 | nbdist/ 371 | nbactions.xml 372 | nb-configuration.xml 373 | 374 | ## IntelliJ 375 | .idea 376 | src/Altinn.Apps/AppTemplates/AspNet/App/Properties/launchSettings.json 377 | *.iml 378 | 379 | 380 | ## Test repositories 381 | backend/tests/Designer.Tests/_TestData/Repositories/**/**/test-repo-*/** 382 | backend/tests/Designer.Tests/_TestData/Remote/**/test-repo_*/** 383 | backend/tests/Designer.Tests/_TestData/Repositories/*/*/test-repo_*/** 384 | backend/tests/Designer.Tests/_TestData/Remote/*/test-repo_*/** 385 | 386 | ######### Built react apps for designer ########### 387 | backend/src/Designer/wwwroot/designer/css/react 388 | backend/src/Designer/wwwroot/designer/js/react 389 | backend/src/Designer/wwwroot/designer/js/lib 390 | backend/src/Designer/wwwroot/designer/css/lib 391 | backend/src/Designer/wwwroot/designer/css/font-awesome 392 | backend/src/Designer/wwwroot/designer/css/fonts 393 | backend/src/Designer/wwwroot/designer/css/bootstrap*.css 394 | backend/src/Designer/wwwroot/designer/frontend 395 | 396 | **/.env 397 | src/studio/.devcontainer/** 398 | --------------------------------------------------------------------------------