Skip to content

Commit

Permalink
Merge pull request #33 from kartverket/feature/legg-til-post-endepunk…
Browse files Browse the repository at this point in the history
…t-for-decrypt

feat: legg til nytt endepunkt for decrypt
  • Loading branch information
marensofier authored Aug 23, 2024
2 parents 5b89b09 + b275b2a commit 3eb313d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/kotlin/cryptoservice/controller/CryptoController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ class CryptoController(
return ResponseEntity.ok().body(decryptedString)
}

@PostMapping("/decrypt")
fun decryptPost(
@RequestHeader gcpAccessToken: String,
@RequestBody cipherText: String,
): ResponseEntity<String> {
val decryptedString = decryptionService.decrypt(cipherText, GCPAccessToken(gcpAccessToken))

return ResponseEntity.ok().body(decryptedString)
}

@GetMapping("/encrypt")
fun encrypt(
text: String,
Expand Down

0 comments on commit 3eb313d

Please sign in to comment.