Return permit-uri from root to securty
[cps.git] / cps-application / src / main / resources / application.yml
1 #  ============LICENSE_START=======================================================
2 #  Copyright (C) 2021 Pantheon.tech
3 #  Modifications Copyright (C) 2021-2022 Bell Canada
4 #  Modifications Copyright (C) 2021-2023 Nordix Foundation
5 #  ================================================================================
6 #  Licensed under the Apache License, Version 2.0 (the "License");
7 #  you may not use this file except in compliance with the License.
8 #  You may obtain a copy of the License at
9 #
10 #        http://www.apache.org/licenses/LICENSE-2.0
11 #
12 #  Unless required by applicable law or agreed to in writing, software
13 #  distributed under the License is distributed on an "AS IS" BASIS,
14 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #  See the License for the specific language governing permissions and
16 #  limitations under the License.
17 #
18 #  SPDX-License-Identifier: Apache-2.0
19 #  ============LICENSE_END=========================================================
20
21 server:
22     port: 8080
23
24 rest:
25     api:
26         cps-base-path: /cps/api
27         ncmp-base-path: /ncmp
28         ncmp-inventory-base-path: /ncmpInventory
29
30 spring:
31     main:
32         banner-mode: "off"
33     application:
34         name: "cps-application"
35     jpa:
36         show-sql: false
37         ddl-auto: create
38         open-in-view: false
39         properties:
40             hibernate.enable_lazy_load_no_trans: true
41             hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
42
43     datasource:
44         url: jdbc:postgresql://${DB_HOST}:${DB_PORT:5432}/cpsdb
45         username: ${DB_USERNAME}
46         password: ${DB_PASSWORD}
47         driverClassName: org.postgresql.Driver
48         hikari:
49             minimumIdle: 5
50             maximumPoolSize: 80
51             idleTimeout: 60000
52             connectionTimeout: 120000
53             leakDetectionThreshold: 30000
54             pool-name: CpsDatabasePool
55
56     cache:
57         type: caffeine
58         cache-names: yangSchema
59         caffeine:
60             spec: maximumSize=10000,expireAfterAccess=10m
61
62     liquibase:
63         change-log: classpath:changelog/changelog-master.yaml
64         labels: ${LIQUIBASE_LABELS}
65
66     servlet:
67         multipart:
68             enabled: true
69             max-file-size: 100MB
70             max-request-size: 100MB
71
72     kafka:
73         bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVER:localhost:9092}
74         security:
75             protocol: PLAINTEXT
76         producer:
77             value-serializer: io.cloudevents.kafka.CloudEventSerializer
78             client-id: cps-core
79         consumer:
80             group-id: ${NCMP_CONSUMER_GROUP_ID:ncmp-group}
81             key-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
82             value-deserializer: org.springframework.kafka.support.serializer.ErrorHandlingDeserializer
83             properties:
84                 spring.deserializer.key.delegate.class: org.apache.kafka.common.serialization.StringDeserializer
85                 spring.deserializer.value.delegate.class: io.cloudevents.kafka.CloudEventDeserializer
86                 spring.json.use.type.headers: false
87
88     jackson:
89         default-property-inclusion: NON_NULL
90         serialization:
91             FAIL_ON_EMPTY_BEANS: false
92     sql:
93         init:
94             mode: ALWAYS
95 app:
96     ncmp:
97         async-m2m:
98             topic: ${NCMP_ASYNC_M2M_TOPIC:ncmp-async-m2m}
99         avc:
100             subscription-topic: ${NCMP_CM_AVC_SUBSCRIPTION:subscription}
101             subscription-forward-topic-prefix: ${NCMP_FORWARD_CM_AVC_SUBSCRIPTION:ncmp-dmi-cm-avc-subscription-}
102             subscription-response-topic: ${NCMP_RESPONSE_CM_AVC_SUBSCRIPTION:dmi-ncmp-cm-avc-subscription}
103             subscription-outcome-topic: ${NCMP_OUTCOME_CM_AVC_SUBSCRIPTION:subscription-response}
104             cm-events-topic: ${NCMP_CM_EVENTS_TOPIC:cm-events}
105     lcm:
106         events:
107             topic: ${LCM_EVENTS_TOPIC:ncmp-events}
108     dmi:
109         cm-events:
110             topic: ${DMI_CM_EVENTS_TOPIC:dmi-cm-events}
111         device-heartbeat:
112             topic: ${DMI_DEVICE_HEARTBEAT_TOPIC:dmi-device-heartbeat}
113
114
115 notification:
116     enabled: true
117     data-updated:
118         topic: ${CPS_CHANGE_EVENT_TOPIC:cps.data-updated-events}
119         filters:
120             enabled-dataspaces: ${NOTIFICATION_DATASPACE_FILTER_PATTERNS:""}
121     async:
122         executor:
123             core-pool-size: 2
124             max-pool-size: 10
125             queue-capacity: 500
126             wait-for-tasks-to-complete-on-shutdown: true
127             thread-name-prefix: Async-
128             time-out-value-in-ms: 2000
129
130 springdoc:
131     swagger-ui:
132         disable-swagger-default-url: true
133         urlsPrimaryName: cps-core
134         urls:
135             - name: cps-core
136               url: /api-docs/cps-core/openapi.yaml
137             - name: cps-ncmp
138               url: /api-docs/cps-ncmp/openapi.yaml
139             - name: cps-ncmp-inventory
140               url: /api-docs/cps-ncmp/openapi-inventory.yaml
141
142
143
144 security:
145     # comma-separated uri patterns which do not require authorization
146     permit-uri: /actuator/**,/swagger-ui.html,/swagger-ui/**,/swagger-resources/**,/api-docs/**
147     auth:
148         username: ${CPS_USERNAME}
149         password: ${CPS_PASSWORD}
150
151 # Actuator
152 management:
153     endpoints:
154         web:
155             exposure:
156                 include: info,health,loggers,prometheus
157     endpoint:
158         health:
159             show-details: always
160             # kubernetes probes: liveness and readiness
161             probes:
162                 enabled: true
163
164 logging:
165     format: json
166     level:
167         org:
168             springframework: INFO
169             onap:
170                 cps: INFO
171 ncmp:
172     dmi:
173         auth:
174             username: ${DMI_USERNAME}
175             password: ${DMI_PASSWORD}
176             enabled: ${DMI_AUTH_ENABLED:true}
177         api:
178             base-path: dmi
179
180     timers:
181         advised-modules-sync:
182             sleep-time-ms: 5000
183         locked-modules-sync:
184             sleep-time-ms: 300000
185         cm-handle-data-sync:
186             sleep-time-ms: 30000
187         subscription-forwarding:
188             dmi-response-timeout-ms: 30000
189         model-loader:
190             retry-time-ms: 1000
191         trust-level:
192             dmi-availability-watchdog-ms: 30000
193
194     modules-sync-watchdog:
195         async-executor:
196             parallelism-level: 10
197
198     model-loader:
199         subscription: true
200         maximum-attempt-count: 20
201
202 # Custom Hazelcast Config.
203 hazelcast:
204     cluster-name: ${CPS_NCMP_CACHES_CLUSTER_NAME:"cps-and-ncmp-common-cache-cluster"}
205     mode:
206         kubernetes:
207             enabled: ${HAZELCAST_MODE_KUBERNETES_ENABLED:false}
208             service-name: ${CPS_NCMP_SERVICE_NAME:"cps-and-ncmp-service"}