generated from ministryofjustice/template-repository
-
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.
Browse files
Browse the repository at this point in the history
…3015) * PI-1786 Create initial project for accredited-programmes-and-oasys * Create initial project for accredited-programmes-and-oasys --------- Co-authored-by: Anthony Britton <anthony.britton@digital.justice.gov.uk>
- Loading branch information
1 parent
d438e99
commit 8e0eb0e
Showing
33 changed files
with
599 additions
and
0 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
12 changes: 12 additions & 0 deletions
12
.idea/runConfigurations/accredited_programmes_and_oasys.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Empty file.
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,3 @@ | ||
# accredited-programmes-and-oasys | ||
|
||
// TODO Describe the service |
62 changes: 62 additions & 0 deletions
62
projects/accredited-programmes-and-oasys/applicationinsights.json
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,62 @@ | ||
{ | ||
"role": { | ||
"name": "accredited-programmes-and-oasys" | ||
}, | ||
"customDimensions": { | ||
"service.version": "${VERSION}", | ||
"service.team": "probation-integration" | ||
}, | ||
"instrumentation": { | ||
"logging": { | ||
"level": "DEBUG" | ||
}, | ||
"springScheduling": { | ||
"enabled": false | ||
} | ||
}, | ||
"selfDiagnostics": { | ||
"destination": "console" | ||
}, | ||
"sampling": { | ||
"percentage": 100 | ||
}, | ||
"preview": { | ||
"sampling": { | ||
"overrides": [ | ||
{ | ||
"telemetryType": "request", | ||
"attributes": [ | ||
{ | ||
"key": "http.url", | ||
"value": "https?://[^/]+/health/?.*", | ||
"matchType": "regexp" | ||
} | ||
], | ||
"percentage": 0 | ||
}, | ||
{ | ||
"telemetryType": "dependency", | ||
"attributes": [ | ||
{ | ||
"key": "db.statement", | ||
"value": ".*CLIENT_IDENTIFIER.*", | ||
"matchType": "regexp" | ||
} | ||
], | ||
"percentage": 0 | ||
}, | ||
{ | ||
"telemetryType": "dependency", | ||
"attributes": [ | ||
{ | ||
"key": "db.operation", | ||
"value": "SELECT", | ||
"matchType": "strict" | ||
} | ||
], | ||
"percentage": 10 | ||
} | ||
] | ||
} | ||
} | ||
} |
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,31 @@ | ||
import uk.gov.justice.digital.hmpps.extensions.ClassPathExtension | ||
|
||
apply(plugin = "com.google.cloud.tools.jib") | ||
|
||
dependencies { | ||
implementation(project(":libs:commons")) | ||
implementation(project(":libs:oauth-client")) | ||
implementation(project(":libs:oauth-server")) | ||
|
||
implementation("org.springframework.boot:spring-boot-starter-actuator") | ||
implementation("org.springframework.boot:spring-boot-starter-security") | ||
implementation("org.springframework.boot:spring-boot-starter-validation") | ||
implementation("org.springframework.boot:spring-boot-starter-web") | ||
implementation("org.jetbrains.kotlin:kotlin-reflect") | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") | ||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin") | ||
implementation(libs.springdoc) | ||
|
||
dev(project(":libs:dev-tools")) | ||
|
||
testImplementation("org.springframework.boot:spring-boot-starter-test") | ||
testImplementation(libs.bundles.mockito) | ||
} | ||
|
||
configure<ClassPathExtension> { | ||
jacocoExclusions = listOf( | ||
"**/config/**", | ||
"**/entity/**", | ||
"**/AppKt.class" | ||
) | ||
} |
13 changes: 13 additions & 0 deletions
13
projects/accredited-programmes-and-oasys/deploy/Chart.yaml
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,13 @@ | ||
apiVersion: v2 | ||
appVersion: '1.0' | ||
description: A Helm chart for Kubernetes | ||
name: accredited-programmes-and-oasys | ||
version: 1.0.0 | ||
|
||
dependencies: | ||
- name: generic-service | ||
version: "2.8" | ||
repository: https://ministryofjustice.github.io/hmpps-helm-charts | ||
- name: generic-prometheus-alerts | ||
version: "1.3" | ||
repository: https://ministryofjustice.github.io/hmpps-helm-charts |
20 changes: 20 additions & 0 deletions
20
projects/accredited-programmes-and-oasys/deploy/values-dev.yml
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,20 @@ | ||
enabled: false # TODO set this to true when you're ready to deploy your service | ||
|
||
generic-service: | ||
ingress: | ||
host: accredited-programmes-and-oasys-dev.hmpps.service.justice.gov.uk | ||
|
||
scheduledDowntime: | ||
enabled: true | ||
|
||
env: | ||
SENTRY_ENVIRONMENT: dev | ||
SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK_SET_URI: https://sign-in-dev.hmpps.service.justice.gov.uk/auth/.well-known/jwks.json | ||
SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI: https://sign-in-dev.hmpps.service.justice.gov.uk/auth/issuer | ||
|
||
INTEGRATIONS_ORDS_URL: https://t2.oasys.service.justice.gov.uk/eor/oasys | ||
|
||
LOGGING_LEVEL_UK_GOV_DIGITAL_JUSTICE_HMPPS: DEBUG | ||
|
||
generic-prometheus-alerts: | ||
businessHoursOnly: true |
18 changes: 18 additions & 0 deletions
18
projects/accredited-programmes-and-oasys/deploy/values-preprod.yml
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,18 @@ | ||
enabled: false # TODO set this to true when you're ready to deploy your service | ||
|
||
generic-service: | ||
ingress: | ||
host: accredited-programmes-and-oasys-preprod.hmpps.service.justice.gov.uk | ||
|
||
scheduledDowntime: | ||
enabled: true | ||
|
||
env: | ||
SENTRY_ENVIRONMENT: preprod | ||
SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK_SET_URI: https://sign-in-preprod.hmpps.service.justice.gov.uk/auth/.well-known/jwks.json | ||
SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI: https://sign-in-preprod.hmpps.service.justice.gov.uk/auth/issuer | ||
|
||
INTEGRATIONS_ORDS_OASYS_URL: https://bridge-pp-oasys.az.justice.gov.uk/eor/oasys | ||
|
||
generic-prometheus-alerts: | ||
businessHoursOnly: true |
12 changes: 12 additions & 0 deletions
12
projects/accredited-programmes-and-oasys/deploy/values-prod.yml
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,12 @@ | ||
enabled: false # TODO set this to true when you're ready to deploy your service | ||
|
||
generic-service: | ||
ingress: | ||
host: accredited-programmes-and-oasys.hmpps.service.justice.gov.uk | ||
|
||
env: | ||
SENTRY_ENVIRONMENT: prod | ||
SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK_SET_URI: https://sign-in.hmpps.service.justice.gov.uk/auth/.well-known/jwks.json | ||
SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI: https://sign-in.hmpps.service.justice.gov.uk/auth/issuer | ||
|
||
INTEGRATIONS_ORDS_URL: https://bridge-oasys.az.justice.gov.uk/eor/oasys |
20 changes: 20 additions & 0 deletions
20
projects/accredited-programmes-and-oasys/deploy/values.yaml
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,20 @@ | ||
# Common values | ||
generic-service: | ||
nameOverride: accredited-programmes-and-oasys | ||
|
||
image: | ||
repository: ghcr.io/ministryofjustice/hmpps-probation-integration-services/accredited-programmes-and-oasys | ||
|
||
ingress: | ||
tlsSecretName: accredited-programmes-and-oasys-cert | ||
|
||
namespace_secrets: | ||
accredited-programmes-and-oasys-client-credentials: | ||
INTEGRATIONS_ORDS_CLIENT-ID: ORDS_CLIENT_ID | ||
INTEGRATIONS_ORDS_CLIENT-SECRET: ORDS_CLIENT_SECRET | ||
accredited-programmes-and-oasys-sentry: | ||
SENTRY_DSN: SENTRY_DSN | ||
|
||
generic-prometheus-alerts: | ||
targetApplication: accredited-programmes-and-oasys | ||
|
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 @@ | ||
rootProject.name = "accredited-programmes-and-oasys" |
30 changes: 30 additions & 0 deletions
30
...mmes-and-oasys/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/IntegrationTest.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,30 @@ | ||
package uk.gov.justice.digital.hmpps | ||
|
||
import org.junit.jupiter.api.Test | ||
import org.springframework.beans.factory.annotation.Autowired | ||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc | ||
import org.springframework.boot.test.context.SpringBootTest | ||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT | ||
import org.springframework.boot.test.mock.mockito.MockBean | ||
import org.springframework.test.web.servlet.MockMvc | ||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get | ||
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status | ||
import uk.gov.justice.digital.hmpps.test.MockMvcExtensions.withToken | ||
import uk.gov.justice.digital.hmpps.telemetry.TelemetryService | ||
|
||
@AutoConfigureMockMvc | ||
@SpringBootTest(webEnvironment = RANDOM_PORT) | ||
internal class IntegrationTest { | ||
@Autowired | ||
lateinit var mockMvc: MockMvc | ||
|
||
@MockBean | ||
lateinit var telemetryService: TelemetryService | ||
|
||
@Test | ||
fun `API call retuns a success response`() { | ||
mockMvc | ||
.perform(get("/example/123").withToken()) | ||
.andExpect(status().is2xxSuccessful) | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
projects/accredited-programmes-and-oasys/src/main/kotlin/uk/gov/justice/digital/hmpps/App.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,11 @@ | ||
package uk.gov.justice.digital.hmpps | ||
|
||
import org.springframework.boot.autoconfigure.SpringBootApplication | ||
import org.springframework.boot.runApplication | ||
|
||
@SpringBootApplication | ||
class App | ||
|
||
fun main(args: Array<String>) { | ||
runApplication<App>(*args) | ||
} |
17 changes: 17 additions & 0 deletions
17
...rammes-and-oasys/src/main/kotlin/uk/gov/justice/digital/hmpps/controller/ApiController.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,17 @@ | ||
package uk.gov.justice.digital.hmpps.controller | ||
|
||
import org.springframework.security.access.prepost.PreAuthorize | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import org.springframework.web.bind.annotation.RestController | ||
|
||
@RestController | ||
class ApiController { | ||
@PreAuthorize("hasRole('ROLE_EXAMPLE')") | ||
@GetMapping(value = ["/example/{inputId}"]) | ||
fun handle( | ||
@PathVariable("inputId") inputId: String | ||
) { | ||
// TODO Not yet implemented | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
projects/accredited-programmes-and-oasys/src/main/resources/application.yml
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,44 @@ | ||
# Default config | ||
server.shutdown: graceful | ||
spring: | ||
jackson: | ||
default-property-inclusion: non_empty | ||
parser: | ||
allow-unquoted-control-chars: true | ||
security.oauth2.client: | ||
registration: | ||
default: | ||
provider: oasys-ords-auth | ||
authorization-grant-type: client_credentials | ||
client-id: ${integrations.ords.client-id} | ||
client-secret: ${integrations.ords.client-secret} | ||
provider: | ||
oasys-ords-auth: | ||
token-uri: ${integrations.ords.url}/oauth/token | ||
threads.virtual.enabled: true | ||
|
||
management: | ||
endpoints.web: | ||
base-path: / | ||
exposure.include: [ "health", "info" ] | ||
endpoint.health.show-details: always | ||
|
||
--- | ||
# Shared dev/test config | ||
spring.config.activate.on-profile: [ "dev", "integration-test" ] | ||
|
||
context.initializer.classes: uk.gov.justice.digital.hmpps.wiremock.WireMockInitialiser | ||
|
||
jwt.authorities: | ||
- ROLE_EXAMPLE | ||
|
||
integrations: | ||
ords: | ||
url: http://localhost:${wiremock.port}/eor/oasys | ||
client-id: accredited-programmes-and-oasys | ||
client-secret: accredited-programmes-and-oasys | ||
|
||
logging.level: | ||
uk.gov.justice.digital.hmpps: DEBUG | ||
org.hibernate.tool.schema: ERROR | ||
org.apache.activemq: WARN |
20 changes: 20 additions & 0 deletions
20
projects/accredited-programmes-and-oasys/tech-docs/.gitignore
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,20 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
# | ||
# If you find yourself ignoring temporary files generated by your text editor | ||
# or operating system, you probably want to add a global ignore instead: | ||
# git config --global core.excludesfile ~/.gitignore_global | ||
|
||
# Ignore bundler config | ||
/.bundle | ||
|
||
# Ignore the build directory | ||
/build | ||
|
||
# Ignore cache | ||
/.sass-cache | ||
/.cache | ||
|
||
# Ignore .DS_store file | ||
.DS_Store | ||
|
||
Staticfile.auth |
3 changes: 3 additions & 0 deletions
3
projects/accredited-programmes-and-oasys/tech-docs/.template_version
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,3 @@ | ||
--- | ||
:remote: https://github.com/alphagov/tech-docs-template.git | ||
:revision: b37e894 |
12 changes: 12 additions & 0 deletions
12
projects/accredited-programmes-and-oasys/tech-docs/Gemfile
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,12 @@ | ||
# If you do not have OpenSSL installed, change | ||
# the following line to use 'http://' | ||
source 'https://rubygems.org' | ||
|
||
# For faster file watcher updates on Windows: | ||
gem 'wdm', '~> 0.1.0', platforms: [:mswin, :mingw, :x64_mingw] | ||
|
||
# Windows does not come with time zone data | ||
gem 'tzinfo-data', platforms: [:mswin, :mingw, :x64_mingw, :jruby] | ||
|
||
# Include the tech docs gem | ||
gem 'govuk_tech_docs' |
Oops, something went wrong.