Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Materialisering av bruksenhet ved innkommende egenregistreringer #207

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

anderssonw
Copy link
Collaborator

@anderssonw anderssonw commented Jan 28, 2025

Endrer med dette oppsettet for hvordan man henter ut bruksenhetsinfo. Tidligere har vi kjørt gjennom alle egenregistreringer ved uthenting, men nå applyer vi kun siste egenregistrering inn til en snapshot av bruksenheten når vi får inn nye egenregistreringer.

Har også gjort at vi bruker UUID internt over boble-IDer, som kan være starten på at vi går over til dette fremfor bobleIDer. Ikke helt sikker på hvordan vi burde håndtere UUIDer i testing, men for nå har jeg bare gått med "tulle"-UUIDer.

I tillegg til dette har jeg satt opp en del Value Classes for IDene, og renamet bobleIDene til å gjenspeile at det er bobleIDer.

Endrer også bruk av kotlinx serialisering i applikasjonsmodulen, da den var litt vel "intrusive" for applikasjonslogikk. Håpet var egentlig å bli kvitt serialiseringsimplementasjoner fullstendig, men på grunn av manglende "hjelp" på hva man deserialiserer av Signatur vs. Fødselsnummer så måtte vi annotere litt der.

Copy link

github-actions bot commented Jan 29, 2025

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 1 package(s) with unknown licenses.
  • ⚠️ 4 packages with OpenSSF Scorecard issues.
See the Details below.

License Issues

settings.gradle.kts

PackageVersionLicenseIssue Type
org.jetbrains.kotlin:kotlin-stdlib-common2.0.0NullUnknown License
Denied Licenses: AGPL-1.0-only, AGPL-1.0-or-later, AGPL-3.0, AGPL-3.0-or-later

OpenSSF Scorecard

