{"id":21365035,"url":"https://github.com/altinn/altinn-application-owner-system","last_synced_at":"2025-07-13T04:31:27.107Z","repository":{"id":45601428,"uuid":"377399413","full_name":"Altinn/altinn-application-owner-system","owner":"Altinn","description":"A reference implementation of a system for app owners, that can react to events, fetch data and update app status.","archived":false,"fork":false,"pushed_at":"2024-11-15T21:17:11.000Z","size":428,"stargazers_count":5,"open_issues_count":16,"forks_count":2,"subscribers_count":23,"default_branch":"main","last_synced_at":"2024-11-15T22:22:30.799Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Altinn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-16T06:50:29.000Z","updated_at":"2023-01-06T22:14:20.000Z","dependencies_parsed_at":"2023-10-21T23:28:44.536Z","dependency_job_id":"a5219723-94c1-49fb-b245-7f6b718323d3","html_url":"https://github.com/Altinn/altinn-application-owner-system","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Altinn%2Faltinn-application-owner-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Altinn%2Faltinn-application-owner-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Altinn%2Faltinn-application-owner-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Altinn%2Faltinn-application-owner-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Altinn","download_url":"https://codeload.github.com/Altinn/altinn-application-owner-system/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225855965,"owners_count":17534967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T07:09:05.588Z","updated_at":"2024-11-22T07:09:06.150Z","avatar_url":"https://github.com/Altinn.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Application Owner System\nA reference implementation of a system for app owners, that can react to events, fetch data and update app status.\n\n## Architecture\n\nThe system is implemented as Azure Functions using .Net 5\n\n- It uses Azure Functions to receive, process, and confirm downloading of data\n- It uses Azure Queue Storage for async processing\n- It uses Azure Blob Storage to store data.\n- It uses Azure KeyVault to store the certificate for [MaskinPorten](https://www.digdir.no/digitale-felleslosninger/maskinporten/869)\n\n![Altinn Application Owner System](concept.svg \"Altinn Application Owner System\")\n\n### Events Receiver\n\nThe events receiver is a webhook that receives events from Altinn Events.\n\nIt will put the received Event in a Queue based on Azure Queue Storage.\n\nThe function is protected by a [Function Access Key](https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=csharp#authorization-keys). This needs to be present in URI in requests from Altinn events. \n\nThe endpoint for subscription needs to include it. \nExample: https://aos-ttdt22-function.azurewebsites.net/api/eventsreceiver?code=ffQqMrbvLoNEiySae0EfApmost8LfBeqdYY/AXa13KSyf8Rjsp1U9w==\n\nAzure creates the code when setting up the functions.\n\n### Events Processor\n\nEvents processor is responsible to\n\n- Download Instance document\n- Download all data and store it as blobs in an Azure Storage Account\n\nPut events on the feedback queue\n\n### Events Feedback\n\nEvents feedback is responsible for\n\n- Upload xml feedback to a datafield controlled by the setting: AltinnApplicationOwnerSystemSettings:XMLFeedbackDataType\n- Put events on the confirmation queue\n\nIn addition to configure the XMLFeedbackDataType you also need to specify the type of events that should trigger upload of feedback. Controlled with the setting: AltinnApplicationOwnerSystemSettings:XMLFeedbackEventType\n\n### Events Confirmation\n\n- Calls App to confirm that data is downloaded (and feedback uploaded if configured)\n\n### Events Subscriber\n\nEvents subscriber is triggered when a file is uploaded to the blob container add-subscriptions\n\nEvents subscriber is responsible for:\n\n- Authenticate with maskinporten to altinn3 and register the subscription uploaded\n- Saving the response from altinn3 to the blob container active-subscriptions\n- Deleting the uploaded file in add-subscriptions\n\n### Events DeSubscriber\n\nEvents desubscriber is triggered when a file is uploaded to the blob container: remove-subscriptions\n\nThe simplest way to get the json to upload is to download it form the blob container: active-subscriptions \n\nEvents Desubscriber is responsible for:\n\n- Authenticate with maskinporten to altinn3 and remove the subscription uploaded\n- Removing the file describing the subscription in active-subscriptions\n- Deleteing the uploaded file in remove-subscriptions\n\n## Authentication\n\nThe system uses Maskinporten to authenticate the application owner.\n\n- The org needs to be registered as a client \n\n## Configuration\n\nAs part of this project, you find a PowerShell script to deploy the solution to an Azure Subscription\n\n### Prerequisites\n\n- You have an Azure subscription that you can log in to and create resources\n- Org is registred with a client in MaskinPorten and you have the clientId\n- You have the certificate for that client with password\n- The client is an application owner in Altinn\n\nFrom deployment folder run in Powershell. Replace values matching your environment\nExample: #  \n\n   ```bash\n.\\provision_application_owner_system.ps1 -subscription Altinn-TTD-Application-Owner-System -aosEnvironment [INSERT NAME ON ENVIRONMENT MAX 5 letters] -maskinportenclient [INSERT MASKINPORTEN CLIENTID] -maskinportenclientcert [PATH TO CERT] -maskinportenclientcertpwd [INSERT PASSOWORD FOR CERT] -maskinportenuri https://ver2.maskinporten.no -platformuri https://platform.tt02.altinn.no/ -appsuri https://ttd.apps.tt02.altinn.no/\n   ```\n\n\n### Setting up a subscription\n\nBelow you see and example on how an subscription is set up. This need to be posted to the subscription endpoint while authenticated as org.\n\nSee more details on [Subscription API](https://docs.altinn.studio/teknologi/altinnstudio/altinn-api/platform-api/events/)\n\n```json\n{\n    \"endPoint\": \"https://aos-ttdtt02-function.azurewebsites.net/api/eventsreceiver?code=swEizasdgraeadvcvvwFAKE8y9ZS7bDoZNOTREALLuPeJMkUtHow==\",\n    \"sourceFilter\": \"https://ttd.apps.tt02.altinn.no/ttd/apps-test\",\n    \"typeFilter\": \"app.instance.process.completed\",\n   }\n\n ```\n\n### Altinn 3 documentation\n\n![Altinn 3 concept](https://docs.altinn.studio/community/about/concept3.svg \"Altinn 3 concept\")\n\nHere you find relevant information.\n- [Altinn 3 documentation](https://docs.altinn.studio/technology/)\n- [Altinn 3 API](https://docs.altinn.studio/api/)\n- [Altinn 3 Event capabilities](https://docs.altinn.studio/technology/architecture/capabilities/runtime/integration/events/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltinn%2Faltinn-application-owner-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faltinn%2Faltinn-application-owner-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltinn%2Faltinn-application-owner-system/lists"}