Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Add data-space-configuration endpoint (#79)
Browse files Browse the repository at this point in the history
* Add data-space-configuration endpoint

* Update helm chart versions

* Update helm chart versions

* Move endpoint to apisix. Adapt k3s provider config.

* Update helm chart versions

* Fix file name

* Update helm chart versions

* fix json

* Update helm chart versions

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Stefan Wiedemann <[email protected]>
  • Loading branch information
3 people authored Jul 5, 2024
1 parent 537e440 commit a2916a0
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/data-space-connector/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: data-space-connector
description: Umbrella Chart for the FIWARE Data Space Connector, combining all essential parts to be used by a participant.
type: application
version: 5.0.0
version: 5.5.0
dependencies:
- name: postgresql
condition: postgresql.enabled
Expand Down
16 changes: 16 additions & 0 deletions charts/data-space-connector/templates/dsconfig-cm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.dataSpaceConfig.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: dsconfig
namespace: {{ $.Release.Namespace | quote }}
labels:
{{ include "dsc.labels" . | nindent 4 }}
data:
data-space-configuration.json: |-
{
"supported_models": {{ .Values.dataSpaceConfig.supportedModels | toJson }},
"supported_protocols": {{ .Values.dataSpaceConfig.supportedProtocols | toJson }},
"authentication_protocols": {{ .Values.dataSpaceConfig.authenticationProtocols | toJson }}
}
{{- end }}
38 changes: 38 additions & 0 deletions charts/data-space-connector/templates/dsconfig-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{- if .Values.dataSpaceConfig.enabled }}
kind: Deployment
apiVersion: apps/v1
metadata:
name: dsconfig
namespace: {{ $.Release.Namespace | quote }}
labels:
{{ include "dsc.labels" . | nindent 4 }}
spec:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app.kubernetes.io/name: dsconfig
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: dsconfig
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
serviceAccountName: default
containers:
- name: dsconfig-static
imagePullPolicy: Always
image: "lipanski/docker-static-website:2.1.0"
ports:
- name: http
containerPort: 3000
protocol: TCP
volumeMounts:
- name: dsconfig-json
mountPath: /home/static/.well-known/data-space-configuration
volumes:
- name: dsconfig-json
configMap:
name: dsconfig
{{- end }}
19 changes: 19 additions & 0 deletions charts/data-space-connector/templates/dsconfig-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.dataSpaceConfig.enabled }}
apiVersion: v1
kind: Service
metadata:
name: dsconfig
namespace: {{ $.Release.Namespace | quote }}
labels:
{{ include "dsc.labels" . | nindent 4 }}
spec:
type: {{ .Values.dataSpaceConfig.serviceType }}
ports:
- port: {{ .Values.dataSpaceConfig.port }}
targetPort: 3000
protocol: TCP
name: http
selector:
app.kubernetes.io/name: dsconfig
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
21 changes: 20 additions & 1 deletion charts/data-space-connector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -629,4 +629,23 @@ did:

# -- configuration for registering a participant at the til, will most probably only be used in demonstrational enviornments
registration:
enabled: false
enabled: false

# -- configuration for the .well-known/data-space-configuration endpoint document
dataSpaceConfig:
enabled: false

# -- Kubernetes Service type
serviceType: ClusterIP

# -- Kubernetes Service port
port: 3002

# -- Supported data models by the service (array of links to JSON schemas)
supportedModels: []

# -- Supported protocols (e.g.: http,https)
supportedProtocols: []

# -- Supported authentication protocols (e.g.: oid4vp)
authenticationProtocols: []
27 changes: 26 additions & 1 deletion k3s/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ apisix:
plugins:
proxy-rewrite:
uri: /services/data-service/.well-known/openid-configuration
- uri: /.well-known/data-space-configuration
upstream:
nodes:
dsconfig:3002: 1
type: roundrobin
plugins:
proxy-rewrite:
uri: /.well-known/data-space-configuration/data-space-configuration.json
response-rewrite:
headers:
set:
content-type: application/json
- uri: /*
upstream:
nodes:
Expand Down Expand Up @@ -139,6 +151,19 @@ did:
enabled: true
host: did-provider.127.0.0.1.nip.io

dataSpaceConfig:
enabled: true
serviceType: ClusterIP
port: 3002
supportedModels:
- "https://raw.githubusercontent.com/smart-data-models/dataModel.Consumption/master/ConsumptionPoint/schema.json"
- "https://raw.githubusercontent.com/smart-data-models/dataModel.Consumption/master/ConsumptionCost/schema.json"
supportedProtocols:
- http
- https
authenticationProtocols:
- oid4vp

scorpio:
ingress:
enabled: true
Expand Down Expand Up @@ -190,4 +215,4 @@ odrl-pap:
hosts:
- host: pap-provider.127.0.0.1.nip.io
paths:
- "/"
- "/"

0 comments on commit a2916a0

Please sign in to comment.