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

Reorg config files #685

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 3 additions & 1 deletion charts/vc-authn-oidc/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "global.fullname" . }}-session-timeout
name: {{ include "global.fullname" . }}-controller-config
labels: {{- include "vc-authn-oidc.labels" . | nindent 4 }}
data:
sessiontimeout.json: |
{{ .Values.controller.sessionTimeout.config | toJson }}
user_variable_substitution.py: |
{{ .Values.controller.userVariableSubsitution | nindent 4 }}
24 changes: 7 additions & 17 deletions charts/vc-authn-oidc/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,9 @@ spec:
secret:
secretName: {{ include "vc-authn-oidc.token.secretName" . }}
defaultMode: 256
- name: auth-session-ttl
- name: controller-config
configMap:
name: {{ include "global.fullname" . }}-session-timeout
- name: custom-variable-substitution
configMap:
name: {{ include "global.fullname" . }}-variable-substitution-config
items:
- key: user_variable_substitution.py
path: user_variable_substitution.py
name: {{ include "global.fullname" . }}-controller-config
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand Down Expand Up @@ -76,10 +70,10 @@ spec:
value: {{ .Values.controller.cameraRedirectUrl }}
- name: CONTROLLER_PRESENTATION_EXPIRE_TIME
value: {{ .Values.controller.presentationExpireTime | quote }}
# - name: CONTROLLER_SESSION_TIMEOUT_CONFIG_FILE
# value: /home/aries/sessiontimeout.json
- name: CONTROLLER_SESSION_TIMEOUT_CONFIG_FILE
value: /etc/controller-config/sessiontimeout.json
- name: CONTROLLER_VARIABLE_SUBSTITUTION_OVERRIDE
value: /home/aries/user_variable_substitution.py
value: /etc/controller-config/user_variable_substitution.py
- name: CONTROLLER_PRESENTATION_CLEANUP_TIME
value: {{ .Values.controller.sessionTimeout.duration | quote }}
- name: ACAPY_AGENT_URL
Expand Down Expand Up @@ -138,12 +132,8 @@ spec:
volumeMounts:
- name: jwt-token
mountPath: /opt/token
- name: auth-session-ttl
mountPath: /home/aries/sessiontimeout.json
subPath: sessiontimeout.json
- name: custom-variable-substitution
mountPath: /home/aries/user_variable_substitution.py
subPath: user_variable_substitution.py
- name: controller-config
mountPath: /etc/controller-config
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
15 changes: 15 additions & 0 deletions charts/vc-authn-oidc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ walletDeepLinkPrefix: bcwallet://aries_proof-request
## @param controller.presentationExpireTime The number of time in seconds a proof request will be valid for
## @param controller.sessionTimeout.duration The number of seconds an auth_sessions in the states defined in controllerSessionTimeoutConfig is kept for
## @param controller.sessionTimeout.config The json list of auth session states that are safe for deletion
## @param controller.uservariablesubsitution The placeholder for the user variable substitution file that can be used to add substitution variables
controller:
cameraRedirectUrl: wallet_howto
presentationExpireTime: 300
Expand All @@ -49,6 +50,20 @@ controller:
- expired
- failed
- abandoned
userVariableSubsitution: |-
# This is a default placeholder Python file
# Add any extensions to user variables here. Example below:

# def sub_days_plus_one(days: str) -> int:
# """Strings like '$sub_days_plus_one_4' will be replaced with the
# final number incremented by one. In this case 5.
# $sub_days_plus_one_4 -> 5
# $sub_days_plus_one_10 -> 11"""
# return int(days) + 1

# variable_substitution_map.add_variable_substitution(
# r"\$sub_days_plus_one_(\d+)", sub_days_plus_one
# )
## @param useHTTPS Prepend Agent and Admin URLs with `https`
useHTTPS: true
## @param logLevel Accepts one of the following values: CRITICAL, ERROR, WARNING, INFO, DEBUG
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ services:
- 5678:5678
volumes:
- ../oidc-controller:/app:rw
- ./oidc-controller/config/sessiontimeout.json:/home/aries/sessiontimeout.json
- ./oidc-controller/config/user_variable_substitution.py:/home/aries/user_variable_substitution.py
- ./oidc-controller/config/sessiontimeout.json:/etc/controller-config/sessiontimeout.json
- ./oidc-controller/config/user_variable_substitution.py:/etc/controller-config/user_variable_substitution.py
networks:
- vc_auth

Expand Down
4 changes: 2 additions & 2 deletions docker/manage
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ configureEnvironment() {
export CONTROLLER_PRESENTATION_CLEANUP_TIME=86400

# The path to the auth_session timeouts config file
export CONTROLLER_SESSION_TIMEOUT_CONFIG_FILE="/home/aries/sessiontimeout.json"
export CONTROLLER_SESSION_TIMEOUT_CONFIG_FILE="/etc/controller-config/sessiontimeout.json"

# Extend Variable Substitutions
export CONTROLLER_VARIABLE_SUBSTITUTION_OVERRIDE="/home/aries/user_variable_substitution.py"
export CONTROLLER_VARIABLE_SUBSTITUTION_OVERRIDE="/etc/controller-config/user_variable_substitution.py"

#controller app settings
export INVITATION_LABEL=${INVITATION_LABEL:-"VC-AuthN"}
Expand Down