Scorecard details
PackageVersionScoreDetails
maven/com.fasterxml.jackson.core:jackson-annotations 2.18.2 🟢 7.4
Details
CheckScoreReason
Code-Review⚠️ 0Found 1/24 approved changesets -- score normalized to 0
Security-Policy🟢 10security policy file detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Maintained🟢 1010 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies🟢 10all dependencies are pinned
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Vulnerabilities🟢 100 existing vulnerabilities detected
Packaging🟢 10packaging workflow detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
maven/com.fasterxml.jackson.core:jackson-core 2.18.2 🟢 7.3
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
CI-Tests🟢 109 out of 9 merged PRs checked by a CI test -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Code-Review⚠️ 1Found 5/28 approved changesets -- score normalized to 1
Contributors🟢 10project has 5 contributing companies or organizations
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Dependency-Update-Tool🟢 10update tool detected
Fuzzing🟢 10project is fuzzed
License🟢 10license file detected
Maintained🟢 1030 commit(s) and 25 issue activity found in the last 90 days -- score normalized to 10
Packaging🟢 10packaging workflow detected
Pinned-Dependencies🟢 5dependency not pinned by hash detected -- score normalized to 5
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Security-Policy🟢 10security policy file detected
Signed-Releases⚠️ -1no releases found
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Vulnerabilities🟢 100 existing vulnerabilities detected
maven/com.fasterxml.jackson.core:jackson-databind 2.18.2 🟢 7.1
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 28 issue activity found in the last 90 days -- score normalized to 10
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Security-Policy🟢 10security policy file detected
Code-Review⚠️ 0Found 1/29 approved changesets -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Binary-Artifacts🟢 10no binaries found in the repo
License🟢 10license file detected
Pinned-Dependencies🟢 4dependency not pinned by hash detected -- score normalized to 4
Signed-Releases⚠️ -1no releases found
Fuzzing🟢 10project is fuzzed
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Packaging🟢 10packaging workflow detected
SAST🟢 7SAST tool detected but not run on all commits
Vulnerabilities🟢 91 existing vulnerabilities detected
maven/com.fasterxml.jackson.dataformat:jackson-dataformat-toml 2.18.2 🟢 7.5
Details
CheckScoreReason
Security-Policy🟢 10security policy file detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 1030 commit(s) and 15 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 3Found 8/23 approved changesets -- score normalized to 3
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Binary-Artifacts🟢 9binaries present in source code
Fuzzing🟢 10project is fuzzed
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Pinned-Dependencies🟢 10all dependencies are pinned
Packaging🟢 10packaging workflow detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities🟢 100 existing vulnerabilities detected
maven/com.fasterxml.jackson.dataformat:jackson-dataformat-yaml 2.18.2 🟢 7.5
Details
CheckScoreReason
Security-Policy🟢 10security policy file detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 1030 commit(s) and 15 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 3Found 8/23 approved changesets -- score normalized to 3
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Binary-Artifacts🟢 9binaries present in source code
Fuzzing🟢 10project is fuzzed
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Pinned-Dependencies🟢 10all dependencies are pinned
Packaging🟢 10packaging workflow detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities🟢 100 existing vulnerabilities detected
maven/com.fasterxml.jackson.datatype:jackson-datatype-jsr310 2.18.2 🟢 7.4
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 16 issue activity found in the last 90 days -- score normalized to 10
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Code-Review⚠️ 2Found 8/30 approved changesets -- score normalized to 2
Security-Policy🟢 10security policy file detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Binary-Artifacts🟢 9binaries present in source code
Fuzzing🟢 10project is fuzzed
License🟢 10license file detected
Pinned-Dependencies🟢 10all dependencies are pinned
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Packaging🟢 10packaging workflow detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities🟢 100 existing vulnerabilities detected
maven/com.fasterxml.jackson.module:jackson-module-kotlin 2.18.2 🟢 7.1
Details
CheckScoreReason
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review⚠️ 0Found 0/13 approved changesets -- score normalized to 0
Maintained🟢 1030 commit(s) and 13 issue activity found in the last 90 days -- score normalized to 10
Security-Policy🟢 10security policy file detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 6dependency not pinned by hash detected -- score normalized to 6
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Vulnerabilities🟢 100 existing vulnerabilities detected
Packaging🟢 10packaging workflow detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
maven/com.fasterxml.jackson:jackson-bom 2.18.2 🟢 6.7
Details
CheckScoreReason
Code-Review⚠️ 0Found 1/23 approved changesets -- score normalized to 0
Maintained🟢 1020 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 9binaries present in source code
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Security-Policy🟢 10security policy file detected
Pinned-Dependencies🟢 10all dependencies are pinned
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Vulnerabilities🟢 100 existing vulnerabilities detected
Packaging🟢 10packaging workflow detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
maven/org.jetbrains.kotlin:kotlin-reflect 1.8.10 ⚠️ 2.4
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 0/30 approved changesets -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Packaging⚠️ -1packaging workflow not detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Token-Permissions⚠️ -1No tokens found
Security-Policy🟢 10security policy file detected
Dangerous-Workflow⚠️ -1no workflows found
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
License🟢 9license file detected
SAST⚠️ 0no SAST tool detected
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Binary-Artifacts⚠️ 0binaries present in source code
Vulnerabilities⚠️ 028 existing vulnerabilities detected
maven/org.jetbrains.kotlin:kotlin-stdlib-common 2.0.0 ⚠️ 2.4
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 0/30 approved changesets -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Packaging⚠️ -1packaging workflow not detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Token-Permissions⚠️ -1No tokens found
Security-Policy🟢 10security policy file detected
Dangerous-Workflow⚠️ -1no workflows found
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
License🟢 9license file detected
SAST⚠️ 0no SAST tool detected
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Binary-Artifacts⚠️ 0binaries present in source code
Vulnerabilities⚠️ 028 existing vulnerabilities detected
maven/org.jetbrains.kotlin:kotlin-stdlib-jdk7 1.8.0 ⚠️ 2.4
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 0/30 approved changesets -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Packaging⚠️ -1packaging workflow not detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Token-Permissions⚠️ -1No tokens found
Security-Policy🟢 10security policy file detected
Dangerous-Workflow⚠️ -1no workflows found
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
License🟢 9license file detected
SAST⚠️ 0no SAST tool detected
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Binary-Artifacts⚠️ 0binaries present in source code
Vulnerabilities⚠️ 028 existing vulnerabilities detected
maven/org.jetbrains.kotlin:kotlin-stdlib-jdk8 1.8.0 ⚠️ 2.4
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 0/30 approved changesets -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Packaging⚠️ -1packaging workflow not detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Token-Permissions⚠️ -1No tokens found
Security-Policy🟢 10security policy file detected
Dangerous-Workflow⚠️ -1no workflows found
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
License🟢 9license file detected
SAST⚠️ 0no SAST tool detected
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Binary-Artifacts⚠️ 0binaries present in source code
Vulnerabilities⚠️ 028 existing vulnerabilities detected
maven/org.jetbrains.kotlinx:kotlinx-coroutines-bom 1.6.4 🟢 5.3
Details
CheckScoreReason
Maintained🟢 1023 commit(s) and 23 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ -1No tokens found
Code-Review🟢 10all changesets reviewed
Dangerous-Workflow⚠️ -1no workflows found
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Binary-Artifacts🟢 7binaries present in source code
Vulnerabilities🟢 100 existing vulnerabilities detected
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies⚠️ -1no dependencies found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
maven/org.jetbrains.kotlinx:kotlinx-coroutines-core 1.6.4 🟢 5.3
Details
CheckScoreReason
Maintained🟢 1023 commit(s) and 23 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ -1No tokens found
Code-Review🟢 10all changesets reviewed
Dangerous-Workflow⚠️ -1no workflows found
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Binary-Artifacts🟢 7binaries present in source code
Vulnerabilities🟢 100 existing vulnerabilities detected
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies⚠️ -1no dependencies found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
maven/org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm 1.6.4 🟢 5.3
Details
CheckScoreReason
Maintained🟢 1023 commit(s) and 23 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ -1No tokens found
Code-Review🟢 10all changesets reviewed
Dangerous-Workflow⚠️ -1no workflows found
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Binary-Artifacts🟢 7binaries present in source code
Vulnerabilities🟢 100 existing vulnerabilities detected
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies⚠️ -1no dependencies found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0

