-
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.
* Fixed duplicate order creation, removed Enum values * Implement GET endpoint * Swaggerdoc * Add comments to OrderService * Check authentication when ordering Currently breaks tests * Better handling of client name for order tests * Fix JWT mocking * Sneakily improve SynQ createOrder * Move throwIfInvalidClientName into HostName --------- Co-authored-by: Daniel Aaron Salwerowicz <[email protected]>
- Loading branch information
1 parent
8358367
commit 4be86e1
Showing
8 changed files
with
135 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
package no.nb.mlt.wls.core.data | ||
|
||
enum class HostName(private val hostName: String) { | ||
AXIELL("Axiell"); | ||
import org.springframework.http.HttpStatus | ||
import org.springframework.web.server.ResponseStatusException | ||
|
||
override fun toString(): String { | ||
return hostName | ||
} | ||
enum class HostName { | ||
AXIELL | ||
} | ||
|
||
fun throwIfInvalidClientName( | ||
clientName: String, | ||
hostName: HostName | ||
) { | ||
if (clientName.uppercase() == hostName.name) return | ||
throw ResponseStatusException( | ||
HttpStatus.FORBIDDEN, | ||
"You do not have access to view resources owned by $hostName" | ||
) | ||
} |
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
Oops, something went wrong.