Skip to content

Commit

Permalink
1433: add project config for koblenz, fix import, adjust hash in the …
Browse files Browse the repository at this point in the history
…docs
  • Loading branch information
f1sh1918 committed Jul 29, 2024
1 parent 60031cf commit d3879e2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

import app.ehrenamtskarte.backend.cards.CanonicalJson
import app.ehrenamtskarte.backend.common.utils.Environment
import app.ehrenamtskarte.backend.common.webservice.KOBLENZ_PEPPER_SYS_ENV
import app.ehrenamtskarte.backend.user.KoblenzUser
import app.ehrenamtskarte.backend.verification.CanonicalJson
import org.bouncycastle.crypto.generators.Argon2BytesGenerator
import org.bouncycastle.crypto.params.Argon2Parameters
import java.nio.charset.StandardCharsets
Expand Down Expand Up @@ -51,8 +51,8 @@ class Argon2IdHasher {
val canonicalJson = CanonicalJson.koblenzUserToString(userData)
val hashLength = 32

val pepper = Environment.getVariable(KOBLENZ_PEPPER_SYS_ENV) // TODO handle if Null
val pepperByteArray = pepper?.toByteArray(StandardCharsets.UTF_8)
val pepper = Environment.getVariable(KOBLENZ_PEPPER_SYS_ENV) ?: throw Exception("No koblenz pepper found")
val pepperByteArray = pepper.toByteArray(StandardCharsets.UTF_8)
val params =
Argon2Parameters
.Builder(Argon2Parameters.ARGON2_id)
Expand Down
11 changes: 11 additions & 0 deletions backend/src/main/resources/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ projects:
port: 587
username: OVERRIDE_IN_LOCAL_CONFIG
password: OVERRIDE_IN_LOCAL_CONFIG
- id: koblenz.sozialpass.app
importUrl: ""
pipelineName: SozialpassKoblenz
administrationBaseUrl: https://koblenz.sozialpass.app
administrationName: Koblenz-Pass-Verwaltung
timezone: "Europe/Berlin"
smtp:
host: mail.sozialpass.app
port: 587
username: OVERRIDE_IN_LOCAL_CONFIG
password: OVERRIDE_IN_LOCAL_CONFIG
- id: showcase.entitlementcard.app
importUrl: https://example.com
pipelineName: BerechtigungskarteShowcase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package app.ehrenamtskarte.backend.cards

import Card
import app.ehrenamtskarte.backend.cards.CanonicalJson.Companion.koblenzUserToString
import app.ehrenamtskarte.backend.helper.CardInfoTestSample
import app.ehrenamtskarte.backend.helper.ExampleCardInfo
import app.ehrenamtskarte.backend.helper.koblenzTestUser
import app.ehrenamtskarte.backend.verification.CanonicalJson.Companion.koblenzUserToString
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
Expand Down
2 changes: 1 addition & 1 deletion docs/CreateKoblenzHash.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Hash with Argon2id with the following parameters:
### 4. The result...
...for the example data and example salt must be (output in encoded form with salt removed):

`$argon2id$v=19$m=16,t=2,p=1$UIOJZIsSL8vXcuCB82xZ5E8tpH6sQd3d4U0uC02DP40`
`$argon2id$v=19$m=19,t=2,p=1$78SNlzz8llqPwetRlp8Lnag/WZGPc5XbimYbShpwVMQ`


## Additional Information
Expand Down

0 comments on commit d3879e2

Please sign in to comment.