Scanned Files

  • settings.gradle.kts

@anderssonw anderssonw marked this pull request as ready for review January 30, 2025 09:51
@anderssonw anderssonw requested a review from a team as a code owner January 30, 2025 09:51
Copy link
Collaborator

@kvstrant kvstrant left a comment

Choose a reason for hiding this comment

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

Det er noen ting som må endres på hvis databasen trenger både til- og fra-dato. Dette kan bli et tema hvis man ønsker å hente ut flere rader for et gitt tidspunkt.

application/build.gradle.kts Show resolved Hide resolved
import java.time.Instant
import java.util.*
import kotlin.test.Test

class BygningEgenregistreringAggregeringTest {
private val bygningId = BygningId("00000000-0000-0000-0000-000000000001")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Jeg sliter med å finne noen god forklaring på om dette er en akseptabel ting å gjøre. Det er jo ikke i henhold til noen standard jeg kan finne.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Er det et problem å ha "uekte" UUIDer for tester? Jeg så bare dette som en grei måte å deale med UUIDene i testing å gjøre, men vet ikke om det har noen potensielle konsekvenser

Copy link
Collaborator

Choose a reason for hiding this comment

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

Jeg vet ikke jeg heller.

infrastructure/build.gradle.kts Outdated Show resolved Hide resolved
) {
it.setObject(
1,
PGobject().apply {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Virker det ikke å bare sende en String? Hvis ikke, så kunne dette godt få en hjelpefunksjon. Kanskje til og med en fun PreparedStatement.setUuid(val index: Int, val uuid: UUID).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fikk ikke det til, nei. Men enig i at det kunne vært en fin funksjon. Årnær!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fant ut her at det faktisk er lov å bruke setObject direkte uten å spesifisere type for objektet. Tenker du det er fint med en liten hjelpefunksjon for UUID så man ikke må vite at man skal bruke setObject uansett, eller?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hva var det du kom frem til?

Copy link
Collaborator Author

@anderssonw anderssonw Feb 4, 2025

Choose a reason for hiding this comment

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

Jeg lagde en egen funksjon, siden UUID blir såpass vanlig. Kan vurdere å lage en tilsvarende for JsonBlob, men droppet det i første omgang pga. usikkerhet rundt håndtering av ObjectMapperen

@anderssonw anderssonw reopened this Feb 6, 2025
@anderssonw anderssonw merged commit ce7fe72 into main Feb 6, 2025
11 checks passed
@anderssonw anderssonw deleted the cache-bygning-bruksenhet branch February 6, 2025 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants