Skip to content

Commit 0eebb93

Browse files
committed
Add project api
1 parent 8f81cd4 commit 0eebb93

4 files changed

Lines changed: 56 additions & 56 deletions

File tree

ods-api-service/chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: ods-api-service
33
description: A Helm chart for deploying ODS API Service on OpenShift
44
type: application
55
version: 0.1.0
6-
appVersion: "0.0.1"
6+
appVersion: "0.0.3"
77
maintainers:
88
- name: ODS Team
99
keywords:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{- if .Values.apis.projects.enabled }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ include "chart.fullname" . }}-projects-config
6+
labels:
7+
{{- include "chart.labels" . | nindent 4 }}
8+
app.kubernetes.io/component: projects-config
9+
data:
10+
API_PROJECTS_MINIEDP_PROVISION_WORKFLOW_NAME: {{ .Values.apis.projects.workflowName | quote }}
11+
API_PROJECTS_LOCATIONS: {{ .Values.apis.projects.locations | quote }}
12+
{{- end }}

ods-api-service/chart/templates/core/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ spec:
6969
- secretRef:
7070
name: {{ include "chart.fullname" . }}-project-users-credentials
7171
{{- end }}
72+
{{- if .Values.apis.projects.enabled }}
73+
- configMapRef:
74+
name: {{ include "chart.fullname" . }}-projects-config
75+
{{- end }}
7276
{{- if .Values.externalServices.uipath.enabled }}
7377
- configMapRef:
7478
name: {{ include "chart.fullname" . }}-uipath-config

ods-api-service/chart/templates/tpl/_application.tpl

Lines changed: 39 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -14,79 +14,49 @@ logging:
1414
spring:
1515
profiles:
1616
active: {{ .Values.env.SPRING_PROFILES_ACTIVE }}
17+
security:
18+
oauth2:
19+
resourceserver:
20+
jwt:
21+
jwk-set-uri: ${OAUTH2_JWK_SET_URI:}
22+
issuer-uri: ${OAUTH2_ISSUER:}
23+
audiences:
24+
- ${OAUTH2_AUDIENCE:}
25+
- ${OAUTH2_AUDIENCE2:99999}
1726
datasource:
1827
url: ${ODS_API_SERVICE_DB_DATASOURCE_URL}
1928
username: ${ODS_API_SERVICE_DB_USER:opendevstack}
2029
password: ${ODS_API_SERVICE_DB_PASSWORD:opendevstack}
2130
driver-class-name: org.postgresql.Driver
2231
hikari:
2332
# Pool sizing — tune per environment
24-
maximum-pool-size: ${DB_POOL_MAX_SIZE:10}
25-
minimum-idle: ${DB_POOL_MIN_IDLE:2}
26-
connection-timeout: 30000
27-
idle-timeout: 600000
28-
max-lifetime: 1800000
33+
maximum-pool-size: ${HIKARI_POOL_MAX_SIZE:10}
34+
minimum-idle: ${HIKARI_MIN_IDLE:2}
35+
connection-timeout: ${HIKARI_CONNECTION_TIMEOUT:30000}
36+
idle-timeout: ${HIKARI_IDLE_TIMEOUT:600000}
37+
max-lifetime: ${HIKARI_MAX_LIFETIME:1800000}
2938
jpa:
3039
hibernate:
31-
# NEVER auto-create/alter — Liquibase owns the schema
32-
ddl-auto: validate
40+
ddl-auto: ${JPA_HIBERNATE_DDL_AUTO:validate}
3341
properties:
3442
hibernate:
35-
dialect: org.hibernate.dialect.PostgreSQLDialect
36-
# Log slow queries (> 500 ms) via Hibernate statistics
37-
generate_statistics: false
38-
# Avoid lazy-loading pitfalls: keep Session scoped to Service, not Request
39-
open-in-view: false
40-
show-sql: false
43+
generate_statistics: ${JPA_HIBERNATE_GENERATE_STATISTICS:false}
44+
open-in-view: ${JPA_OPEN_IN_VIEW:false}
45+
show-sql: ${JPA_SHOW_SQL:false}
4146

4247
management:
4348
endpoints:
4449
web:
4550
exposure:
46-
include: {{ .Values.config.management.endpoints.web.exposure.include }}
47-
{{- if .Values.config.management.endpoint }}
48-
endpoint:
49-
{{ toYaml .Values.config.management.endpoint | nindent 4 }}
50-
{{- end }}
51-
{{- if .Values.config.management.info }}
52-
info:
53-
{{ toYaml .Values.config.management.info | nindent 4 }}
54-
{{- end }}
55-
{{- if .Values.config.management.httpexchanges }}
56-
httpexchanges:
57-
{{ toYaml .Values.config.management.httpexchanges | nindent 4 }}
58-
{{- end }}
59-
60-
{{- if .Values.config.springdoc }}
61-
springdoc:
62-
{{ toYaml .Values.config.springdoc | nindent 2 }}
63-
{{- end }}
64-
65-
openapi:
66-
info:
67-
title: {{ .Values.config.openapi.info.title | quote }}
68-
description: {{ .Values.config.openapi.info.description | quote }}
69-
version: {{ .Values.config.openapi.info.version | quote }}
70-
contact:
71-
name: {{ .Values.config.openapi.info.contact.name | quote }}
72-
email: {{ .Values.config.openapi.info.contact.email | quote }}
73-
{{- if .Values.config.openapi.servers }}
74-
servers:
75-
{{- range .Values.config.openapi.servers }}
76-
- url: {{ .url | quote }}
77-
description: {{ .description | quote }}
78-
{{- end }}
79-
{{- end }}
51+
include: ${MANAGEMENT_ENDPOINTS_INCLUDE:health}
8052

81-
{{- if .Values.config.app }}
8253
# App configuration
83-
app:
84-
{{ toYaml .Values.config.app | nindent 2 }}
54+
{{- if .Values.config.app }}
55+
app: {{ toYaml .Values.config.app | nindent 2 }}
8556
{{- end }}
8657

8758
{{- if .Values.config.otel }}
88-
otel:
89-
{{ toYaml .Values.config.otel | nindent 2 }}
59+
otel: {{ toYaml .Values.config.otel | nindent 2 }}
9060
{{- end }}
9161

9262
automation:
@@ -107,6 +77,7 @@ automation:
10777

10878
{{- if .Values.externalServices.uipath.enabled }}
10979
uipath:
80+
enabled: true
11081
host: ${UIPATH_HOST}
11182
clientId: ${UIPATH_CLIENT_ID}
11283
clientSecret: ${UIPATH_CLIENT_SECRET}
@@ -127,11 +98,18 @@ apis:
12798
project-users:
12899
enabled: {{ .Values.apis.projectUsers.enabled }}
129100
{{- if .Values.apis.projectUsers.enabled }}
130-
ansible-workflow-name: ${API_PROJECT_USERS_WORKFLOW_NAME}
101+
ansible-workflow-name: ${API_PROJECT_USERS_WORKFLOW_NAME:}
131102
token:
132-
secret: ${API_PROJECT_USERS_TOKEN_SECRET}
133-
expiration-hours: ${API_PROJECT_USERS_TOKEN_EXPIRATION_HOURS}
103+
secret: ${API_PROJECT_USERS_TOKEN_SECRET:}
104+
expiration-hours: ${API_PROJECT_USERS_TOKEN_EXPIRATION_HOURS:}
134105
{{- end }}
106+
project:
107+
enabled: {{ .Values.apis.projects.enabled }}
108+
{{- if .Values.apis.projects.enabled }}
109+
ansible-workflow-name: ${API_PROJECTS_MINIEDP_PROVISION_WORKFLOW_NAME}
110+
locations: ${API_PROJECTS_LOCATIONS}
111+
{{- end }}
112+
135113

136114
# External Service Configuration
137115
externalservices:
@@ -204,3 +182,9 @@ externalservices:
204182
{{- end }}
205183
{{- end }}
206184
{{- end -}}
185+
186+
services:
187+
project:
188+
ldap:
189+
group:
190+
pattern: "${SERVICE_PROJECT_LDAP_GROUP_PATTERN}"

0 commit comments

Comments
 (0)