The Lovdata repository was created from PSModule/Template-PSModule and still contains template scaffolding. Anyone installing it today gets a placeholder command and no way to reach Lovdata, the foundation that maintains the authoritative body of Norwegian law.
Request
Desired capability
Lovdata publishes a set of open datasets and service endpoints that need no account at all: the current acts and central regulations as downloadable packages under NLOD 2.0, plus the endpoints that report whether the service is up and which build is deployed. That open surface is what most people can actually use without a commercial agreement, and it is what the first release covers.
A PowerShell user should be able to install the module and pull the full corpus of Norwegian acts in two commands, with nothing to configure and no credential to obtain. Everything behind an API key is deliberately out of scope here and tracked in #15.
Acceptance criteria
- The module installs and every command works with no account, no key, and no configuration
- The available open data packages can be listed, with the size and last-modified date needed to decide what to download
- A package can be downloaded to a chosen location, with progress, and without silently overwriting an existing file
- Service reachability and the deployed API version can be checked
- The NLOD 2.0 licence and the requirement to credit Lovdata are visible where a user will meet them
- A failed call explains itself in the module's own words rather than as a raw HTTP failure
- The test suite passes without network access to Lovdata
References
Technical decisions
Scope of the first release: The open surface only. The API key mechanism, the credential store, and every command that needs one are deferred to #15. This keeps the first release usable by anyone rather than only by holders of a Lovdata api role, and avoids shipping a credential store that nothing consumes.
Release type: Minor. The first release is 0.1.0 rather than 1.0.0, because the authenticated surface is not covered yet and 1.0.0 should mean the module wraps the API rather than a part of it.
Bootstrap branching: Follow module bootstrap. One long-lived integration branch, build-lovdata-module, cut from main. This issue covers the branch merging into main as the first release; individual command groups target the integration branch.
Archetype: Integration (API) module per Module types. Commands are named after the resource and intent with the Lovdata noun prefix.
State: Module-wide settings, principally the API base URI, live in a module-scoped variable for the session. No Context dependency in this release: Context exists to encrypt secrets at rest, and this release has no secret. It returns with the credential store in #15.
Transport abstraction: Private. Invoke-LovdataAPI under src/functions/private/API/ owns the concrete HTTP call, query-string building, and error translation. It is written so that adding key injection later is an addition to one helper rather than a second transport path.
Rate limiting: The service applies a limit to unauthenticated callers too — X-RateLimit-Limit: 200 is returned on the open endpoints — so the transport surfaces the remaining budget on the verbose stream from the first release.
Error handling: The API returns RFC 9457 style problem documents. The transport reads the status code without throwing, then raises a terminating error carrying the API's own message and detail, with dedicated guidance for 429.
Test approach: Unit tests mocking the module-owned transport boundary. No live calls in the unit suite, so the tests pass offline.
Repository baseline: The template is missing several files required by Repository defaults. They are added as part of this bootstrap rather than deferred.
Implementation plan
Repository
Core
Tests and examples
Follow-up
The
Lovdatarepository was created fromPSModule/Template-PSModuleand still contains template scaffolding. Anyone installing it today gets a placeholder command and no way to reach Lovdata, the foundation that maintains the authoritative body of Norwegian law.Request
Desired capability
Lovdata publishes a set of open datasets and service endpoints that need no account at all: the current acts and central regulations as downloadable packages under NLOD 2.0, plus the endpoints that report whether the service is up and which build is deployed. That open surface is what most people can actually use without a commercial agreement, and it is what the first release covers.
A PowerShell user should be able to install the module and pull the full corpus of Norwegian acts in two commands, with nothing to configure and no credential to obtain. Everything behind an API key is deliberately out of scope here and tracked in #15.
Acceptance criteria
References
/v1/publicData/list,/v1/publicData/get/{filename},/ping,/version,/apichanges,/privacyTechnical decisions
Scope of the first release: The open surface only. The API key mechanism, the credential store, and every command that needs one are deferred to #15. This keeps the first release usable by anyone rather than only by holders of a Lovdata
apirole, and avoids shipping a credential store that nothing consumes.Release type: Minor. The first release is
0.1.0rather than1.0.0, because the authenticated surface is not covered yet and1.0.0should mean the module wraps the API rather than a part of it.Bootstrap branching: Follow module bootstrap. One long-lived integration branch,
build-lovdata-module, cut frommain. This issue covers the branch merging intomainas the first release; individual command groups target the integration branch.Archetype: Integration (API) module per Module types. Commands are named after the resource and intent with the
Lovdatanoun prefix.State: Module-wide settings, principally the API base URI, live in a module-scoped variable for the session. No
Contextdependency in this release:Contextexists to encrypt secrets at rest, and this release has no secret. It returns with the credential store in #15.Transport abstraction: Private.
Invoke-LovdataAPIundersrc/functions/private/API/owns the concrete HTTP call, query-string building, and error translation. It is written so that adding key injection later is an addition to one helper rather than a second transport path.Rate limiting: The service applies a limit to unauthenticated callers too —
X-RateLimit-Limit: 200is returned on the open endpoints — so the transport surfaces the remaining budget on the verbose stream from the first release.Error handling: The API returns RFC 9457 style problem documents. The transport reads the status code without throwing, then raises a terminating error carrying the API's own
messageanddetail, with dedicated guidance for429.Test approach: Unit tests mocking the module-owned transport boundary. No live calls in the unit suite, so the tests pass offline.
Repository baseline: The template is missing several files required by Repository defaults. They are added as part of this bootstrap rather than deferred.
Implementation plan
Repository
{{ NAME }}/{{ DESCRIPTION }}tokenREADME.mdto the Repository-Defaults shape, including the NLOD 2.0 attributionSECURITY.md,SUPPORT.md,CODE_OF_CONDUCT.md, and.github/pull_request_template.md.github/PSModule.ymlonly overrides defaults where this module needs different behaviourCore
src/variables/private/Lovdata.ps1holding the module defaultsLovdataConfigclass and theGet-LovdataConfig/Set-LovdataConfigcommandsInvoke-LovdataAPIundersrc/functions/private/API/Get-LovdataLegalSource, and recover them under Add the authenticated Lovdata API surface in a later release #15Tests and examples
examples/Follow-up