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

[7º] - Release/v2.0.0 authorization: Enabled BPN block and Role Authorization in the Digitla #161

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bcbfcd6
feat: created structure to parse token in frontend and check bpn
Nov 29, 2023
caeca2f
feat: created structure to parse token in frontend and check bpn
Nov 29, 2023
ff95442
feat: added feature to capture not authentication and not availablity…
Nov 29, 2023
22d328c
feat: added bpn check mechanism with global authentication check
Nov 30, 2023
0a5bbb4
fix: fixed error in role fetching by client id
Nov 30, 2023
1931080
chore: added configurations in deployment for frontend
Nov 30, 2023
4ffdd21
Merge branch 'develop' of https://github.com/catenax-ng/tx-digital-pr…
Nov 30, 2023
cd2e4b2
feat: added role authentication trigger
Nov 30, 2023
a06d801
fix: fizxed configuration of frontend
Dec 1, 2023
ef4b45d
feat: added bpn and role checks in the backend
Dec 1, 2023
dfbc0be
chore: added new configuration in helm charts for backend
Dec 1, 2023
ecb4fe5
chore(charts): updated things in the charts configuration
Dec 1, 2023
de053f3
fix: fixed role authentication in backend
Dec 1, 2023
6cfbbe2
chore: added trace logs in the frontend
Dec 1, 2023
c4a3450
feat: added startup authorization checks
Dec 1, 2023
77e83d2
fix(frontend): fixed frontned check bpn function
Dec 1, 2023
d13f55c
fix: fixed details in startup checks
Dec 1, 2023
38218ae
fix: fixed backend bpn check
Dec 1, 2023
78aee04
chore: disabled role check in app
Dec 1, 2023
f2bcd8c
chore: removed debugging logs
Dec 1, 2023
667f973
Merge branch 'develop' into feature/cmp-747/bpn-block
matbmoser Dec 22, 2023
1d2849c
chore: fixed linting of values file
matbmoser Dec 22, 2023
efeb3bc
Merge pull request #202 from catenax-ng/feature/cmp-747/bpn-block
matbmoser Dec 22, 2023
e21fa28
Merge branch 'eclipse-tractusx:main' into release/v2.0.0-authorization
matbmoser Dec 22, 2023
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
4 changes: 2 additions & 2 deletions charts/digital-product-pass/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ type: application
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)

version: 1.4.0
version: 1.5.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.4.0"
appVersion: "1.5.0"
55 changes: 38 additions & 17 deletions charts/digital-product-pass/README.md

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions charts/digital-product-pass/templates/configmap-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ data:
userInfoUri: "https://{{ tpl (.Values.oauth.hostname | default "http://localhost") . }}/auth/realms/{{ .Values.oauth.realm }}/protocol/openid-connect/userinfo"
# -- edc consumer connection configuration
edc:
endpoint: "https://{{ .Values.backend.edc.endpoint }}"
endpoint: "https://{{ .Values.backend.edc.hostname }}"
management: {{ .Values.backend.edc.apis.management }}
catalog: {{ .Values.backend.edc.apis.catalog }}
negotiation: {{ .Values.backend.edc.apis.negotiation }}
Expand All @@ -63,10 +63,14 @@ data:
delay: {{ .Values.backend.edc.delay }} # -- Negotiation status Delay in milliseconds in between async requests [<= 500]
# -- security configuration
security:
check:
enabled: {{ .Values.backend.securityCheck.enabled }}
bpn: {{ .Values.backend.securityCheck.bpn }}
edc: {{ .Values.backend.securityCheck.edc }}
# -- authorization configuration about bpn and role checks
authorization:
bpnAuth: {{ .Values.oauth.bpnCheck.enabled }}
roleAuth: {{ .Values.oauth.roleCheck.enabled }}
# -- checkups done in the startup
startUpChecks:
bpnCheck: {{ .Values.backend.securityCheck.bpn }}
edcCheck: {{ .Values.backend.securityCheck.edc }}
# -- irs configuration
irs:
enabled: {{ .Values.backend.irs.enabled }} # -- Enable search for children in the requests
Expand Down
11 changes: 8 additions & 3 deletions charts/digital-product-pass/templates/deployment-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,22 @@ spec:
allowPrivilegeEscalation: false
runAsUser: 10000
runAsGroup: 3000
env:
env:
- name: "appId"
valueFrom:
secretKeyRef:
key: appId
name: avp-consumer-backend-auth
- name: "client.id"
valueFrom:
secretKeyRef:
key: clientId
name: avp-consumer-backend-cx-registry-auth
name: avp-consumer-backend-auth
- name: "client.secret"
valueFrom:
secretKeyRef:
key: clientSecret
name: avp-consumer-backend-cx-registry-auth
name: avp-consumer-backend-auth
- name: "edc.apiKey"
valueFrom:
secretKeyRef:
Expand Down
15 changes: 15 additions & 0 deletions charts/digital-product-pass/templates/deployment-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@ spec:
- name: "KEYCLOAK_ONLOAD"
value: "{{ .Values.oauth.onLoad }}"

