diff --git a/alfa-client/libs/tech-shared/src/lib/date.util.spec.ts b/alfa-client/libs/tech-shared/src/lib/date.util.spec.ts index fc5bc2c029bbaa651be5cbf7eac39bf2700a7a94..f9277c5ac4d3b76a1b15e66a0bc718c558c1b497 100644 --- a/alfa-client/libs/tech-shared/src/lib/date.util.spec.ts +++ b/alfa-client/libs/tech-shared/src/lib/date.util.spec.ts @@ -24,7 +24,7 @@ import { formatDate, registerLocaleData } from '@angular/common'; import localeDe from '@angular/common/locales/de'; import { - fixPartialYear, + add2000Years, formatDateWithoutYearWithTime, formatForDatabase, formatFullDate, @@ -209,12 +209,12 @@ describe('Date Util', () => { } }); - describe('fixPartialYear', () => { + describe('add2000Years', () => { it('should return Date in the 2000 millennium for 2 digit year value', () => { const dateInput: Date = new Date('0023-10-22'); const yearExpected: number = 2023; - const result: Date = fixPartialYear(dateInput); + const result: Date = add2000Years(dateInput); expect(result.getFullYear()).toBe(yearExpected); }); @@ -222,7 +222,7 @@ describe('Date Util', () => { it('should return Date unchanged for non 2 digit year value', () => { const dateInput: Date = new Date('2023-10-22'); - const result: Date = fixPartialYear(dateInput); + const result: Date = add2000Years(dateInput); expect(result).toBe(dateInput); }); diff --git a/alfa-client/libs/tech-shared/src/lib/date.util.ts b/alfa-client/libs/tech-shared/src/lib/date.util.ts index da5fe02a94d107c9c74e3b2b578da130aaf89fd9..5531d5cf09625ac35d85da39bddc6c5c57b42a19 100644 --- a/alfa-client/libs/tech-shared/src/lib/date.util.ts +++ b/alfa-client/libs/tech-shared/src/lib/date.util.ts @@ -102,7 +102,8 @@ function convertGermanDateString(dateStr: string): Date { return new Date(dateStr.replace(/(.*)\.(.*)\.(.*)/, '$3-$2-$1')); } -export function fixPartialYear(date: Date) { +// Workaround, solange MatDatepicker genutzt wird. +export function add2000Years(date: Date): Date { const year: number = date.getFullYear(); if (year.toString().length !== 2) { return date; diff --git a/alfa-client/libs/ui/src/lib/ui/editor/date-editor/date-editor.component.spec.ts b/alfa-client/libs/ui/src/lib/ui/editor/date-editor/date-editor.component.spec.ts index af091ae59f8bb7dd15807ee95bc512cdd02379ce..24020a5412e79d4e0c21e5c016d3aa6804d613d9 100644 --- a/alfa-client/libs/ui/src/lib/ui/editor/date-editor/date-editor.component.spec.ts +++ b/alfa-client/libs/ui/src/lib/ui/editor/date-editor/date-editor.component.spec.ts @@ -84,14 +84,14 @@ describe('DateEditorComponent', () => { }); describe('onBlur', () => { - it('should not call fixPartialYear if input value is not Date object', () => { + it('should not call add2000Years if input value is not Date object', () => { const inputValue: string = '12.12.2024'; component.fieldControl.setValue(inputValue); - const fixPartialYear = jest.spyOn(dateUtil, 'fixPartialYear'); + const add2000Years = jest.spyOn(dateUtil, 'add2000Years'); component.onBlur(); - expect(fixPartialYear).not.toHaveBeenCalled(); + expect(add2000Years).not.toHaveBeenCalled(); }); describe('if input value is Date object', () => { @@ -101,12 +101,12 @@ describe('DateEditorComponent', () => { component.fieldControl.setValue(inputValue); }); - it('should call fixPartialYear', () => { - const fixPartialYear = jest.spyOn(dateUtil, 'fixPartialYear'); + it('should call add2000Years', () => { + const add2000Years = jest.spyOn(dateUtil, 'add2000Years'); component.onBlur(); - expect(fixPartialYear).toHaveBeenCalledWith(inputValue); + expect(add2000Years).toHaveBeenCalledWith(inputValue); }); it('should call fieldControl.patchValue', () => { diff --git a/alfa-client/libs/ui/src/lib/ui/editor/date-editor/date-editor.component.ts b/alfa-client/libs/ui/src/lib/ui/editor/date-editor/date-editor.component.ts index a2f0076e75436e58d9538642cc00c6fe9bb6b7b9..b93828d71bece9019d6ce554f0e93709114b4bc6 100644 --- a/alfa-client/libs/ui/src/lib/ui/editor/date-editor/date-editor.component.ts +++ b/alfa-client/libs/ui/src/lib/ui/editor/date-editor/date-editor.component.ts @@ -21,7 +21,7 @@ * Die sprachspezifischen Genehmigungen und Beschränkungen * unter der Lizenz sind dem Lizenztext zu entnehmen. */ -import { fixPartialYear } from '@alfa-client/tech-shared'; +import { add2000Years } from '@alfa-client/tech-shared'; import { Component, Input } from '@angular/core'; import { MatDatepickerInputEvent } from '@angular/material/datepicker'; import { isDate } from 'date-fns'; @@ -44,7 +44,7 @@ export class DateEditorComponent extends FormControlEditorAbstractComponent { return; } - const value: Date = fixPartialYear(this.fieldControl.value); + const value: Date = add2000Years(this.fieldControl.value); this.fieldControl.patchValue(value); this.onChange(value); diff --git a/alfa-client/libs/vorgang-detail/src/lib/vorgang-detail-page/vorgang-detail-bescheiden/vorgang-detail-bescheiden-steps/vorgang-detail-bescheiden-weiter-button/vorgang-detail-bescheiden-weiter-button.component.html b/alfa-client/libs/vorgang-detail/src/lib/vorgang-detail-page/vorgang-detail-bescheiden/vorgang-detail-bescheiden-steps/vorgang-detail-bescheiden-weiter-button/vorgang-detail-bescheiden-weiter-button.component.html index 8df4670c7d47d8cfc6b998a7d0a0d0b66a4ff803..d31ebaeb3c8fc5fe0298e697e8430a82db6bcefd 100644 --- a/alfa-client/libs/vorgang-detail/src/lib/vorgang-detail-page/vorgang-detail-bescheiden/vorgang-detail-bescheiden-steps/vorgang-detail-bescheiden-weiter-button/vorgang-detail-bescheiden-weiter-button.component.html +++ b/alfa-client/libs/vorgang-detail/src/lib/vorgang-detail-page/vorgang-detail-bescheiden/vorgang-detail-bescheiden-steps/vorgang-detail-bescheiden-weiter-button/vorgang-detail-bescheiden-weiter-button.component.html @@ -1,6 +1,6 @@ <ods-button *ngIf="showButton$ | async" - (click)="clickEmitter.emit($event)" + (clickEmitter)="clickEmitter.emit()" variant="primary" size="medium" class="mt-8 flex" diff --git a/alfa-server/src/main/resources/application-local.yml b/alfa-server/src/main/resources/application-local.yml index 961e14d6fa3f44e0a1382e4b26c924e1fe0fd2d2..a0ed2b50fa6eb31acfb21af7156aa2c0590a7cc9 100644 --- a/alfa-server/src/main/resources/application-local.yml +++ b/alfa-server/src/main/resources/application-local.yml @@ -12,6 +12,8 @@ grpc: user-manager: address: static://127.0.0.1:9000 negotiationType: PLAINTEXT + vorgang-manager: + negotiationType: PLAINTEXT ozgcloud: feature: diff --git a/alfa-server/src/main/resources/application.yml b/alfa-server/src/main/resources/application.yml index 37fafad40ea8fb37e5177621ffb398ff756ccb16..8e17178fea49083f2e1a5035d0b27d50c6670e50 100644 --- a/alfa-server/src/main/resources/application.yml +++ b/alfa-server/src/main/resources/application.yml @@ -57,7 +57,7 @@ grpc: client: vorgang-manager: address: static://127.0.0.1:9090 - negotiationType: PLAINTEXT + negotiationType: TLS user-manager: address: static://127.0.0.1:9000 negotiationType: TLS diff --git a/src/main/helm/templates/deployment.yaml b/src/main/helm/templates/deployment.yaml index 4a3d38c9b4ff9fc0e3183840d1554b666112e25c..cad88f7ba2e55da7b791497853c8ff633af6aaac 100644 --- a/src/main/helm/templates/deployment.yaml +++ b/src/main/helm/templates/deployment.yaml @@ -72,6 +72,8 @@ spec: value: "/bindings" - name: grpc_client_vorgang-manager_address value: {{ include "app.grpc_client_vorgang_manager_address" . }} + - name: grpc_client_vorgang-manager_negotiationType + value: {{ (.Values.vorgangManager).grpcClientNegotiationType | default "TLS" }} - name: grpc_client_user-manager_address value: {{ include "app.grpc_client_user-manager_address" . }} - name: grpc_client_user-manager_negotiationType @@ -176,12 +178,6 @@ spec: mountPath: "/bindings/ca-certificates/type" subPath: type readOnly: true - {{- if not .Values.disableUserManagerGrpcTls }} - - name: user-manager-tls-certificate - mountPath: "/bindings/ca-certificates/user-manager-tls-ca.pem" - subPath: ca.crt - readOnly: true - {{- end }} - name: temp-dir mountPath: "/tmp" {{- if (.Values.sso).tlsCertName }} @@ -190,15 +186,13 @@ spec: subPath: tls.crt readOnly: true {{- end }} + - name: namespace-ca-cert + mountPath: "/bindings/namespace-certificate" + readOnly: true volumes: - name: bindings configMap: name: alfa-bindings-type - {{- if not .Values.disableUserManagerGrpcTls }} - - name: user-manager-tls-certificate - secret: - secretName: user-manager-tls-cert - {{- end }} - name: temp-dir emptyDir: {} {{- if (.Values.sso).tlsCertName }} @@ -206,6 +200,17 @@ spec: secret: secretName: {{ .Values.sso.tlsCertName }} {{- end }} + - name: namespace-ca-cert + projected: + sources: + - secret: + name: {{ include "app.namespace" . }}-ca-cert + optional: true + items: + - key: ca.crt + path: ca.crt + - configMap: + name: alfa-bindings-type dnsConfig: {} dnsPolicy: ClusterFirst imagePullSecrets: diff --git a/src/test/helm/deployment_bindings_test.yaml b/src/test/helm/deployment_bindings_test.yaml index aca352c23e4dc350e919c0eb8d3bb45cd79ec40c..91c7626679c859414ff092714b8b21f69796c7df 100644 --- a/src/test/helm/deployment_bindings_test.yaml +++ b/src/test/helm/deployment_bindings_test.yaml @@ -38,9 +38,9 @@ set: baseUrl: test.company.local imagePullSecret: image-pull-secret tests: - - it: should have volumes - set: - usermanagerName: user-manager + - it: should have volume mounts + set: + usermanagerName: user-manager asserts: - contains: path: spec.template.spec.containers[0].volumeMounts @@ -49,13 +49,6 @@ tests: mountPath: "/bindings/ca-certificates/type" subPath: type readOnly: true - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: user-manager-tls-certificate - mountPath: "/bindings/ca-certificates/user-manager-tls-ca.pem" - subPath: ca.crt - readOnly: true - contains: path: spec.template.spec.containers[0].volumeMounts content: @@ -68,9 +61,15 @@ tests: mountPath: "/bindings/ca-certificates/ssl-tls-ca.pem" subPath: ca.crt readOnly: true - - it: should have volume mounts - set: - usermanagerName: user-manager + - contains: + path: spec.template.spec.containers[0].volumeMounts + content: + name: namespace-ca-cert + mountPath: "/bindings/namespace-certificate" + readOnly: true + - it: should have volumes + set: + usermanagerName: user-manager asserts: - contains: path: spec.template.spec.volumes @@ -78,12 +77,6 @@ tests: name: bindings configMap: name: alfa-bindings-type - - contains: - path: spec.template.spec.volumes - content: - name: user-manager-tls-certificate - secret: - secretName: user-manager-tls-cert - contains: path: spec.template.spec.volumes content: @@ -93,6 +86,20 @@ tests: path: spec.template.spec.volumes content: name: sso-tls-certificate + - contains: + path: spec.template.spec.volumes + content: + name: namespace-ca-cert + projected: + sources: + - secret: + items: + - key: ca.crt + path: ca.crt + name: sh-helm-test-ca-cert + optional: true + - configMap: + name: alfa-bindings-type - it: should have sso tls cert mount set: usermanagerName: user-manager diff --git a/src/test/helm/deployment_defaults_env_test.yaml b/src/test/helm/deployment_defaults_env_test.yaml index f2b46cc3dcd95eac18f2a1286f97a83034992141..99d108c95f63fc674e22cf2cc369af4db57c0ae5 100644 --- a/src/test/helm/deployment_defaults_env_test.yaml +++ b/src/test/helm/deployment_defaults_env_test.yaml @@ -132,3 +132,21 @@ tests: content: name: grpc_client_user-manager_negotiationType value: TLS + + - it: should set vorgang-manager negotiationType plaintext + set: + vorgangManager.grpcClientNegotiationType: PLAINTEXT + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: grpc_client_vorgang-manager_negotiationType + value: PLAINTEXT + + - it: should contain default vorgang-manager negotiationType tls + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: grpc_client_vorgang-manager_negotiationType + value: TLS