-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from CamilYed/develop
Add integration tests for account creation and currency exchange: validate UUID security
- Loading branch information
Showing
25 changed files
with
369 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/camilyed/github/io/currencyexchangeapi/api/XRequestId.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package camilyed.github.io.currencyexchangeapi.api | ||
|
||
import camilyed.github.io.currencyexchangeapi.domain.OperationId | ||
import camilyed.github.io.currencyexchangeapi.infrastructure.InvalidHeaderException | ||
import java.util.UUID | ||
|
||
typealias XRequestId = String? | ||
|
||
fun XRequestId.toOperationId() = | ||
try { | ||
OperationId(UUID.fromString(this)) | ||
} catch (_: IllegalArgumentException) { | ||
throw InvalidHeaderException("X-Request-Id is required and must be a valid UUID") | ||
} |
Oops, something went wrong.