- name: "AUTH_ROLE_CHECK"
value: "{{ .Values.oauth.roleCheck.enabled | default false }}"

- name: "AUTH_BPN_CHECK"
value: "{{ .Values.oauth.bpnCheck.enabled | default false }}"

- name: "AUTH_BPN_NUMBER"
value: "{{ .Values.oauth.bpnCheck.bpn }}"

- name: "APP_PORTAL_URL"
value: "https://{{ .Values.frontend.portal.hostname }}"

- name: "APP_ADMIN_EMAIL"
value: "{{ .Values.frontend.supportContact.adminEmail }}"

- name: "BACKEND_URL"
value: "https://{{ .Values.frontend.backend.hostname }}"

Expand Down
3 changes: 2 additions & 1 deletion charts/digital-product-pass/templates/secret-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@
apiVersion: v1
kind: Secret
metadata:
name: avp-consumer-backend-cx-registry-auth
name: avp-consumer-backend-auth
labels:
{{- include "chart.labels" . | nindent 4 }}
namespace: {{ .Values.namespace }}
type: Opaque
stringData:
appId: {{ .Values.oauth.appId }}
clientId: {{ .Values.oauth.techUser.clientId }}
clientSecret: {{ .Values.oauth.techUser.clientSecret }}
---
Expand Down
29 changes: 18 additions & 11 deletions charts/digital-product-pass/values-beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@ backend:

edc:
xApiKey: <path:material-pass/data/beta/edc/oauth#api.key>
participantId: <path:material-pass/data/beta/edc/participant#bpnNumber>
endpoint: "materialpass.beta.demo.catena-x.net/consumer"
participantId: &bpn <path:material-pass/data/beta/edc/participant#bpnNumber>
hostname: "materialpass.beta.demo.catena-x.net/consumer"

hostname: *hostname
securityCheck:
enabled: true
bpn: true
edc: true

Expand Down Expand Up @@ -83,17 +82,25 @@ frontend:
hosts:
- materialpass.beta.demo.catena-x.net

edc:
xApiKey: <path:material-pass/data/beta/edc/oauth#api.key>

# Product Passport UI Configuration
backend:
hostname: "materialpass.beta.demo.catena-x.net"

supportContact:
adminEmail: "[email protected]"

portal:
hostname: "portal.beta.demo.catena-x.net"

oauth:
hostname: "centralidp.int.demo.catena-x.net"
hostname: "centralidp.data.demo.catena-x.net"
techUser:
clientId: <path:material-pass/data/int/backend#clientId>
clientSecret: <path:material-pass/data/int/backend#clientSecret>
realm: <path:material-pass/data/int/oauth#realm>
appId: <path:material-pass/data/int/oauth#appId>
clientId: <path:material-pass/data/data/backend#clientId>
clientSecret: <path:material-pass/data/data/backend#clientSecret>
realm: <path:material-pass/data/data/oauth#realm>
appId: <path:material-pass/data/data/oauth#appId>
bpnCheck:
enabled: true
bpn: *bpn
roleCheck:
enabled: false
28 changes: 18 additions & 10 deletions charts/digital-product-pass/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ backend:

edc:
xApiKey: <path:material-pass/data/dev/edc/oauth#api.key>
participantId: <path:material-pass/data/dev/edc/participant#bpnNumber>
endpoint: "materialpass.dev.demo.catena-x.net/consumer"
participantId: &bpn <path:material-pass/data/dev/edc/participant#bpnNumber>
hostname: "materialpass.dev.demo.catena-x.net/consumer"

hostname: *hostname

securityCheck:
enabled: true
bpn: true
edc: true

Expand Down Expand Up @@ -84,17 +83,26 @@ frontend:
hosts:
- materialpass.dev.demo.catena-x.net

edc:
xApiKey: <path:material-pass/data/dev/edc/oauth#api.key>

# Product Passport UI Configuration
backend:
hostname: *hostname

supportContact:
adminEmail: "[email protected]"

portal:
hostname: "portal.dev.demo.catena-x.net"

oauth:
hostname: "centralidp.dev.demo.catena-x.net"
techUser:
clientId: <path:material-pass/data/int/backend#clientId>
clientSecret: <path:material-pass/data/int/backend#clientSecret>
realm: <path:material-pass/data/int/oauth#realm>
appId: <path:material-pass/data/int/oauth#appId>
clientId: <path:material-pass/data/dev/backend#clientId>
clientSecret: <path:material-pass/data/dev/backend#clientSecret>
realm: <path:material-pass/data/dev/oauth#realm>
appId: <path:material-pass/data/dev/oauth#appId>
bpnCheck:
enabled: true
bpn: *bpn
roleCheck:
enabled: false

26 changes: 17 additions & 9 deletions charts/digital-product-pass/values-int.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ backend:
nginx.ingress.kubernetes.io/ssl-passthrough: "false"
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
hosts:
- host: &hostname "materialpass.int.demo.catena-x.net"
- host: &hostname "dpp.int.demo.catena-x.net"
paths:
- path: /
pathType: Prefix
Expand All @@ -41,12 +41,11 @@ backend:
- *hostname
edc:
xApiKey: <path:material-pass/data/int/edc/oauth#api.key>
participantId: <path:material-pass/data/int/edc/participant#bpnNumber>
endpoint: "materialpass.int.demo.catena-x.net/consumer"
participantId: &bpn <path:material-pass/data/int/edc/participant#bpnNumber>
hostname: "materialpass.int.demo.catena-x.net/consumer"

hostname: *hostname
securityCheck:
enabled: true
bpn: true
edc: true

Expand All @@ -73,25 +72,34 @@ frontend:
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
nginx.ingress.kubernetes.io/service-upstream: "true"
hosts:
- host: materialpass.int.demo.catena-x.net
- host: dpp.int.demo.catena-x.net
paths:
- path: /passport(/|$)(.*)
pathType: Prefix
tls:
- secretName: tls-secret
hosts:
- materialpass.int.demo.catena-x.net

edc:
xApiKey: <path:material-pass/data/int/edc/oauth#api.key>
- dpp.int.demo.catena-x.net

backend:
hostname: *hostname

supportContact:
adminEmail: "[email protected]"

portal:
hostname: "portal.int.demo.catena-x.net"


oauth:
hostname: "centralidp.int.demo.catena-x.net"
techUser:
clientId: <path:material-pass/data/int/backend#clientId>
clientSecret: <path:material-pass/data/int/backend#clientSecret>
realm: <path:material-pass/data/int/oauth#realm>
appId: <path:material-pass/data/int/oauth#appId>
bpnCheck:
enabled: true
bpn: *bpn
roleCheck:
enabled: false
Loading
Loading