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

[DPR2-000] Update library version #34

Merged
merged 3 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-webflux")

// DPR Library
implementation("uk.gov.justice.service.hmpps:hmpps-digital-prison-reporting-lib:1.1.10")
implementation("uk.gov.justice.service.hmpps:hmpps-digital-prison-reporting-lib:1.3.0")
implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server")

// Database
Expand Down
42 changes: 29 additions & 13 deletions src/main/resources/banner.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
_ _ _ _ ___ ___ ____
|__| |\/| |__] |__] [__
| | | | | | ___]

___ ____ _ _ ___ _ ____ ___ ____
| |___ |\/| |__] | |__| | |___
| |___ | | | |___ | | | |___

_ _ ____ ___ _ _ _ _
|_/ | | | | | |\ |
| \_ |__| | |___ | | \|

Please change me by generating your own ASCII art and placing in banner.txt
________ ________ ___ __ _______
|\ _____\\ __ \|\ \|\ \ |\ ___ \
\ \ \__/\ \ \|\ \ \ \/ /|\ \ __/|
\ \ __\\ \ __ \ \ ___ \ \ \_|/__
\ \ \_| \ \ \ \ \ \ \\ \ \ \ \_|\ \
\ \__\ \ \__\ \__\ \__\\ \__\ \_______\
\|__| \|__|\|__|\|__| \|__|\|_______|



________ ________ ________
|\ ___ \|\ __ \|\ ____\
\ \ \_|\ \ \ \|\ \ \ \___|_
\ \ \ \\ \ \ ____\ \_____ \
\ \ \_\\ \ \ \___|\|____|\ \
\ \_______\ \__\ ____\_\ \
\|_______|\|__| |\_________\
\|_________|


________ _______ ________ ___ ___ ___ ________ _______
|\ ____\|\ ___ \ |\ __ \|\ \ / /|\ \|\ ____\|\ ___ \
\ \ \___|\ \ __/|\ \ \|\ \ \ \ / / | \ \ \ \___|\ \ __/|
\ \_____ \ \ \_|/_\ \ _ _\ \ \/ / / \ \ \ \ \ \ \ \_|/__
\|____|\ \ \ \_|\ \ \ \\ \\ \ / / \ \ \ \ \____\ \ \_|\ \
____\_\ \ \_______\ \__\\ _\\ \__/ / \ \__\ \_______\ \_______\
|\_________\|_______|\|__|\|__|\|__|/ \|__|\|_______|\|_______|
\|_________|

8 changes: 8 additions & 0 deletions src/main/resources/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
"name" : "PostgreSQL",
"connection" : "postgres"
} ],
"policy": [
{
"id": "fake",
"type": "row-level",
"action": ["TRUE"],
"rule": []
}
],
"dataset" : [ {
"id" : "all",
"name" : "All",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ package uk.gov.justice.digital.hmpps.hmppsdprfakedpsservice.helper
import org.springframework.security.core.authority.SimpleGrantedAuthority
import org.springframework.security.oauth2.jwt.Jwt
import org.springframework.stereotype.Component
import uk.gov.justice.digital.hmpps.digitalprisonreportinglib.security.AuthAwareAuthenticationToken
import uk.gov.justice.digital.hmpps.digitalprisonreportinglib.security.AuthAwareTokenConverter
import uk.gov.justice.digital.hmpps.digitalprisonreportinglib.security.DprAuthAwareAuthenticationToken
import uk.gov.justice.digital.hmpps.digitalprisonreportinglib.security.DprAuthAwareTokenConverter
import uk.gov.justice.digital.hmpps.hmppsdprfakedpsservice.security.FakeCaseloadProvider

@Component
class FakeAuthAwareTokenConverter(
val fakeCaseloadProvider: FakeCaseloadProvider,
) : AuthAwareTokenConverter {
) : DprAuthAwareTokenConverter {

override fun convert(jwt: Jwt): AuthAwareAuthenticationToken {
override fun convert(jwt: Jwt): DprAuthAwareAuthenticationToken {
val principal = "FAKE"
val authorities = listOf(SimpleGrantedAuthority("ROLE_PRISONS_REPORTING_USER"))

return AuthAwareAuthenticationToken(jwt, principal, authorities, fakeCaseloadProvider)
return DprAuthAwareAuthenticationToken(jwt, principal, authorities, fakeCaseloadProvider)
}
}